开发者

ActiveSupport Inflection library for Past Tense in Ruby?

开发者 https://www.devze.com 2023-01-15 11:55 出处:网络
Is there a past tense library for ruby, to convert words into th开发者_运维知识库e past tense?Check out the \'verbs\' ruby gem ( github | rubygems | documentation ).

Is there a past tense library for ruby, to convert words into th开发者_运维知识库e past tense?


Check out the 'verbs' ruby gem ( github | rubygems | documentation ).

Type this in the command-line:

gem install verbs

Add this to your gemfile:

gem "verbs", "~> 2.1.0"

And make sure to restart your rails server and exit your rails console before implementing.


Past tense of English verbs is a lot more complicated than pluralization. You'll need a lingustic analysis engine and a corresponding database (due to the irregularity of the English language). If you're interested in pursuing this further, you can look at Ruby-WordNet which uses the WordNet lexical database.

0

精彩评论

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