admin管理员组文章数量:1394593
I need to find a way to identify if an item in an array is a noun. I really can't think of any way to do this.
The first thing I did was ignore all words with "ly" in the end. But we know many words that aren't nouns doesn't have to have "ly" in the end. Is their a better way to do this? Is their a javascript library that can do this?
I need to find a way to identify if an item in an array is a noun. I really can't think of any way to do this.
The first thing I did was ignore all words with "ly" in the end. But we know many words that aren't nouns doesn't have to have "ly" in the end. Is their a better way to do this? Is their a javascript library that can do this?
Share Improve this question asked Aug 30, 2014 at 13:42 lightning_missilelightning_missile 3,0845 gold badges38 silver badges66 bronze badges 7- 1 might be you can connect one of these APIs wordnet.princeton.edu/wordnet/related-projects/#web – FreeCandies Commented Aug 30, 2014 at 13:47
- Do you want all nouns? Or just proper nouns? If you want only proper nouns, checking if the word starts with a capital may be a not fully perfect but fairly okay solution ... – Martin Tournoij Commented Aug 30, 2014 at 13:47
- This is not simple at all. Please read How can I extract words from a sentence and determine what part of speech each is?. – h2ooooooo Commented Aug 30, 2014 at 13:49
- There are absolutely no rules in English that link spelling patterns to parts of speech. There are words that are both nouns and verbs ("fly"). – Pointy Commented Aug 30, 2014 at 13:49
- @Carpetsmoker I need all nouns. – lightning_missile Commented Aug 30, 2014 at 13:51
2 Answers
Reset to default 4I think you can use this
http://wordnet.princeton.edu/wordnet/man/wngloss.7WN.html
it has endpoints for JSON and XML (you can make a simple GET request for each word and get the type of the word from the responded json e.g.
http://chriscargile./dictionary/json/cow
What you're looking for is called a pos tagger. The pos node.js
module does exactly that.
The natural nodejs module also es with a wordnet interface, which you can use.
本文标签: javascriptIdentifying nouns in an array of stringStack Overflow
版权声明:本文标题:javascript - Identifying nouns in an array of string - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744096180a2590323.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论