1.0.1 • Published 2 years ago

@altafonte/words v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Words

Words info utils

FunctionDescription
generateCharacterRankingSetAnalizes 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 }
normalizeCharacterRankingNormalizes values of a generated Ranking: { a: 3, r: 2, z: 1 }
getWordRankUses a Ranking to calculate the score of a given word
getSortedWordsByRankingReturns the word's array sorted according to each word's score.
getMostValuableWordReturns 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

FunctionDescription
wordPassesFilterChecks that a word passes a given filter
filterWordsFilters words array according to the given filters