Skip to content

Latest commit

 

History

History

trigrams

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Trigrams are a special case of the n-gram, where n is 3. One trigram is a continuous sequence of 3 chars in phrase. Wikipedia

  • return all trigrams for the given phrase
  • replace spaces with _
  • return an empty string for phrases shorter than 3

Example:

trigrams('the quick red') == the he_ e_q _qu qui uic ick ck_ k_r _re red