IobEncoder { public IobEncoder(CAS aCas, Type aType, Feature aValueFeature) { this(aCas, aType, aValueFeature, false); } IobEncoder(CAS aCas, Type aType, Feature aValueFeature);  IobEncoder(CAS aCas, Type aType, Feature aValueFeature, boolean aIob1); String encode(Token token);  }
@Test public void iobEncoderTest() throws Exception { String[] expected = new String[] { "O", "O", "O", "B-NP", "I-NP", "I-NP", "I-NP", "O", "O", "O", "O", "O", "B-NP", "O", "B-NP", "O", "O", "O" }; JCas jcas = getJCas(); Type chunkType = JCasUtil.getType(jcas, Chunk.class); Feature chunkValue = chunkType.getFeatureByBaseName("chunkValue"); IobEncoder encoder = new IobEncoder(jcas.getCas(), chunkType, chunkValue); int i = 0; for (Token token : JCasUtil.select(jcas, Token.class)) { assertEquals(expected[i], encoder.encode(token)); i++; } }