@altafonte/words
v1.0.1
Published
Provides operations with words
Downloads
9
Readme
Words
Words info utils
| Function | Description |
|-|-|
| generateCharacterRankingSet
| Analizes an array of words and generates a Ranking object that contains information about how many times every character is present (unique) in the words of the array. Example: { a: 23, r: 7, z: 1 }
|
| normalizeCharacterRanking
| Normalizes values of a generated Ranking: { a: 3, r: 2, z: 1 }
|
| getWordRank
| Uses a Ranking to calculate the score of a given word |
| getSortedWordsByRanking
| Returns the word's array sorted according to each word's score. |
| getMostValuableWord
| Returns the most valuable word from a word's array. The most valuable is the word whose characters are the most repeated in the word's array (ignores repeated characters in the same word). |
Word's filters
| Function | Description |
|-|-|
| wordPassesFilter
| Checks that a word passes a given filter |
| filterWords
| Filters words array according to the given filters |