/us$/ would give us dominus -> domini (right) but also currus -> curri (wrong).Latin students memorize dominus as: 'dominus, domini (singular genitive), masculine' and currus as 'currus, currūs, masculine'. This is how students disambiguate the two.
So, now, how to handle that in ActiveSupport?
Well, hmph.
It seems like we should be able to say:
'currus'.pluralize(:la) #=> 'currūs' dominus'.pluralize(:la) #=> 'domini'
But this produces the wrong results, as mentioned above. If pluralize took a second argument of an array we might be able to do something
like:
'currus'.pluralize(:la, <optional genitive>currūs) #=> 'currūs'
then:
dominus'.pluralize(:la) #=> 'domini' - WORKS'currus'.pluralize(:la, 'currūs') #=> 'currūs' - WORKS
This design would also allow me to support the 3rd declension of Latin verbs which are identified by the genitive not by the nominative.
A list of rules based on the nominative ending will fail to catch this one
arx'.pluralize(:la) #=> wtf?
whereas
'arx'.pluralize(:la, 'arcis') #=> 'arces' - WORKS
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ee3fcf41-bb19-4618-b629-a6e02c7370ba%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment