What do you think of this change? This can break compatibility with old Doccat models created using the NGramFeatureGenerator. But probably the old models are not working anyway.
Thank you William 2014-04-16 13:39 GMT-03:00 <co...@apache.org>: > Author: colen > Date: Wed Apr 16 16:39:40 2014 > New Revision: 1587969 > > URL: http://svn.apache.org/r1587969 > Log: > OPENNLP-673 Added prefix to the NGram feature generator > > Modified: > > opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/doccat/NGramFeatureGenerator.java > > Modified: > opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/doccat/NGramFeatureGenerator.java > URL: > http://svn.apache.org/viewvc/opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/doccat/NGramFeatureGenerator.java?rev=1587969&r1=1587968&r2=1587969&view=diff > > ============================================================================== > --- > opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/doccat/NGramFeatureGenerator.java > (original) > +++ > opennlp/trunk/opennlp-tools/src/main/java/opennlp/tools/doccat/NGramFeatureGenerator.java > Wed Apr 16 16:39:40 2014 > @@ -28,7 +28,7 @@ public class NGramFeatureGenerator imple > List<String> features = new ArrayList<String>(); > > for (int i = 0; i < text.length - 1; i++) { > - features.add(text[i] + " " + text[i + 1]); > + features.add("ng=" + text[i] + ":" + text[i + 1]); > } > > return features; > > >