How to use most-common-words-by-language - 2 common examples

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 1 year ago

Package Health Score

49 / 100
Full package analysis

Popular most-common-words-by-language functions