@Test public void extractTest1() throws Exception { NamedEntity ne1 = new NamedEntity(jcas1, 0, 4); ne1.addToIndexes(); SharedNEsFeatureExtractor extractor = new SharedNEsFeatureExtractor(); Set<Feature> features = extractor.extract(jcas1, jcas2); assertEquals(1, features.size()); for (Feature feature : features) { assertFeature("SharedNEs", false, feature); } NamedEntity ne2 = new NamedEntity(jcas2, 0, 4); ne2.addToIndexes(); features = extractor.extract(jcas1, jcas2); assertEquals(1, features.size()); for (Feature feature : features) { assertFeature("SharedNEs", true, feature); } }
@Override public Set<Feature> extract(JCas view1, JCas view2) throws TextClassificationException { return new Feature("SharedNEs", !Collections.disjoint(getNEs(view1), getNEs(view2)), FeatureType.NUMERIC).asSet(); }
SharedNEsFeatureExtractor extends FeatureExtractorResource_ImplBase implements PairFeatureExtractor { @Override public Set<Feature> extract(JCas view1, JCas view2) throws TextClassificationException { return new Feature("SharedNEs", !Collections.disjoint(getNEs(view1), getNEs(view2)), FeatureType.NUMERIC).asSet(); } }
SharedNEsFeatureExtractor extends FeatureExtractorResource_ImplBase implements PairFeatureExtractor { @Override public Set<Feature> extract(JCas view1, JCas view2) throws TextClassificationException { return new Feature("SharedNEs", !Collections.disjoint(getNEs(view1), getNEs(view2)), FeatureType.NUMERIC).asSet(); }  }
SharedNEsFeatureExtractor extends FeatureExtractorResource_ImplBase implements PairFeatureExtractor { @Override public Set<Feature> extract(JCas view1, JCas view2) throws TextClassificationException { return new Feature("SharedNEs", !Collections.disjoint(getNEs(view1), getNEs(view2)), FeatureType.NUMERIC).asSet(); }  @Override Set<Feature> extract(JCas view1, JCas view2); }
SharedNEsFeatureExtractor extends FeatureExtractorResource_ImplBase implements PairFeatureExtractor { @Override public Set<Feature> extract(JCas view1, JCas view2) throws TextClassificationException { return new Feature("SharedNEs", !Collections.disjoint(getNEs(view1), getNEs(view2)), FeatureType.NUMERIC).asSet(); }  @Override Set<Feature> extract(JCas view1, JCas view2);  }