@Test public void taggingTest() throws IncorrectTokenException, ClassifierModelNotFoundException { String text = "Отменить подписку на канал \"ByDaniel \u200E\u200E\u200E\u200E\u200E\u200E\u200E\u200E\u200E\u200E\"?"; List<String> tokens = this.tokenizer.tokenization(text); List<Conll> conlls = this.tagger.tagging(tokens, FragmentationType.NO_FRAGMENTATION); Assert.assertFalse(conlls.isEmpty()); }
public synchronized List<Conll> tagging(List<String> tokens, FragmentationType fragmentationType) throws ClassifierModelNotFoundException, IncorrectTokenException { AdvancedTokenHandler<Conll> tokenHandler = new StatefulTokenHandler(fragmentationType); try { this.tt.setHandler(tokenHandler); this.tt.process(tokens); } catch (IOException e) { throw new ClassifierModelNotFoundException("The classifier's model \'" + this.modelFilePath + "\' isn't found.", e); } catch (TreeTaggerException e) { throw new IncorrectTokenException("There is an incorrect token.", e); } return tokenHandler.getTokens(); }
PosTagger { public synchronized List<Conll> tagging(List<String> tokens, FragmentationType fragmentationType) throws ClassifierModelNotFoundException, IncorrectTokenException { AdvancedTokenHandler<Conll> tokenHandler = new StatefulTokenHandler(fragmentationType); try { this.tt.setHandler(tokenHandler); this.tt.process(tokens); } catch (IOException e) { throw new ClassifierModelNotFoundException("The classifier's model \'" + this.modelFilePath + "\' isn't found.", e); } catch (TreeTaggerException e) { throw new IncorrectTokenException("There is an incorrect token.", e); } return tokenHandler.getTokens(); } }
PosTagger { public synchronized List<Conll> tagging(List<String> tokens, FragmentationType fragmentationType) throws ClassifierModelNotFoundException, IncorrectTokenException { AdvancedTokenHandler<Conll> tokenHandler = new StatefulTokenHandler(fragmentationType); try { this.tt.setHandler(tokenHandler); this.tt.process(tokens); } catch (IOException e) { throw new ClassifierModelNotFoundException("The classifier's model \'" + this.modelFilePath + "\' isn't found.", e); } catch (TreeTaggerException e) { throw new IncorrectTokenException("There is an incorrect token.", e); } return tokenHandler.getTokens(); } PosTagger(String modelFilePath, String treeTaggerHome); }
PosTagger { public synchronized List<Conll> tagging(List<String> tokens, FragmentationType fragmentationType) throws ClassifierModelNotFoundException, IncorrectTokenException { AdvancedTokenHandler<Conll> tokenHandler = new StatefulTokenHandler(fragmentationType); try { this.tt.setHandler(tokenHandler); this.tt.process(tokens); } catch (IOException e) { throw new ClassifierModelNotFoundException("The classifier's model \'" + this.modelFilePath + "\' isn't found.", e); } catch (TreeTaggerException e) { throw new IncorrectTokenException("There is an incorrect token.", e); } return tokenHandler.getTokens(); } PosTagger(String modelFilePath, String treeTaggerHome); synchronized List<Conll> tagging(List<String> tokens, FragmentationType fragmentationType); void destroy(); }
PosTagger { public synchronized List<Conll> tagging(List<String> tokens, FragmentationType fragmentationType) throws ClassifierModelNotFoundException, IncorrectTokenException { AdvancedTokenHandler<Conll> tokenHandler = new StatefulTokenHandler(fragmentationType); try { this.tt.setHandler(tokenHandler); this.tt.process(tokens); } catch (IOException e) { throw new ClassifierModelNotFoundException("The classifier's model \'" + this.modelFilePath + "\' isn't found.", e); } catch (TreeTaggerException e) { throw new IncorrectTokenException("There is an incorrect token.", e); } return tokenHandler.getTokens(); } PosTagger(String modelFilePath, String treeTaggerHome); synchronized List<Conll> tagging(List<String> tokens, FragmentationType fragmentationType); void destroy();  }