@Test public void testNoWAC() { final int testTokenIndex = 3; AdaptiveFeatureGenerator generator = new TokenClassFeatureGenerator(false); generator.createFeatures(features, testSentence, testTokenIndex, null); Assert.assertEquals(1, features.size()); Assert.assertEquals("wc=ic", features.get(0)); }
public void createFeatures(List<String> features, String[] tokens, int index, String[] preds) { String wordClass = FeatureGeneratorUtil.tokenFeature(tokens[index]); features.add(TOKEN_CLASS_PREFIX + "=" + wordClass); if (generateWordAndClassFeature) { features.add(TOKEN_AND_CLASS_PREFIX + "=" + StringUtil.toLowerCase(tokens[index]) + "," + wordClass); } }
TokenClassFeatureGenerator implements AdaptiveFeatureGenerator { public void createFeatures(List<String> features, String[] tokens, int index, String[] preds) { String wordClass = FeatureGeneratorUtil.tokenFeature(tokens[index]); features.add(TOKEN_CLASS_PREFIX + "=" + wordClass); if (generateWordAndClassFeature) { features.add(TOKEN_AND_CLASS_PREFIX + "=" + StringUtil.toLowerCase(tokens[index]) + "," + wordClass); } } }
TokenClassFeatureGenerator implements AdaptiveFeatureGenerator { public void createFeatures(List<String> features, String[] tokens, int index, String[] preds) { String wordClass = FeatureGeneratorUtil.tokenFeature(tokens[index]); features.add(TOKEN_CLASS_PREFIX + "=" + wordClass); if (generateWordAndClassFeature) { features.add(TOKEN_AND_CLASS_PREFIX + "=" + StringUtil.toLowerCase(tokens[index]) + "," + wordClass); } } TokenClassFeatureGenerator();  TokenClassFeatureGenerator(boolean generateWordAndClassFeature); }
TokenClassFeatureGenerator implements AdaptiveFeatureGenerator { public void createFeatures(List<String> features, String[] tokens, int index, String[] preds) { String wordClass = FeatureGeneratorUtil.tokenFeature(tokens[index]); features.add(TOKEN_CLASS_PREFIX + "=" + wordClass); if (generateWordAndClassFeature) { features.add(TOKEN_AND_CLASS_PREFIX + "=" + StringUtil.toLowerCase(tokens[index]) + "," + wordClass); } } TokenClassFeatureGenerator();  TokenClassFeatureGenerator(boolean generateWordAndClassFeature); void createFeatures(List<String> features, String[] tokens, int index, String[] preds); }
TokenClassFeatureGenerator implements AdaptiveFeatureGenerator { public void createFeatures(List<String> features, String[] tokens, int index, String[] preds) { String wordClass = FeatureGeneratorUtil.tokenFeature(tokens[index]); features.add(TOKEN_CLASS_PREFIX + "=" + wordClass); if (generateWordAndClassFeature) { features.add(TOKEN_AND_CLASS_PREFIX + "=" + StringUtil.toLowerCase(tokens[index]) + "," + wordClass); } } TokenClassFeatureGenerator();  TokenClassFeatureGenerator(boolean generateWordAndClassFeature); void createFeatures(List<String> features, String[] tokens, int index, String[] preds);  }