@altafonte/words
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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

Package Sidebar

Install

npm i @altafonte/words

Weekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

11.6 kB

Total Files

10

Last publish

Collaborators

  • joseluis.garcia.altafonte
  • adrm
  • agm-dev
  • tony.martin