Skip to content

Instantly share code, notes, and snippets.

@heroic
Created February 28, 2011 03:04
Show Gist options
  • Save heroic/846877 to your computer and use it in GitHub Desktop.
Save heroic/846877 to your computer and use it in GitHub Desktop.
function Inflector() {
var plurals = singulars = uncountables = humans = [];
}
exports.inflector = Inflector;
Inflector.prototype = {
plural: function(rule, replacement) {
if(rule instanceof String) {
this.uncountables.splice(this.uncountables.indexof(rule), 1)
}
this.uncountables.splice(this.uncountables.indexof(replacement), 1)
this.plurals.unshift([rule, replacement])
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment