문제

My aim is detecting simple elements in any sentence such as verb, noun or adjective. Is there any gem in Ruby for achieving that? For example:

They elected him president yesterday.

Output:

["subject","verb", "object", "predicative", adverbial"]
도움이 되었습니까?

해결책

These are the only natural language processing options for Ruby that I know of.

Interestingly, they are all by the same person.

EDIT Here is one more option that I found. It's a tutorial on n-gram analysis.

Natural Language Processing with Ruby: n-grams

다른 팁

I've used engtagger with good success in the past. It's ported from a Perl program called Lingua::EN::Tagger. It takes a bit of work to get it to do what you want, but I think it's the best tool available for this application (at least at the moment).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top