WordNetENLinker implements AlignmentComponent { public void annotate(JCas aJCas) throws AlignmentComponentException { worker.annotate(aJCas); } WordNetENLinker(String wordNetPath);  WordNetENLinker(String wordNetPath, Set<WordNetRelation> entailingRelationSet, int maxPhraseLen); void annotate(JCas aJCas); String getComponentName(); String getInstanceName(); void close();  }
@Test public void test() { BasicConfigurator.resetConfiguration(); BasicConfigurator.configure(); Logger.getRootLogger().setLevel(Level.INFO); Logger testlogger = Logger.getLogger(this.getClass().toString()); TreeTaggerEN lemmatizer = null; try { lemmatizer = new TreeTaggerEN(); lemmatizer.generateSingleTHPairCAS("this is a test.", "TreeTagger in sight?"); } catch (Exception e) { if (ExceptionUtils.getRootCause(e) instanceof java.io.IOException) { testlogger.info("Skipping the test: TreeTagger binary and/or models missing. \n To run this testcase, TreeTagger installation is needed. (see /lap/src/scripts/treetagger/README.txt)"); Assume.assumeTrue(false); } } try { AlignmentComponent wnLinker = new WordNetENLinker("src/main/resources/ontologies/EnglishWordNet-dict"); String t1 = "The assassin was convicted and sentenced to death penalty"; String h1 = "The killer has been accused of murder and doomed to capital punishment"; JCas aJCas = lemmatizer.generateSingleTHPairCAS(t1, h1); wnLinker.annotate(aJCas); LinkUtils.dumpTokenLevelLinks(aJCas, System.out); } catch (Exception e) { fail(e.getMessage()); } }