2

I need to stem words to get the root words. I was able to get the stemmed words for nouns and verbs but unable to get the root words of adjectives.

    WordnetStemmer stem =  new WordnetStemmer(ws.getDictionary());
    System.out.println("test" + stem.findStems("shooting",POS.VERB) );
    System.out.println("test" + stem.findStems("gunshots",POS.VERB) );

The following works but when I try it for an adjective it doesn't. Is there any way to stem an adjective or get the root form of it?

Thanks in advance.

4

1 回答 1

0

WordnetStemmer已被实施为SimpleStemmer

所以肯定有一种方法可以阻止形容词。如果词干分析器没有找到这个词,它就不会返回任何词干。

你有几个选择:

  1. 调用 findStems 时,您可以将 POS 保留为 Null,在这种情况下,它将返回所有词性的词干。请参阅此处的文档

  2. 试着打电话SimpleStemmer从分离规则中可以看出,很多形容词都被处理了,但仍然会有大量的形容词stemmer无法处理。

形容词词干的一些示例:

ADJ "er" ""
ADJ "est" ""
ADJ "er" "e"
ADJ "est" "e" 

希望能帮助你前进。

于 2013-01-30T18:44:54.483 回答