1. Michael Granger
  2. Linguistics

Commits

ippeiukai  committed 66887f8

fix past tense for words end with y

  • Participants
  • Parent commits 47e042f
  • Branches default

Comments (0)

Files changed (2)

File lib/linguistics/en/conjugation.rb

View file
 		when /e$/
 			return verb + 'd'
 		when /[^aeiou]y$/
-			return verb[ 0..-1 ] + 'ied'
+			return verb[ 0..-2 ] + 'ied'
 		else
 			if DOUBLING_VERBS.include?( verb )
 				verb = verb[ -2..-1 ] + 'ed'

File spec/linguistics/en/conjugation_spec.rb

View file
 		"troubleshoot".en.past_tense.should == 'troubleshot'
 	end
 
+	it "conjugates 'try' as 'tried'" do
+		"try".en.past_tense.should == 'tried'
+	end
+
 	it "conjugates 'typecast' as 'typecast'" do
 		"typecast".en.past_tense.should == 'typecast'
 	end