Package edu.stanford.nlp.process

Examples of edu.stanford.nlp.process.Morphology.stem()


    List<CoreLabel> lemmas = Generics.newArrayList();
    for (TaggedWord token : tagged) {
      CoreLabel label = new CoreLabel();
      label.setWord(token.word());
      label.setTag(token.tag());
      morpha.stem(label);
      lemmas.add(label);
    }
    return lemmas;
  }
View Full Code Here


    assertEquals("hunt", lemmatizeStatic(hunt).lemma());
  }

  public void testDash() {
    Morphology morpha = new Morphology();
    morpha.stem("b-");
  }
}
View Full Code Here

            }

            String[] wordsInTweet = tweetText.split("[^\\p{L}&&[^']]+");
            for (String word : wordsInTweet) {
                try {
                    words.add(morphology.stem(word));
                } catch (Exception ex) {
                    words.add(word);
                }
            }
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.