@Test public void canConvertLemmasWithTags() { String[] lemma = {MISSING_VALUE, MISSING_VALUE, MISSING_VALUE, "lemma", MISSING_VALUE}; sentence.lemmas_$eq(Some.apply(lemma)); String[] tags = {"DT", "VBZ", "DT", "NN", "."}; sentence.tags_$eq(Some.apply(tags)); when(document.sentences()).thenReturn(new Sentence[] {sentence}); DocumentConverter converter = new DocumentConverter(jCas, document); converter.convert(); Collection<WordToken> actual = JCasUtil.select(jCas, WordToken.class); assertEquals(5, actual.size()); Iterator<WordToken> iterator = actual.iterator(); WordToken next = iterator.next(); assertEquals(0, next.getLemmas().size()); next = iterator.next(); assertEquals(0, next.getLemmas().size()); next = iterator.next(); assertEquals(0, next.getLemmas().size()); next = iterator.next(); assertEquals(1, next.getLemmas().size()); assertEquals("NN", next.getLemmas(0).getPartOfSpeech()); next = iterator.next(); assertEquals(0, next.getLemmas().size()); }
public void convert() { for (Sentence sentence : document.sentences()) { convert(sentence); } }
DocumentConverter { public void convert() { for (Sentence sentence : document.sentences()) { convert(sentence); } } }
DocumentConverter { public void convert() { for (Sentence sentence : document.sentences()) { convert(sentence); } } DocumentConverter(JCas jCas, Document document); }
DocumentConverter { public void convert() { for (Sentence sentence : document.sentences()) { convert(sentence); } } DocumentConverter(JCas jCas, Document document); void convert(); }
DocumentConverter { public void convert() { for (Sentence sentence : document.sentences()) { convert(sentence); } } DocumentConverter(JCas jCas, Document document); void convert();  }