inflection
Advanced tools
Comparing version 1.4.2 to 1.5.0
{ | ||
"name": "inflection", | ||
"version": "1.4.2", | ||
"version": "1.5.0", | ||
"homepage": "https://github.com/dreamerslab/node.inflection", | ||
@@ -5,0 +5,0 @@ "description": "JavaScript Inflection Support", |
{ | ||
"name": "inflection", | ||
"version": "1.4.2", | ||
"version": "1.5.0", | ||
"repo": "dreamerslab/node.inflection", | ||
@@ -5,0 +5,0 @@ "description": "A port of inflection-js to node.js module", |
# History | ||
## 1.5.0 / 2014-09-23 | ||
- [refactor] Add more rules and uncountable nouns | ||
## 1.4.2 / 2014-09-05 | ||
@@ -29,3 +35,3 @@ | ||
- [refactoring] Adopt UMD import to work in a variety of different situations | ||
- [refactor] Adopt UMD import to work in a variety of different situations | ||
- [update packages] should->4.0.4 | ||
@@ -50,3 +56,3 @@ | ||
- [update packages] should->3.1.2 | ||
- [refactoring] Use `mocha` instead of hard coding tests | ||
- [refactor] Use `mocha` instead of hard coding tests | ||
@@ -70,3 +76,3 @@ | ||
- [refactoring] Support `Requirejs` | ||
- [refactor] Support `Requirejs` | ||
@@ -77,4 +83,4 @@ | ||
- [refactoring] Move `var` out of loops | ||
- [refactoring] Change the way `camelize` acts to mimic 100% `Rails ActiveSupport Inflector camelize` | ||
- [refactor] Move `var` out of loops | ||
- [refactor] Change the way `camelize` acts to mimic 100% `Rails ActiveSupport Inflector camelize` | ||
@@ -98,3 +104,3 @@ | ||
- [refactoring] Allow all caps strings to be returned from underscore | ||
- [refactor] Allow all caps strings to be returned from underscore | ||
@@ -144,3 +150,3 @@ | ||
- [update packages] node.flow->v1.0.0 | ||
- [refactoring] Read version number from package.json | ||
- [refactor] Read version number from package.json | ||
@@ -154,3 +160,3 @@ | ||
- Add pluralize tests | ||
- [refactoring] Use object.jey instead of for in | ||
- [refactor] Use object.jey instead of for in | ||
@@ -157,0 +163,0 @@ |
@@ -10,5 +10,5 @@ /*! | ||
(function(a,b){if(typeof define==="function"&&define.amd){define([],b); | ||
}else{if(typeof exports==="object"){module.exports=b();}else{a.inflection=b();}}}(this,function(){var d=["equipment","information","rice","money","species","series","fish","sheep","moose","deer","news"]; | ||
var g=[[new RegExp("(m)en$","gi")],[new RegExp("(pe)ople$","gi")],[new RegExp("(child)ren$","gi")],[new RegExp("([ti])a$","gi")],[new RegExp("((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$","gi")],[new RegExp("(hive)s$","gi")],[new RegExp("(tive)s$","gi")],[new RegExp("(curve)s$","gi")],[new RegExp("([lr])ves$","gi")],[new RegExp("([^fo])ves$","gi")],[new RegExp("([^aeiouy]|qu)ies$","gi")],[new RegExp("(s)eries$","gi")],[new RegExp("(m)ovies$","gi")],[new RegExp("(x|ch|ss|sh)es$","gi")],[new RegExp("([m|l])ice$","gi")],[new RegExp("(bus)es$","gi")],[new RegExp("(o)es$","gi")],[new RegExp("(shoe)s$","gi")],[new RegExp("(cris|ax|test)es$","gi")],[new RegExp("(octop|vir)i$","gi")],[new RegExp("(alias|status)es$","gi")],[new RegExp("^(ox)en","gi")],[new RegExp("(vert|ind)ices$","gi")],[new RegExp("(matr)ices$","gi")],[new RegExp("^feet$","gi")],[new RegExp("^teeth$","gi")],[new RegExp("^geese$","gi")],[new RegExp("(quiz)zes$","gi")],[new RegExp("(m)an$","gi"),"$1en"],[new RegExp("(pe)rson$","gi"),"$1ople"],[new RegExp("(child)$","gi"),"$1ren"],[new RegExp("^(ox)$","gi"),"$1en"],[new RegExp("(ax|test)is$","gi"),"$1es"],[new RegExp("(octop|vir)us$","gi"),"$1i"],[new RegExp("(alias|status)$","gi"),"$1es"],[new RegExp("(bu)s$","gi"),"$1ses"],[new RegExp("(buffal|tomat|potat)o$","gi"),"$1oes"],[new RegExp("([ti])um$","gi"),"$1a"],[new RegExp("sis$","gi"),"ses"],[new RegExp("(?:([^f])fe|([lr])f)$","gi"),"$1$2ves"],[new RegExp("(hive)$","gi"),"$1s"],[new RegExp("([^aeiouy]|qu)y$","gi"),"$1ies"],[new RegExp("(x|ch|ss|sh)$","gi"),"$1es"],[new RegExp("(matr|vert|ind)ix|ex$","gi"),"$1ices"],[new RegExp("([m|l])ouse$","gi"),"$1ice"],[new RegExp("^foot$","gi"),"feet"],[new RegExp("^tooth$","gi"),"teeth"],[new RegExp("^goose$","gi"),"geese"],[new RegExp("(quiz)$","gi"),"$1zes"],[new RegExp("s$","gi"),"s"],[new RegExp("$","gi"),"s"]]; | ||
var a=[[new RegExp("(m)an$","gi")],[new RegExp("(pe)rson$","gi")],[new RegExp("(child)$","gi")],[new RegExp("^(ox)$","gi")],[new RegExp("(ax|test)is$","gi")],[new RegExp("(octop|vir)us$","gi")],[new RegExp("(alias|status)$","gi")],[new RegExp("(bu)s$","gi")],[new RegExp("(buffal|tomat|potat)o$","gi")],[new RegExp("([ti])um$","gi")],[new RegExp("sis$","gi")],[new RegExp("(?:([^f])fe|([lr])f)$","gi")],[new RegExp("(hive)$","gi")],[new RegExp("([^aeiouy]|qu)y$","gi")],[new RegExp("(x|ch|ss|sh)$","gi")],[new RegExp("(matr|vert|ind)ix|ex$","gi")],[new RegExp("([m|l])ouse$","gi")],[new RegExp("^foot$","gi")],[new RegExp("^tooth$","gi")],[new RegExp("^goose$","gi")],[new RegExp("(quiz)$","gi")],[new RegExp("(m)en$","gi"),"$1an"],[new RegExp("(pe)ople$","gi"),"$1rson"],[new RegExp("(child)ren$","gi"),"$1"],[new RegExp("([ti])a$","gi"),"$1um"],[new RegExp("((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$","gi"),"$1$2sis"],[new RegExp("(hive)s$","gi"),"$1"],[new RegExp("(tive)s$","gi"),"$1"],[new RegExp("(curve)s$","gi"),"$1"],[new RegExp("([lr])ves$","gi"),"$1f"],[new RegExp("([^fo])ves$","gi"),"$1fe"],[new RegExp("(m)ovies$","gi"),"$1ovie"],[new RegExp("([^aeiouy]|qu)ies$","gi"),"$1y"],[new RegExp("(s)eries$","gi"),"$1eries"],[new RegExp("(x|ch|ss|sh)es$","gi"),"$1"],[new RegExp("([m|l])ice$","gi"),"$1ouse"],[new RegExp("(bus)es$","gi"),"$1"],[new RegExp("(o)es$","gi"),"$1"],[new RegExp("(shoe)s$","gi"),"$1"],[new RegExp("(cris|ax|test)es$","gi"),"$1is"],[new RegExp("(octop|vir)i$","gi"),"$1us"],[new RegExp("(alias|status)es$","gi"),"$1"],[new RegExp("^(ox)en","gi"),"$1"],[new RegExp("(vert|ind)ices$","gi"),"$1ex"],[new RegExp("(matr)ices$","gi"),"$1ix"],[new RegExp("^feet$","gi"),"foot"],[new RegExp("^teeth$","gi"),"tooth"],[new RegExp("^geese$","gi"),"goose"],[new RegExp("(quiz)zes$","gi"),"$1"],[new RegExp("ss$","gi"),"ss"],[new RegExp("s$","gi"),""]]; | ||
}else{if(typeof exports==="object"){module.exports=b();}else{a.inflection=b();}}}(this,function(){var d=["access","accommodation","adulthood","advertising","advice","aggression","aid","air","aircraft","alcohol","anger","applause","arithmetic","art","assistance","athletics","attention","bacon","baggage","ballet","beauty","beef","beer","behavior","biology","blood","botany","bread","business","butter","carbon","cardboard","cash","chalk","chaos","chess","crossroads","countryside","damage","dancing","danger","deer","delight","dessert","dignity","dirt","distribution","dust","economics","education","electricity","employment","energy","engineering","enjoyment","entertainment","envy","equipment","ethics","evidence","evolution","failure","faith","fame","fiction","flour","flu","food","freedom","fruit","fuel","fun","furniture","gallows","garbage","garlic","gas","genetics","glass","gold","golf","gossip","grammar","grass","gratitude","grief","ground","guilt","gymnastics","hair","happiness","hardware","harm","hate","hatred","health","heat","height","help","homework","honesty","honey","hospitality","housework","humour","hunger","hydrogen","ice","importance","inflation","information","injustice","innocence","intelligence","iron","irony","jam","jealousy","jelly","jewelry","joy","judo","juice","justice","karate","kindness","knowledge","labour","lack","land","laughter","lava","leather","leisure","lightning","linguine","linguini","linguistics","literature","litter","livestock","logic","loneliness","love","luck","luggage","macaroni","machinery","magic","mail","management","mankind","marble","mathematics","mayonnaise","measles","meat","metal","methane","milk","money","mud","music","mumps","nature","news","nitrogen","nonsense","nurture","nutrition","obedience","obesity","oil","oxygen","paper","passion","pasta","patience","permission","physics","poetry","pollution","poverty","power","pride","production","progress","pronunciation","psychology","publicity","punctuation","quality","quantity","quartz","racism","rain","recreation","relaxation","reliability","research","respect","revenge","rice","rubbish","rum","safety","salad","salt","sand","satire","scenery","seafood","seaside","series","shame","sheep","shopping","silence","sleep","smoke","smoking","snow","soap","software","soil","sorrow","soup","spaghetti","speed","species","spelling","sport","steam","strength","stuff","stupidity","success","sugar","sunshine","symmetry","tea","tennis","thirst","thunder","timber","time","toast","tolerance","trade","traffic","transportation","travel","trust","understanding","underwear","unemployment","unity","usage","validity","veal","vegetation","vegetarianism","vengeance","violence","vision","vitality","warmth","water","wealth","weather","weight","welfare","wheat","whiskey","width","wildlife","wine","wisdom","wood","wool","work","yeast","yoga","zinc","zoology"]; | ||
var g=[[new RegExp("^(m)en$","gi")],[new RegExp("(pe)ople$","gi")],[new RegExp("(child)ren$","gi")],[new RegExp("([ti])a$","gi")],[new RegExp("((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$","gi")],[new RegExp("(hi|ti)ves$","gi")],[new RegExp("(curve)s$","gi")],[new RegExp("([lr])ves$","gi")],[new RegExp("([^fo])ves$","gi")],[new RegExp("([^aeiouy]|qu)ies$","gi")],[new RegExp("(s)eries$","gi")],[new RegExp("(m)ovies$","gi")],[new RegExp("(x|ch|ss|sh)es$","gi")],[new RegExp("([m|l])ice$","gi")],[new RegExp("(bus)es$","gi")],[new RegExp("(o)es$","gi")],[new RegExp("(shoe)s$","gi")],[new RegExp("(cris|ax|test)es$","gi")],[new RegExp("(octop|vir)i$","gi")],[new RegExp("(alias|status)es$","gi")],[new RegExp("^(summons)es$","gi")],[new RegExp("^(ox)en","gi")],[new RegExp("(vert|ind)ices$","gi")],[new RegExp("(matr)ices$","gi")],[new RegExp("^feet$","gi")],[new RegExp("^teeth$","gi")],[new RegExp("^geese$","gi")],[new RegExp("(quiz)zes$","gi")],[new RegExp("^(m)an$","gi"),"$1en"],[new RegExp("(pe)rson$","gi"),"$1ople"],[new RegExp("(child)$","gi"),"$1ren"],[new RegExp("^(ox)$","gi"),"$1en"],[new RegExp("(ax|test)is$","gi"),"$1es"],[new RegExp("(octop|vir)us$","gi"),"$1i"],[new RegExp("(alias|status)$","gi"),"$1es"],[new RegExp("^(summons)$","gi"),"$1es"],[new RegExp("(bu)s$","gi"),"$1ses"],[new RegExp("(buffal|tomat|potat|volcan)o$","gi"),"$1oes"],[new RegExp("([ti])um$","gi"),"$1a"],[new RegExp("sis$","gi"),"ses"],[new RegExp("(?:([^f])fe|([lr])f)$","gi"),"$1$2ves"],[new RegExp("(hi|ti)ve$","gi"),"$1ves"],[new RegExp("([^aeiouy]|qu)y$","gi"),"$1ies"],[new RegExp("(x|ch|ss|sh)$","gi"),"$1es"],[new RegExp("(matr|vert|ind)ix|ex$","gi"),"$1ices"],[new RegExp("([m|l])ouse$","gi"),"$1ice"],[new RegExp("^foot$","gi"),"feet"],[new RegExp("^tooth$","gi"),"teeth"],[new RegExp("^goose$","gi"),"geese"],[new RegExp("(quiz)$","gi"),"$1zes"],[new RegExp("s$","gi"),"s"],[new RegExp("$","gi"),"s"]]; | ||
var a=[[new RegExp("^(m)an$","gi")],[new RegExp("(pe)rson$","gi")],[new RegExp("(child)$","gi")],[new RegExp("^(ox)$","gi")],[new RegExp("(ax|test)is$","gi")],[new RegExp("(octop|vir)us$","gi")],[new RegExp("(alias|status)$","gi")],[new RegExp("^(summons)$","gi")],[new RegExp("(bu)s$","gi")],[new RegExp("(buffal|tomat|potat)o$","gi")],[new RegExp("([ti])um$","gi")],[new RegExp("sis$","gi")],[new RegExp("(?:([^f])fe|([lr])f)$","gi")],[new RegExp("(hi|ti)ve$","gi")],[new RegExp("([^aeiouy]|qu)y$","gi")],[new RegExp("(x|ch|ss|sh)$","gi")],[new RegExp("(matr|vert|ind)ix|ex$","gi")],[new RegExp("([m|l])ouse$","gi")],[new RegExp("^foot$","gi")],[new RegExp("^tooth$","gi")],[new RegExp("^goose$","gi")],[new RegExp("(quiz)$","gi")],[new RegExp("^(m)en$","gi"),"$1an"],[new RegExp("(pe)ople$","gi"),"$1rson"],[new RegExp("(child)ren$","gi"),"$1"],[new RegExp("([ti])a$","gi"),"$1um"],[new RegExp("((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$","gi"),"$1$2sis"],[new RegExp("(hi|ti)ves$","gi"),"$1ve"],[new RegExp("(curve)s$","gi"),"$1"],[new RegExp("([lr])ves$","gi"),"$1f"],[new RegExp("([^fo])ves$","gi"),"$1fe"],[new RegExp("(m)ovies$","gi"),"$1ovie"],[new RegExp("([^aeiouy]|qu)ies$","gi"),"$1y"],[new RegExp("(s)eries$","gi"),"$1eries"],[new RegExp("(x|ch|ss|sh)es$","gi"),"$1"],[new RegExp("([m|l])ice$","gi"),"$1ouse"],[new RegExp("(bus)es$","gi"),"$1"],[new RegExp("(o)es$","gi"),"$1"],[new RegExp("(shoe)s$","gi"),"$1"],[new RegExp("(cris|ax|test)es$","gi"),"$1is"],[new RegExp("(octop|vir)i$","gi"),"$1us"],[new RegExp("(alias|status)es$","gi"),"$1"],[new RegExp("^(summons)es$","gi"),"$1"],[new RegExp("^(ox)en","gi"),"$1"],[new RegExp("(vert|ind)ices$","gi"),"$1ex"],[new RegExp("(matr)ices$","gi"),"$1ix"],[new RegExp("^feet$","gi"),"foot"],[new RegExp("^teeth$","gi"),"tooth"],[new RegExp("^geese$","gi"),"goose"],[new RegExp("(quiz)zes$","gi"),"$1"],[new RegExp("ss$","gi"),"ss"],[new RegExp("s$","gi"),""]]; | ||
var c=["and","or","nor","a","an","the","so","but","to","of","at","by","from","into","on","onto","off","out","in","over","with","for"];var j=new RegExp("(_ids|_id)$","g"); | ||
@@ -30,3 +30,3 @@ var f=new RegExp("_","g");var i=new RegExp("[ _]","g");var e=new RegExp("([A-Z])","g");var h=new RegExp("^_");var b={_apply_rules:function(p,o,n,m){if(m){p=m; | ||
var p=q[o].substring(q[o].length-1);var l="th";if(r!="11"&&r!="12"&&r!="13"){if(p==="1"){l="st";}else{if(p==="2"){l="nd";}else{if(p==="3"){l="rd";}}}}q[o]+=l; | ||
}}return q.join(" ");},transform:function(n,k){var m=0;var l=k.length;for(;m<l;m++){var o=k[m];if(this.hasOwnProperty(o)){n=this[o](n);}}return n;}};b.version="1.4.2"; | ||
}}return q.join(" ");},transform:function(n,k){var m=0;var l=k.length;for(;m<l;m++){var o=k[m];if(this.hasOwnProperty(o)){n=this[o](n);}}return n;}};b.version="1.5.0"; | ||
return b;})); |
@@ -26,4 +26,317 @@ /*! | ||
var uncountable_words = [ | ||
'equipment', 'information', 'rice', 'money', 'species', | ||
'series', 'fish', 'sheep', 'moose', 'deer', 'news' | ||
'access', | ||
'accommodation', | ||
'adulthood', | ||
'advertising', | ||
'advice', | ||
'aggression', | ||
'aid', | ||
'air', | ||
'aircraft', | ||
'alcohol', | ||
'anger', | ||
'applause', | ||
'arithmetic', | ||
'art', | ||
'assistance', | ||
'athletics', | ||
'attention', | ||
'bacon', | ||
'baggage', | ||
'ballet', | ||
'beauty', | ||
'beef', | ||
'beer', | ||
'behavior', | ||
'biology', | ||
// 'billiards', | ||
'blood', | ||
'botany', | ||
// 'bowels', | ||
'bread', | ||
'business', | ||
'butter', | ||
'carbon', | ||
'cardboard', | ||
'cash', | ||
'chalk', | ||
'chaos', | ||
'chess', | ||
'crossroads', | ||
'countryside', | ||
'damage', | ||
'dancing', | ||
'danger', | ||
'deer', | ||
'delight', | ||
'dessert', | ||
'dignity', | ||
'dirt', | ||
'distribution', | ||
'dust', | ||
'economics', | ||
'education', | ||
'electricity', | ||
'employment', | ||
'energy', | ||
'engineering', | ||
'enjoyment', | ||
'entertainment', | ||
'envy', | ||
'equipment', | ||
'ethics', | ||
'evidence', | ||
'evolution', | ||
'failure', | ||
'faith', | ||
'fame', | ||
'fiction', | ||
// 'fish', | ||
'flour', | ||
'flu', | ||
'food', | ||
'freedom', | ||
'fruit', | ||
'fuel', | ||
'fun', | ||
// 'funeral', | ||
'furniture', | ||
'gallows', | ||
'garbage', | ||
'garlic', | ||
'gas', | ||
'genetics', | ||
'glass', | ||
'gold', | ||
'golf', | ||
'gossip', | ||
'grammar', | ||
'grass', | ||
'gratitude', | ||
'grief', | ||
'ground', | ||
'guilt', | ||
'gymnastics', | ||
'hair', | ||
'happiness', | ||
'hardware', | ||
'harm', | ||
'hate', | ||
'hatred', | ||
'health', | ||
'heat', | ||
'height', | ||
'help', | ||
'homework', | ||
'honesty', | ||
'honey', | ||
'hospitality', | ||
'housework', | ||
'humour', | ||
'hunger', | ||
'hydrogen', | ||
'ice', | ||
'importance', | ||
'inflation', | ||
'information', | ||
'injustice', | ||
'innocence', | ||
'intelligence', | ||
'iron', | ||
'irony', | ||
'jam', | ||
'jealousy', | ||
'jelly', | ||
'jewelry', | ||
'joy', | ||
'judo', | ||
'juice', | ||
'justice', | ||
'karate', | ||
'kindness', | ||
'knowledge', | ||
'labour', | ||
'lack', | ||
'land', | ||
'laughter', | ||
'lava', | ||
'leather', | ||
'leisure', | ||
'lightning', | ||
'linguine', | ||
'linguini', | ||
'linguistics', | ||
'literature', | ||
'litter', | ||
'livestock', | ||
'logic', | ||
'loneliness', | ||
'love', | ||
'luck', | ||
'luggage', | ||
'macaroni', | ||
'machinery', | ||
'magic', | ||
'mail', | ||
'management', | ||
'mankind', | ||
'marble', | ||
'mathematics', | ||
'mayonnaise', | ||
'measles', | ||
'meat', | ||
'metal', | ||
'methane', | ||
'milk', | ||
'money', | ||
// 'moose', | ||
'mud', | ||
'music', | ||
'mumps', | ||
'nature', | ||
'news', | ||
'nitrogen', | ||
'nonsense', | ||
'nurture', | ||
'nutrition', | ||
'obedience', | ||
'obesity', | ||
'oil', | ||
'oxygen', | ||
'paper', | ||
'passion', | ||
'pasta', | ||
'patience', | ||
'permission', | ||
'physics', | ||
'poetry', | ||
'pollution', | ||
'poverty', | ||
'power', | ||
'pride', | ||
'production', | ||
'progress', | ||
'pronunciation', | ||
'psychology', | ||
'publicity', | ||
'punctuation', | ||
'quality', | ||
'quantity', | ||
'quartz', | ||
'racism', | ||
'rain', | ||
'recreation', | ||
'relaxation', | ||
'reliability', | ||
'research', | ||
'respect', | ||
'revenge', | ||
'rice', | ||
'rubbish', | ||
'rum', | ||
'safety', | ||
'salad', | ||
'salt', | ||
'sand', | ||
'satire', | ||
'scenery', | ||
'seafood', | ||
'seaside', | ||
'series', | ||
'shame', | ||
'sheep', | ||
'shopping', | ||
'silence', | ||
'sleep', | ||
// 'slang' | ||
'smoke', | ||
'smoking', | ||
'snow', | ||
'soap', | ||
'software', | ||
'soil', | ||
'sorrow', | ||
'soup', | ||
'spaghetti', | ||
'speed', | ||
'species', | ||
'spelling', | ||
'sport', | ||
'steam', | ||
'strength', | ||
'stuff', | ||
'stupidity', | ||
'success', | ||
'sugar', | ||
'sunshine', | ||
'symmetry', | ||
'tea', | ||
'tennis', | ||
'thirst', | ||
'thunder', | ||
'timber', | ||
'time', | ||
'toast', | ||
'tolerance', | ||
'trade', | ||
'traffic', | ||
'transportation', | ||
'travel', | ||
'trust', | ||
'understanding', | ||
'underwear', | ||
'unemployment', | ||
'unity', | ||
'usage', | ||
'validity', | ||
'veal', | ||
'vegetation', | ||
'vegetarianism', | ||
'vengeance', | ||
'violence', | ||
'vision', | ||
'vitality', | ||
'warmth', | ||
'water', | ||
'wealth', | ||
'weather', | ||
'weight', | ||
'welfare', | ||
'wheat', | ||
'whiskey', | ||
'width', | ||
'wildlife', | ||
'wine', | ||
'wisdom', | ||
'wood', | ||
'wool', | ||
'work', | ||
'yeast', | ||
'yoga', | ||
'zinc', | ||
'zoology' | ||
]; | ||
@@ -38,56 +351,57 @@ | ||
// do not replace if its already a plural word | ||
[ new RegExp( '(m)en$', 'gi' )], | ||
[ new RegExp( '(pe)ople$', 'gi' )], | ||
[ new RegExp( '^(m)en$' , 'gi' )], | ||
[ new RegExp( '(pe)ople$' , 'gi' )], | ||
[ new RegExp( '(child)ren$', 'gi' )], | ||
[ new RegExp( '([ti])a$', 'gi' )], | ||
[ new RegExp( '([ti])a$' , 'gi' )], | ||
[ new RegExp( '((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$','gi' )], | ||
[ new RegExp( '(hive)s$', 'gi' )], | ||
[ new RegExp( '(tive)s$', 'gi' )], | ||
[ new RegExp( '(curve)s$', 'gi' )], | ||
[ new RegExp( '([lr])ves$', 'gi' )], | ||
[ new RegExp( '([^fo])ves$', 'gi' )], | ||
[ new RegExp( '(hi|ti)ves$' , 'gi' )], | ||
[ new RegExp( '(curve)s$' , 'gi' )], | ||
[ new RegExp( '([lr])ves$' , 'gi' )], | ||
[ new RegExp( '([^fo])ves$' , 'gi' )], | ||
[ new RegExp( '([^aeiouy]|qu)ies$', 'gi' )], | ||
[ new RegExp( '(s)eries$', 'gi' )], | ||
[ new RegExp( '(m)ovies$', 'gi' )], | ||
[ new RegExp( '(x|ch|ss|sh)es$', 'gi' )], | ||
[ new RegExp( '([m|l])ice$', 'gi' )], | ||
[ new RegExp( '(bus)es$', 'gi' )], | ||
[ new RegExp( '(o)es$', 'gi' )], | ||
[ new RegExp( '(shoe)s$', 'gi' )], | ||
[ new RegExp( '(cris|ax|test)es$', 'gi' )], | ||
[ new RegExp( '(octop|vir)i$', 'gi' )], | ||
[ new RegExp( '(alias|status)es$', 'gi' )], | ||
[ new RegExp( '^(ox)en', 'gi' )], | ||
[ new RegExp( '(vert|ind)ices$', 'gi' )], | ||
[ new RegExp( '(matr)ices$', 'gi' )], | ||
[ new RegExp( '^feet$', 'gi' )], | ||
[ new RegExp( '^teeth$', 'gi' )], | ||
[ new RegExp( '^geese$', 'gi' )], | ||
[ new RegExp( '(quiz)zes$', 'gi' )], | ||
[ new RegExp( '(s)eries$' , 'gi' )], | ||
[ new RegExp( '(m)ovies$' , 'gi' )], | ||
[ new RegExp( '(x|ch|ss|sh)es$' , 'gi' )], | ||
[ new RegExp( '([m|l])ice$' , 'gi' )], | ||
[ new RegExp( '(bus)es$' , 'gi' )], | ||
[ new RegExp( '(o)es$' , 'gi' )], | ||
[ new RegExp( '(shoe)s$' , 'gi' )], | ||
[ new RegExp( '(cris|ax|test)es$' , 'gi' )], | ||
[ new RegExp( '(octop|vir)i$' , 'gi' )], | ||
[ new RegExp( '(alias|status)es$' , 'gi' )], | ||
[ new RegExp( '^(summons)es$' , 'gi' )], | ||
[ new RegExp( '^(ox)en' , 'gi' )], | ||
[ new RegExp( '(vert|ind)ices$' , 'gi' )], | ||
[ new RegExp( '(matr)ices$' , 'gi' )], | ||
[ new RegExp( '^feet$' , 'gi' )], | ||
[ new RegExp( '^teeth$' , 'gi' )], | ||
[ new RegExp( '^geese$' , 'gi' )], | ||
[ new RegExp( '(quiz)zes$' , 'gi' )], | ||
// original rule | ||
[ new RegExp( '(m)an$', 'gi' ), '$1en' ], | ||
[ new RegExp( '(pe)rson$', 'gi' ), '$1ople' ], | ||
[ new RegExp( '(child)$', 'gi' ), '$1ren' ], | ||
[ new RegExp( '^(ox)$', 'gi' ), '$1en' ], | ||
[ new RegExp( '(ax|test)is$', 'gi' ), '$1es' ], | ||
[ new RegExp( '(octop|vir)us$', 'gi' ), '$1i' ], | ||
[ new RegExp( '(alias|status)$', 'gi' ), '$1es' ], | ||
[ new RegExp( '(bu)s$', 'gi' ), '$1ses' ], | ||
[ new RegExp( '(buffal|tomat|potat)o$', 'gi' ), '$1oes' ], | ||
[ new RegExp( '([ti])um$', 'gi' ), '$1a' ], | ||
[ new RegExp( 'sis$', 'gi' ), 'ses' ], | ||
[ new RegExp( '(?:([^f])fe|([lr])f)$', 'gi' ), '$1$2ves' ], | ||
[ new RegExp( '(hive)$', 'gi' ), '$1s' ], | ||
[ new RegExp( '([^aeiouy]|qu)y$', 'gi' ), '$1ies' ], | ||
[ new RegExp( '(x|ch|ss|sh)$', 'gi' ), '$1es' ], | ||
[ new RegExp( '(matr|vert|ind)ix|ex$', 'gi' ), '$1ices' ], | ||
[ new RegExp( '([m|l])ouse$', 'gi' ), '$1ice' ], | ||
[ new RegExp( '^foot$', 'gi' ), 'feet' ], | ||
[ new RegExp( '^tooth$', 'gi' ), 'teeth' ], | ||
[ new RegExp( '^goose$', 'gi' ), 'geese' ], | ||
[ new RegExp( '(quiz)$', 'gi' ), '$1zes' ], | ||
[ new RegExp( '^(m)an$' , 'gi' ), '$1en' ], | ||
[ new RegExp( '(pe)rson$' , 'gi' ), '$1ople' ], | ||
[ new RegExp( '(child)$' , 'gi' ), '$1ren' ], | ||
[ new RegExp( '^(ox)$' , 'gi' ), '$1en' ], | ||
[ new RegExp( '(ax|test)is$' , 'gi' ), '$1es' ], | ||
[ new RegExp( '(octop|vir)us$' , 'gi' ), '$1i' ], | ||
[ new RegExp( '(alias|status)$' , 'gi' ), '$1es' ], | ||
[ new RegExp( '^(summons)$' , 'gi' ), '$1es' ], | ||
[ new RegExp( '(bu)s$' , 'gi' ), '$1ses' ], | ||
[ new RegExp( '(buffal|tomat|potat|volcan)o$', 'gi' ), '$1oes' ], | ||
[ new RegExp( '([ti])um$' , 'gi' ), '$1a' ], | ||
[ new RegExp( 'sis$' , 'gi' ), 'ses' ], | ||
[ new RegExp( '(?:([^f])fe|([lr])f)$' , 'gi' ), '$1$2ves' ], | ||
[ new RegExp( '(hi|ti)ve$' , 'gi' ), '$1ves' ], | ||
[ new RegExp( '([^aeiouy]|qu)y$' , 'gi' ), '$1ies' ], | ||
[ new RegExp( '(x|ch|ss|sh)$' , 'gi' ), '$1es' ], | ||
[ new RegExp( '(matr|vert|ind)ix|ex$' , 'gi' ), '$1ices' ], | ||
[ new RegExp( '([m|l])ouse$' , 'gi' ), '$1ice' ], | ||
[ new RegExp( '^foot$' , 'gi' ), 'feet' ], | ||
[ new RegExp( '^tooth$' , 'gi' ), 'teeth' ], | ||
[ new RegExp( '^goose$' , 'gi' ), 'geese' ], | ||
[ new RegExp( '(quiz)$' , 'gi' ), '$1zes' ], | ||
[ new RegExp( 's$', 'gi' ), 's' ], | ||
[ new RegExp( '$', 'gi' ), 's' ] | ||
[ new RegExp( '$' , 'gi' ), 's' ] | ||
]; | ||
@@ -102,55 +416,56 @@ | ||
// do not replace if its already a singular word | ||
[ new RegExp( '(m)an$', 'gi' )], | ||
[ new RegExp( '(pe)rson$', 'gi' )], | ||
[ new RegExp( '(child)$', 'gi' )], | ||
[ new RegExp( '^(ox)$', 'gi' )], | ||
[ new RegExp( '(ax|test)is$', 'gi' )], | ||
[ new RegExp( '(octop|vir)us$', 'gi' )], | ||
[ new RegExp( '(alias|status)$', 'gi' )], | ||
[ new RegExp( '(bu)s$', 'gi' )], | ||
[ new RegExp( '^(m)an$' , 'gi' )], | ||
[ new RegExp( '(pe)rson$' , 'gi' )], | ||
[ new RegExp( '(child)$' , 'gi' )], | ||
[ new RegExp( '^(ox)$' , 'gi' )], | ||
[ new RegExp( '(ax|test)is$' , 'gi' )], | ||
[ new RegExp( '(octop|vir)us$' , 'gi' )], | ||
[ new RegExp( '(alias|status)$' , 'gi' )], | ||
[ new RegExp( '^(summons)$' , 'gi' )], | ||
[ new RegExp( '(bu)s$' , 'gi' )], | ||
[ new RegExp( '(buffal|tomat|potat)o$', 'gi' )], | ||
[ new RegExp( '([ti])um$', 'gi' )], | ||
[ new RegExp( 'sis$', 'gi' )], | ||
[ new RegExp( '(?:([^f])fe|([lr])f)$', 'gi' )], | ||
[ new RegExp( '(hive)$', 'gi' )], | ||
[ new RegExp( '([^aeiouy]|qu)y$', 'gi' )], | ||
[ new RegExp( '(x|ch|ss|sh)$', 'gi' )], | ||
[ new RegExp( '(matr|vert|ind)ix|ex$', 'gi' )], | ||
[ new RegExp( '([m|l])ouse$', 'gi' )], | ||
[ new RegExp( '^foot$', 'gi' )], | ||
[ new RegExp( '^tooth$', 'gi' )], | ||
[ new RegExp( '^goose$', 'gi' )], | ||
[ new RegExp( '(quiz)$', 'gi' )], | ||
[ new RegExp( '([ti])um$' , 'gi' )], | ||
[ new RegExp( 'sis$' , 'gi' )], | ||
[ new RegExp( '(?:([^f])fe|([lr])f)$' , 'gi' )], | ||
[ new RegExp( '(hi|ti)ve$' , 'gi' )], | ||
[ new RegExp( '([^aeiouy]|qu)y$' , 'gi' )], | ||
[ new RegExp( '(x|ch|ss|sh)$' , 'gi' )], | ||
[ new RegExp( '(matr|vert|ind)ix|ex$' , 'gi' )], | ||
[ new RegExp( '([m|l])ouse$' , 'gi' )], | ||
[ new RegExp( '^foot$' , 'gi' )], | ||
[ new RegExp( '^tooth$' , 'gi' )], | ||
[ new RegExp( '^goose$' , 'gi' )], | ||
[ new RegExp( '(quiz)$' , 'gi' )], | ||
// original rule | ||
[ new RegExp( '(m)en$', 'gi' ), '$1an' ], | ||
[ new RegExp( '(pe)ople$', 'gi' ), '$1rson' ], | ||
[ new RegExp( '(child)ren$', 'gi' ), '$1' ], | ||
[ new RegExp( '([ti])a$', 'gi' ), '$1um' ], | ||
[ new RegExp( '^(m)en$' , 'gi' ), '$1an' ], | ||
[ new RegExp( '(pe)ople$' , 'gi' ), '$1rson' ], | ||
[ new RegExp( '(child)ren$', 'gi' ), '$1' ], | ||
[ new RegExp( '([ti])a$' , 'gi' ), '$1um' ], | ||
[ new RegExp( '((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$','gi' ), '$1$2sis' ], | ||
[ new RegExp( '(hive)s$', 'gi' ), '$1' ], | ||
[ new RegExp( '(tive)s$', 'gi' ), '$1' ], | ||
[ new RegExp( '(curve)s$', 'gi' ), '$1' ], | ||
[ new RegExp( '([lr])ves$', 'gi' ), '$1f' ], | ||
[ new RegExp( '([^fo])ves$', 'gi' ), '$1fe' ], | ||
[ new RegExp( '(m)ovies$', 'gi' ), '$1ovie' ], | ||
[ new RegExp( '([^aeiouy]|qu)ies$', 'gi' ), '$1y' ], | ||
[ new RegExp( '(s)eries$', 'gi' ), '$1eries' ], | ||
[ new RegExp( '(x|ch|ss|sh)es$', 'gi' ), '$1' ], | ||
[ new RegExp( '([m|l])ice$', 'gi' ), '$1ouse' ], | ||
[ new RegExp( '(bus)es$', 'gi' ), '$1' ], | ||
[ new RegExp( '(o)es$', 'gi' ), '$1' ], | ||
[ new RegExp( '(shoe)s$', 'gi' ), '$1' ], | ||
[ new RegExp( '(cris|ax|test)es$', 'gi' ), '$1is' ], | ||
[ new RegExp( '(octop|vir)i$', 'gi' ), '$1us' ], | ||
[ new RegExp( '(alias|status)es$', 'gi' ), '$1' ], | ||
[ new RegExp( '^(ox)en', 'gi' ), '$1' ], | ||
[ new RegExp( '(vert|ind)ices$', 'gi' ), '$1ex' ], | ||
[ new RegExp( '(matr)ices$', 'gi' ), '$1ix' ], | ||
[ new RegExp( '^feet$', 'gi' ), 'foot' ], | ||
[ new RegExp( '^teeth$', 'gi' ), 'tooth' ], | ||
[ new RegExp( '^geese$', 'gi' ), 'goose' ], | ||
[ new RegExp( '(quiz)zes$', 'gi' ), '$1' ], | ||
[ new RegExp( 'ss$', 'gi' ), 'ss' ], | ||
[ new RegExp( 's$', 'gi' ), '' ] | ||
[ new RegExp( '(hi|ti)ves$' , 'gi' ), '$1ve' ], | ||
[ new RegExp( '(curve)s$' , 'gi' ), '$1' ], | ||
[ new RegExp( '([lr])ves$' , 'gi' ), '$1f' ], | ||
[ new RegExp( '([^fo])ves$' , 'gi' ), '$1fe' ], | ||
[ new RegExp( '(m)ovies$' , 'gi' ), '$1ovie' ], | ||
[ new RegExp( '([^aeiouy]|qu)ies$', 'gi' ), '$1y' ], | ||
[ new RegExp( '(s)eries$' , 'gi' ), '$1eries' ], | ||
[ new RegExp( '(x|ch|ss|sh)es$' , 'gi' ), '$1' ], | ||
[ new RegExp( '([m|l])ice$' , 'gi' ), '$1ouse' ], | ||
[ new RegExp( '(bus)es$' , 'gi' ), '$1' ], | ||
[ new RegExp( '(o)es$' , 'gi' ), '$1' ], | ||
[ new RegExp( '(shoe)s$' , 'gi' ), '$1' ], | ||
[ new RegExp( '(cris|ax|test)es$' , 'gi' ), '$1is' ], | ||
[ new RegExp( '(octop|vir)i$' , 'gi' ), '$1us' ], | ||
[ new RegExp( '(alias|status)es$' , 'gi' ), '$1' ], | ||
[ new RegExp( '^(summons)es$' , 'gi' ), '$1' ], | ||
[ new RegExp( '^(ox)en' , 'gi' ), '$1' ], | ||
[ new RegExp( '(vert|ind)ices$' , 'gi' ), '$1ex' ], | ||
[ new RegExp( '(matr)ices$' , 'gi' ), '$1ix' ], | ||
[ new RegExp( '^feet$' , 'gi' ), 'foot' ], | ||
[ new RegExp( '^teeth$' , 'gi' ), 'tooth' ], | ||
[ new RegExp( '^geese$' , 'gi' ), 'goose' ], | ||
[ new RegExp( '(quiz)zes$' , 'gi' ), '$1' ], | ||
[ new RegExp( 'ss$' , 'gi' ), 'ss' ], | ||
[ new RegExp( 's$' , 'gi' ), '' ] | ||
]; | ||
@@ -685,5 +1000,5 @@ | ||
*/ | ||
inflector.version = '1.4.2'; | ||
inflector.version = '1.5.0'; | ||
return inflector; | ||
})); |
{ | ||
"name" : "inflection", | ||
"version" : "1.4.2", | ||
"version" : "1.5.0", | ||
"description": "A port of inflection-js to node.js module", | ||
@@ -5,0 +5,0 @@ "keywords" : [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54500
1015