nl_tokens: Returns the relevant words in a given text .
pl_tokens: function getRelevantWords ( text , locale ) { let language = getLanguage ( locale ) ; if ( ! functionWordLists . hasOwnProperty ( language ) ) { language = "en" ; } const functionWords = functionWordLists [ language ] ; const words = getWordCombinations ( text , 1 , functionWords . all ) ; const wordCount = words . length ; let oneWordCombinations = getRelevantCombinations ( calculateOccurrences ( words ) ) ; sortCombinations ( oneWordCombinations ) ; oneWordCombinations = take ( oneWordCombinations , 100 ) ; const oneWordRelevanceMap = { } ; forEach ( oneWordCombinations , function ( combination ) { oneWordRelevanceMap [ combination . getCombination ( ) ] = combination . getRelevance ( ) ; } ) ; const twoWordCombinations = calculateOccurrences ( getWordCombinations ( text , 2 , functionWords . all ) ) ; const threeWordCombinations = calculateOccurrences ( getWordCombinations ( text , 3 , functionWords . all ) ) ; const fourWordCombinations = calculateOccurrences ( getWordCombinations ( <mask> , 4 , functionWords . all ) ) ; const fiveWordCombinations = calculateOccurrences ( getWordCombinations ( text , 5 , functionWords . all ) ) ; let combinations = oneWordCombinations . concat ( twoWordCombinations , threeWordCombinations , fourWordCombinations , fiveWordCombinations ) ; combinations = filterCombinations ( combinations , functionWords , language ) ; forEach ( combinations , function ( combination ) { combination . setRelevantWords ( oneWordRelevanceMap ) ; } ) ; combinations = getRelevantCombinations ( combinations ) ; sortCombinations ( combinations ) ; if ( wordCount >= wordCountLowerLimit ) { combinations = filterOnDensity ( combinations , wordCount , densityLowerLimit , densityUpperLimit ) ; } return take ( combinations , relevantWordLimit ) ; }