Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #8 from dbrain/master

Fix for singularizing categories and series
  • Loading branch information...
commit 20b61aad5693593d31501cd8a7a433cebfda9952 2 parents 33602c1 + 9f2ac55
@tj authored
Showing with 6 additions and 1 deletion.
  1. +3 −1 lib/languages/en.js
  2. +3 −0  test/inflection.en.test.js
View
4 lib/languages/en.js
@@ -53,8 +53,10 @@ 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(/(series)$/i, "$1")
+ .singular(/(mov)ies$/i, "$1ie")
.singular(/(x|ch|ss|sh)es$/i, "$1")
.singular(/([m|l])ice$/i, "$1ouse")
.singular(/(bus)es$/i, "$1")
View
3  test/inflection.en.test.js
@@ -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,8 @@ 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'));
+ assert.equal('series', en.singularize('series'));
},
'test .isPlural()': function(assert){
Please sign in to comment.
Something went wrong with that request. Please try again.