nl_tokens: Sorts combinations based on their relevance and length .
pl_tokens: function sortCombinations ( wordCombinations ) { wordCombinations . <mask> ( function ( combinationA , combinationB ) { const difference = combinationB . getRelevance ( ) - combinationA . getRelevance ( ) ; // The combination with the highest relevance comes first. if ( difference !== 0 ) { return difference ; } // In case of a tie on relevance, the longest combination comes first. return combinationB . getLength ( ) - combinationA . getLength ( ) ; } ) ; }