N-gram and Fast Pattern Extraction Algorithm

by gowtham 2010-02-09 09:55:50

ConstructPatterns(src, delimiters, n, fixed)
{
des = AllocateBuffer()
Copy(des, src)
DiscardDelimiters(des, delimiters)
dic = InitializePatternsDictionary()

pattern = InitializeNewPattern(des)
While(des)
{
node = dic.Insert(pattern)
if(!fixed AND node.IsRepeated)
AddWordToPattern(des, pattern)
else
pattern = InitializeNewPattern(des)
UpdateBuffer(des)
}
}

Tagged in:

1160
like
0
dislike
0
mail
flag

You must LOGIN to add comments