This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module NGramParsing = | |
let GetNGrams tokens nGramOrder outputDelimiter = | |
tokens | |
|> Seq.windowed nGramOrder | |
|> Seq.map (String.concat outputDelimiter) |
NGramParsing.GetNGrams(new [] { "This", "is", "a", "test" }, 2, "|");
Would yield:
{ "This|is", "is|a", "a|test" }
No comments:
Post a Comment