@Test public void test() { final int testTokenIndex = 0; AdaptiveFeatureGenerator generator = new TokenFeatureGenerator(false); generator.createFeatures(features, testSentence, testTokenIndex, null); Assert.assertEquals(1, features.size()); Assert.assertEquals("w=This", features.get(0)); }
public void createFeatures(List<String> features, String[] tokens, int index, String[] preds) { if (lowercase) { features.add(WORD_PREFIX + "=" + StringUtil.toLowerCase(tokens[index])); } else { features.add(WORD_PREFIX + "=" + tokens[index]); } }
TokenFeatureGenerator implements AdaptiveFeatureGenerator { public void createFeatures(List<String> features, String[] tokens, int index, String[] preds) { if (lowercase) { features.add(WORD_PREFIX + "=" + StringUtil.toLowerCase(tokens[index])); } else { features.add(WORD_PREFIX + "=" + tokens[index]); } } }
TokenFeatureGenerator implements AdaptiveFeatureGenerator { public void createFeatures(List<String> features, String[] tokens, int index, String[] preds) { if (lowercase) { features.add(WORD_PREFIX + "=" + StringUtil.toLowerCase(tokens[index])); } else { features.add(WORD_PREFIX + "=" + tokens[index]); } } TokenFeatureGenerator(boolean lowercase);  TokenFeatureGenerator(); }
TokenFeatureGenerator implements AdaptiveFeatureGenerator { public void createFeatures(List<String> features, String[] tokens, int index, String[] preds) { if (lowercase) { features.add(WORD_PREFIX + "=" + StringUtil.toLowerCase(tokens[index])); } else { features.add(WORD_PREFIX + "=" + tokens[index]); } } TokenFeatureGenerator(boolean lowercase);  TokenFeatureGenerator(); void createFeatures(List<String> features, String[] tokens, int index, String[] preds); }
TokenFeatureGenerator implements AdaptiveFeatureGenerator { public void createFeatures(List<String> features, String[] tokens, int index, String[] preds) { if (lowercase) { features.add(WORD_PREFIX + "=" + StringUtil.toLowerCase(tokens[index])); } else { features.add(WORD_PREFIX + "=" + tokens[index]); } } TokenFeatureGenerator(boolean lowercase);  TokenFeatureGenerator(); void createFeatures(List<String> features, String[] tokens, int index, String[] preds);  }