Dictionary

lib/Dictionary~ Dictionary

Dictionary

Constructor

new Dictionary()

Description:
  • Constructor for the Dictionary class. This class is abstract and cannot be instantiated directly.

Source:
Throws:

Will throw an error if attempted to instantiate.

Type
Error

Methods

filteredWordList(minLen, maxLen) → {Array}

Description:
  • Find the list of words with a length that falls in the range of the min and max parameters

Source:
Parameters:
Name Type Description
minLen number

minimum length

maxLen number

maximum length

Returns:
  • list of filtered words
Type
Array

getLength() → {integer}

Description:
  • Return the length of the word list

Source:
Returns:
  • length of the word list
Type
integer

getMaxWordLength() → {number}

Description:
  • Get the length of the largest word in the list

Source:
Returns:
  • length
Type
number

getMinWordLength() → {number}

Description:
  • Get the length of the shortest word in the list

Source:
Returns:
  • length
Type
number

word(index) → {string}

Description:
  • Return a word from the list

Source:
Parameters:
Name Type Description
index number
Returns:
  • the word at the index position
Type
string

wordList() → {Array}

Description:
  • Return the word list of the dictionary

Source:
Returns:
  • list of words
Type
Array