PHP Class Sastrawi\Dictionary\ArrayDictionary

Inheritance: implements Sastrawi\Dictionary\DictionaryInterface
Show file Open project: sastrawi/sastrawi Class Usage Examples

Protected Properties

Property Type Description
$words string[]

Public Methods

Method Description
__construct ( array $words = [] )
add ( string $word ) : void Add a word to the dictionary
addWords ( array $words ) : void Add multiple words to the dictionary
addWordsFromTextFile ( $filePath, $delimiter = " " ) : void Add words from a text file to the dictionary
contains ( $word )
count ( )
remove ( string $word ) : void Remove a word from the dictionary

Method Details

__construct() public method

public __construct ( array $words = [] )
$words array

add() public method

Add a word to the dictionary
public add ( string $word ) : void
$word string
return void

addWords() public method

Add multiple words to the dictionary
public addWords ( array $words ) : void
$words array
return void

addWordsFromTextFile() public method

Add words from a text file to the dictionary
public addWordsFromTextFile ( $filePath, $delimiter = " " ) : void
return void

contains() public method

public contains ( $word )

count() public method

public count ( )

remove() public method

Remove a word from the dictionary
public remove ( string $word ) : void
$word string
return void

Property Details

$words protected property

protected string[] $words
return string[]