Permalink
Browse files

Changed order of singular regex so ries will get properly converted t…

…o ry
  • Loading branch information...
1 parent 33602c1 commit d300b03a9cddba454db321dc31102a561caf8bb7 Danny Brain committed Sep 6, 2011
Showing with 3 additions and 1 deletion.
  1. +1 −1 lib/languages/en.js
  2. +2 −0 test/inflection.en.test.js
View
@@ -53,8 +53,8 @@ en.singular(/s$/i, "")
.singular(/(^analy)ses$/i, "$1sis")
.singular(/([^f])ves$/i, "$1fe")
.singular(/([lr])ves$/i, "$1f")
- .singular(/([^aeiouy]|qu)ies$/i, "$1y")
.singular(/ies$/i, "ie")
+ .singular(/([^aeiouy]|qu)ies$/i, "$1y")
.singular(/(x|ch|ss|sh)es$/i, "$1")
.singular(/([m|l])ice$/i, "$1ouse")
.singular(/(bus)es$/i, "$1")
@@ -70,6 +70,7 @@ module.exports = {
assert.equal('oxen', en.pluralize('ox'));
assert.equal('indices', en.pluralize('index'));
assert.equal('indices', en.pluralize('indice'));
+ assert.equal('categories', en.pluralize('category'));
},
'test .singularize()': function(assert){
@@ -94,6 +95,7 @@ module.exports = {
assert.equal('movie', en.singularize('movies'));
assert.equal('series', en.singularize('series'));
assert.equal('index', en.singularize('indices'));
+ assert.equal('category', en.singularize('categories'));
},
'test .isPlural()': function(assert){

0 comments on commit d300b03

Please sign in to comment.