issue 2
(Irregular inflections contain $1 instead of the properly rep...) reported by chris.wash
- What steps will reproduce the problem?
1. try any of these: "men".singularize(), "man".pluralize(),
"person".singularize()
What is the expected output? What do you see instead?
For these I get '$1an', '$1en', and '$1eople', respectively.
NOTES:
The Inflections.irregular function is incorrect and should be changed to
the following in order for any of the irregular matches to work properly:
Incorrect (currently):
this.plural(new RegExp(singular.charAt(0) + singular.substring(1) + "$",
"i"), "$1" + plural.substring(1));
this.singular(new RegExp(plural.charAt(0) + plural.substring(1) + "$",
"i"), "$1" + singular.substring(1));
Correct:
this.plural(new RegExp("(" + singular.charAt(0) + ")" +
singular.substring(1) + "$", "i"), "$1" + plural.substring(1));
this.singular(new RegExp("(" + plural.charAt(0) + ")" +
plural.substring(1) + "$", "i"), "$1" + singular.substring(1));
What steps will reproduce the problem?
1. try any of these: "men".singularize(), "man".pluralize(),
"person".singularize()
What is the expected output? What do you see instead?
For these I get '$1an', '$1en', and '$1eople', respectively.
NOTES:
The Inflections.irregular function is incorrect and should be changed to
the following in order for any of the irregular matches to work properly:
Incorrect (currently):
this.plural(new RegExp(singular.charAt(0) + singular.substring(1) + "$",
"i"), "$1" + plural.substring(1));
this.singular(new RegExp(plural.charAt(0) + plural.substring(1) + "$",
"i"), "$1" + singular.substring(1));
Correct:
this.plural(new RegExp("(" + singular.charAt(0) + ")" +
singular.substring(1) + "$", "i"), "$1" + plural.substring(1));
this.singular(new RegExp("(" + plural.charAt(0) + ")" +
plural.substring(1) + "$", "i"), "$1" + singular.substring(1));