Last active
December 17, 2015 13:49
-
-
Save despinozac/5620158 to your computer and use it in GitHub Desktop.
Inflectors para Español.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveSupport::Inflector.inflections do |inflect| | |
inflect.plural(/$/, 's') | |
inflect.plural(/([^aeéiou])$/i, '\1es') | |
inflect.plural(/([aeiou]s)$/i, '\1') | |
inflect.plural(/z$/i, 'ces') | |
inflect.plural(/á([sn])$/i, 'a\1es') | |
inflect.plural(/é([sn])$/i, 'e\1es') | |
inflect.plural(/í([sn])$/i, 'i\1es') | |
inflect.plural(/ó([sn])$/i, 'o\1es') | |
inflect.plural(/ú([sn])$/i, 'u\1es') | |
inflect.singular(/s$/, '') | |
inflect.singular(/es$/, '') | |
inflect.irregular('el', 'los') | |
inflect.irregular('aquel','aquellos') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment