@Test public final void test() throws EdisonException { TextAnnotation ta = DummyTextAnnotationGenerator.generateAnnotatedTextAnnotation(false, 3); assertEquals(CorelexFeatureExtractor.instance.getWordFeatures(ta, 1).toString(), "[cae]"); assertEquals(CorelexFeatureExtractor.instance.getWordFeatures(ta, 20).toString(), "[avt]"); assertEquals(CorelexFeatureExtractor.instance.getWordFeatures(ta, 24).toString(), "[com]"); assertEquals(CorelexFeatureExtractor.instance.getWordFeatures(ta, 27).toString(), "[tme]"); }
@Override public Set<Feature> getWordFeatures(TextAnnotation ta, int wordPosition) throws EdisonException { if (data.size() == 0) loadDataFromClassPath(); String lemma = WordHelpers.getLemma(ta, wordPosition); Set<Feature> features = new LinkedHashSet<>(); if (data.containsKey(lemma)) { features.add(DiscreteFeature.create(data.get(lemma))); } return features; }
CorelexFeatureExtractor extends WordFeatureExtractor { @Override public Set<Feature> getWordFeatures(TextAnnotation ta, int wordPosition) throws EdisonException { if (data.size() == 0) loadDataFromClassPath(); String lemma = WordHelpers.getLemma(ta, wordPosition); Set<Feature> features = new LinkedHashSet<>(); if (data.containsKey(lemma)) { features.add(DiscreteFeature.create(data.get(lemma))); } return features; } }
CorelexFeatureExtractor extends WordFeatureExtractor { @Override public Set<Feature> getWordFeatures(TextAnnotation ta, int wordPosition) throws EdisonException { if (data.size() == 0) loadDataFromClassPath(); String lemma = WordHelpers.getLemma(ta, wordPosition); Set<Feature> features = new LinkedHashSet<>(); if (data.containsKey(lemma)) { features.add(DiscreteFeature.create(data.get(lemma))); } return features; } CorelexFeatureExtractor(boolean useLastWordOfMultiwordConstituents);  CorelexFeatureExtractor(); }
CorelexFeatureExtractor extends WordFeatureExtractor { @Override public Set<Feature> getWordFeatures(TextAnnotation ta, int wordPosition) throws EdisonException { if (data.size() == 0) loadDataFromClassPath(); String lemma = WordHelpers.getLemma(ta, wordPosition); Set<Feature> features = new LinkedHashSet<>(); if (data.containsKey(lemma)) { features.add(DiscreteFeature.create(data.get(lemma))); } return features; } CorelexFeatureExtractor(boolean useLastWordOfMultiwordConstituents);  CorelexFeatureExtractor(); @Override Set<Feature> getWordFeatures(TextAnnotation ta, int wordPosition); @Override String getName(); }
CorelexFeatureExtractor extends WordFeatureExtractor { @Override public Set<Feature> getWordFeatures(TextAnnotation ta, int wordPosition) throws EdisonException { if (data.size() == 0) loadDataFromClassPath(); String lemma = WordHelpers.getLemma(ta, wordPosition); Set<Feature> features = new LinkedHashSet<>(); if (data.containsKey(lemma)) { features.add(DiscreteFeature.create(data.get(lemma))); } return features; } CorelexFeatureExtractor(boolean useLastWordOfMultiwordConstituents);  CorelexFeatureExtractor(); @Override Set<Feature> getWordFeatures(TextAnnotation ta, int wordPosition); @Override String getName(); static final CorelexFeatureExtractor instance; }