1

I am trying to implement an example that is able to generate n grams from a sentence (same question asked here N-gram generation from a sentence) with the current latest version of Lucene (Lucene 4.9). I found several examples, but made ​​with previous versions of Lucene (one on all http://toolongdidntread.com/lucene/using-lucene-to-generate-n-grams/).

In all the examples, if you do not use the correct libraries (the correct version), I get an "abstract method error". Can someone help me to implement an example, using libraries of version 4.9?

Thanks in advance.

Community
  • 1
  • 1
Davide Patti
  • 3,391
  • 2
  • 18
  • 20
  • While there have been considerable changes to Lucene since the cited question, [ShingleFilter](http://lucene.apache.org/core/4_9_0/analyzers-common/org/apache/lucene/analysis/shingle/ShingleFilter.html) is still what you are looking for. Can provide more details on the exact problem you are having and what you have tried so far? – femtoRgon Aug 11 '14 at 18:13
  • I saw your response(http://stackoverflow.com/questions/13433670/java-lucene-ngramtokenizer) and i solved it. (I forgot to invoke the reset on the TokenStream) Thanks for the reply. – Davide Patti Aug 12 '14 at 07:11

0 Answers0