Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (CoreMap sentence : document.get(CoreAnnotations.SentencesAnnotation.class)) {
- ...
- }
- sentence.get(CoreAnnotations.TokensAnnotations.class).remove(token.get(CoreAnnotations.IndexAnnotation.class));
- token.setWord("John");
- sentence.get(CoreAnnotations.TokensAnnotation.class).add(token.get(CoreAnnotations.IndexAnnotation.class),token);
Add Comment
Please, Sign In to add comment