0

I am intending to use the n-gram code from this article. The algorithm produces these tri-gram results:

t, th, the, he, e, q, qu, qui, uic, ick, ck, k, r, re, red, ed, d

for the text the quick red

However wikipedia, reckons it should be:

the  qui  k_r
he_  uic  _re
e_q  ick  red
_qu  ck_

(space indicated by ‘_’).

What is correct? Are there any other C# implementation out there?

2 Answers 2

2

The second example is correct.

ps. Why do you generate trigrams for the complete text and not only for words? What is your use case?

1
  • I believe this is useful for 'words' which actually consist of two strings (i.e. are separated by a space). This would be lost if a apply a word breaker first.
    – cs0815
    Sep 30, 2010 at 12:37
2

The first is correct. I uses character N-gram on my thesis. You must move forward and pass one character for each step. In this condition, similar words can be found.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.