@Test public void instanceIdFeatureTest() throws Exception { AnalysisEngine engine = createEngine(NoOpAnnotator.class); JCas jcas = engine.newJCas(); jcas.setDocumentLanguage("en"); engine.process(jcas); TextClassificationTarget unit1 = new TextClassificationTarget(jcas, 0, 1); unit1.setId(0); unit1.addToIndexes(); JCasId id = new JCasId(jcas); id.setId(123); id.addToIndexes(); Feature feature = InstanceIdFeature.retrieve(jcas, unit1); Feature feature2 = InstanceIdFeature.retrieve(jcas); Feature feature3 = InstanceIdFeature.retrieve(jcas, unit1, 5); assertEquals(feature.getValue(), "123_0"); assertEquals(feature2.getValue(), "123"); assertEquals(feature3.getValue(), "123_5_0"); }
public static Feature retrieve(JCas jcas) throws TextClassificationException { String fullId = getFullId(jcas); return new Feature(ID_FEATURE_NAME, fullId, FeatureType.STRING); }
InstanceIdFeature { public static Feature retrieve(JCas jcas) throws TextClassificationException { String fullId = getFullId(jcas); return new Feature(ID_FEATURE_NAME, fullId, FeatureType.STRING); } }
InstanceIdFeature { public static Feature retrieve(JCas jcas) throws TextClassificationException { String fullId = getFullId(jcas); return new Feature(ID_FEATURE_NAME, fullId, FeatureType.STRING); }  }
InstanceIdFeature { public static Feature retrieve(JCas jcas) throws TextClassificationException { String fullId = getFullId(jcas); return new Feature(ID_FEATURE_NAME, fullId, FeatureType.STRING); }  static Feature retrieve(JCas jcas); static Feature retrieve(JCas jcas, TextClassificationTarget unit); static Feature retrieve(JCas jcas, TextClassificationTarget unit, Integer sequenceId); }
InstanceIdFeature { public static Feature retrieve(JCas jcas) throws TextClassificationException { String fullId = getFullId(jcas); return new Feature(ID_FEATURE_NAME, fullId, FeatureType.STRING); }  static Feature retrieve(JCas jcas); static Feature retrieve(JCas jcas, TextClassificationTarget unit); static Feature retrieve(JCas jcas, TextClassificationTarget unit, Integer sequenceId);  }