@Test public void test() throws UIMAException { JCas jCas = JCasSingleton.getJCasInstance(); DocumentToJCasConverter converter = new DocumentToJCasConverter(Collections.emptyList()); Document doc = Jsoup.parseBodyFragment("<p>Hello</p><pre>Something\nFormatted</pre>"); converter.apply(doc, jCas); assertEquals("HelloSomething\nFormatted", jCas.getDocumentText()); }
public void apply(final Document document, final JCas jCas) { final JCasBuilder builder = new JCasBuilder(jCas); walk(builder, document.head(), 1, false); walk(builder, document.body(), 1, true); builder.build(); }
DocumentToJCasConverter { public void apply(final Document document, final JCas jCas) { final JCasBuilder builder = new JCasBuilder(jCas); walk(builder, document.head(), 1, false); walk(builder, document.body(), 1, true); builder.build(); } }
DocumentToJCasConverter { public void apply(final Document document, final JCas jCas) { final JCasBuilder builder = new JCasBuilder(jCas); walk(builder, document.head(), 1, false); walk(builder, document.body(), 1, true); builder.build(); } DocumentToJCasConverter(final List<ContentMapper> mappers); }
DocumentToJCasConverter { public void apply(final Document document, final JCas jCas) { final JCasBuilder builder = new JCasBuilder(jCas); walk(builder, document.head(), 1, false); walk(builder, document.body(), 1, true); builder.build(); } DocumentToJCasConverter(final List<ContentMapper> mappers); void apply(final Document document, final JCas jCas); }
DocumentToJCasConverter { public void apply(final Document document, final JCas jCas) { final JCasBuilder builder = new JCasBuilder(jCas); walk(builder, document.head(), 1, false); walk(builder, document.body(), 1, true); builder.build(); } DocumentToJCasConverter(final List<ContentMapper> mappers); void apply(final Document document, final JCas jCas);  }