Permalink
Browse files

Added single rules for numbers

  • Loading branch information...
masylum authored and tj committed Oct 25, 2010
1 parent 799a3a2 commit 56f67cbc04e3921687da005e0d657896e6659b95
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/inflection.js
View
@@ -107,12 +107,12 @@ Language.prototype.pluralize = function(word){
/**
* Check if `word` is plural.
*
- * @param {String} word
+ * @param {String or Number} word
* @return {Boolean}
* @api public
*/
-Language.prototype.isPlural = function(word){
+Language.prototype.isPlural = function (word) {
if (typeof word === 'number') {
return (this.rules.pluralNumbers || /.*/).test(word);
} else {
@@ -128,20 +128,20 @@ Language.prototype.isPlural = function(word){
* @api public
*/
-Language.prototype.singularize = function(word){
+Language.prototype.singularize = function (word) {
return this.inflect(word, 'singular');
};
/**
* Check if `word` is singular.
*
- * @param {String} word
+ * @param {String or Number} word
* @return {Boolean}
* @api public
*/
-Language.prototype.isSingular = function(word){
- return word == this.singularize(this.pluralize(word));
+Language.prototype.isSingular = function (word) {
+ return !this.isPlural(word);
};
/**

0 comments on commit 56f67cb

Please sign in to comment.