Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActiveSupport Inflection library for Past Tense in Ruby?

Tags:

string

ruby

Is there a past tense library for ruby, to convert words into the past tense?

like image 469
Lance Avatar asked Sep 10 '10 22:09

Lance


2 Answers

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.

like image 112
s2t2 Avatar answered Sep 29 '22 06:09

s2t2


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.

like image 29
Mark Thomas Avatar answered Sep 29 '22 07:09

Mark Thomas