How to use the most-common-words-by-language/loadWords function in most-common-words-by-language

To help you get started, we’ve selected a few most-common-words-by-language examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github oprogramador / most-common-words-by-language / src / findWord.js View on Github external
function findWord(word) {
  const allWords = loadWords();

  return Object.assign(
    {},
    ...Object.entries(allWords)
      .map(([name, words]) => {
        const foundIndex = words.findIndex(w => w.toLowerCase() === word.toLowerCase());

        return foundIndex >= 0 ? { [name]: foundIndex + 1 } : {};
      }),
  );
}
github oprogramador / most-common-words-by-language / src / getWordsList.js View on Github external
function getWordsList(language, count) {
  const words = loadWords();

  return words[language].slice(0, count);
}

most-common-words-by-language

List of the most common words in many languages

MIT
Latest version published 6 months ago

Package Health Score

65 / 100
Full package analysis

Popular most-common-words-by-language functions