Module: Linguistics::EN::Participles
- Defined in:
- lib/linguistics/en/participles.rb
Overview
Methods for deriving present participles for the English-language Linguistics module.
Instance Method Summary collapse
-
#present_participle ⇒ Object
(also: #part_pres)
Attempt to return the inflected string in its present participle form (e.g., talked -> talking).
Instance Method Details
#present_participle ⇒ Object Also known as: part_pres
Attempt to return the inflected string in its present participle form (e.g., talked -> talking).
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/linguistics/en/participles.rb', line 15 def present_participle plural = self.to_s.en.plural_verb plural.sub!( /ie$/, 'y' ) or plural.sub!( /ue$/, 'u' ) or plural.sub!( /([auy])e$/, '$1' ) or plural.sub!( /i$/, '' ) or plural.sub!( /([^e])e$/, "\\1" ) or /er$/.match( plural ) or plural.sub!( /([^aeiou][aeiouy]([bdgmnprst]))$/, "\\1\\2" ) return "#{plural}ing" end |