Пример #1
0
  private void runTest(
      String language, String variant, String testDocument, String[] tags, String[] tagClasses)
      throws Exception {
    AnalysisEngine engine = createEngine(LbjPosTagger.class);

    JCas jcas = TestRunner.runTest(engine, language, testDocument);

    AssertAnnotations.assertPOS(tagClasses, tags, select(jcas, POS.class));
  }
Пример #2
0
  private JCas runTest(
      String language, String variant, String testDocument, String[] tags, String[] tagClasses)
      throws Exception {
    AnalysisEngine engine =
        createEngine(
            OpenNlpPosTagger.class,
            OpenNlpPosTagger.PARAM_VARIANT,
            variant,
            OpenNlpPosTagger.PARAM_PRINT_TAGSET,
            true);

    JCas jcas = TestRunner.runTest(engine, language, testDocument);

    AssertAnnotations.assertPOS(tagClasses, tags, select(jcas, POS.class));

    return jcas;
  }