Maintans a set of words for a sentences generator

author etessore
version 1.0.0
package classes
todo maintain an ordinate array so that insertion and deletion will be more efficent

 Methods

Initializes the dictionary

__construct() 

Adds the given $word to the current set

add_word(string $word) : \GeneratorDictionary

Parameters

$word

string

the word

Returns

\GeneratorDictionary$this for chainability

Retrieves all the usable words of this dictionary

get_all_words() : \the

Returns

\thefull set of words

Retrieves the number of usable words in this dictionary

number_of_words() : \the

Returns

\thenumber of words in the current dictionary

Removes the given words from the current set

remove_word(string $word) : \GeneratorDictionary

Parameters

$word

string

the word

Returns

\GeneratorDictionary$this for chainability

 Properties

 

the number of usable words

$count : int
 

a list of usable words

$words : array