开发者

finding noun and verb in stanford parser

I need to find whether a word is verb or noun or it is both

For example, the word is "search" it can be both noun and a verb but stanford parser gives NN tag to it..

is there any way that stanford parser will give that "search" is both noun and verb?

code that i use now

public static String Lemmatize(String word) {
    WordTag w = new WordTag(word);
    w.setTag(POSTagWord(word));
    Morphology m = new Morphology();
    WordLemmaTag wT = m.lemmatize(w);

    return wT.lemma();
}

or should i use any other so开发者_高级运维ftware to do it? please suggest me thanks in advance


The Stanford Parser guesses the part-of-speech tag of a word based on context statistics. You should really pass in a complete sentence to determine whether, in that sentence, "search" is a noun or a verb.

You don't need a full parser just to get part-of-speech tags. The Stanford POS Tagger is enough; it also includes the Morphology class, but it too takes context into account.

If you want all part-of-speech tags that an English word can take on, without giving context, then WordNet is probably a better choice. It has several Java interfaces, including JWNL and JWI.


WordNet is what you want. It provides an API to an English lexicon with possible parts-of-speech, synonyms, word senses, hypernym/hyponym relations and more.

See Yawni for a great pure-Java WordNet API.


The Stanford parser parses words in the context of a sentence. To use your example of "search", in any given sentence, "search" will be a noun or a verb, but not both a noun and a verb in the same sentence.

What you're looking for is a dictionary look up. I've found several online dictionaries that would give you the information you're looking for. Here's an example from the Free Online Dictionary for the word "search".

It turns out that "search" can be a noun, verb, intransitive verb, and transitive verb.

I could not find an application programming interface (API) that would give you the same type of information as you find on the Free Online Dictionary web page. If your vocabulary list is limited, you could build your own API.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜