Skip to content

Commit 8b25ee6

Browse files
committed
[bugfix] genus plural & singular form
1 parent c8fbeea commit 8b25ee6

3 files changed

Lines changed: 67 additions & 57 deletions

File tree

inflection.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/inflection.js

Lines changed: 59 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -377,38 +377,40 @@
377377
quizzes : new RegExp( '(quiz)zes$' , 'gi' ),
378378
whereases : new RegExp( '^(whereas)es$' , 'gi' ),
379379
criteria : new RegExp( '^(criteri)a$' , 'gi' ),
380+
genera : new RegExp( '^genera$' , 'gi' ),
380381
ss : new RegExp( 'ss$' , 'gi' ),
381382
s : new RegExp( 's$' , 'gi' )
382383
},
383384

384385
singular : {
385-
man : new RegExp( '^(m|wom)an$' , 'gi' ),
386-
person : new RegExp( '(pe)rson$' , 'gi' ),
387-
child : new RegExp( '(child)$' , 'gi' ),
388-
ox : new RegExp( '^(ox)$' , 'gi' ),
389-
axis : new RegExp( '(ax|test)is$' , 'gi' ),
390-
octopus : new RegExp( '(octop|vir)us$' , 'gi' ),
391-
alias : new RegExp( '(alias|status|canvas)$', 'gi' ),
392-
summons : new RegExp( '^(summons)$' , 'gi' ),
393-
bus : new RegExp( '(bu)s$' , 'gi' ),
394-
buffalo : new RegExp( '(buffal|tomat|potat)o$', 'gi' ),
395-
tium : new RegExp( '([ti])um$' , 'gi' ),
396-
sis : new RegExp( 'sis$' , 'gi' ),
397-
ffe : new RegExp( '(?:([^f])fe|([lr])f)$' , 'gi' ),
398-
hive : new RegExp( '(hi|ti)ve$' , 'gi' ),
399-
aeiouyy : new RegExp( '([^aeiouy]|qu)y$' , 'gi' ),
400-
x : new RegExp( '(x|ch|ss|sh)$' , 'gi' ),
401-
matrix : new RegExp( '(matr)ix$' , 'gi' ),
402-
vertex : new RegExp( '(vert|ind)ex$' , 'gi' ),
403-
mouse : new RegExp( '([m|l])ouse$' , 'gi' ),
404-
foot : new RegExp( '^foot$' , 'gi' ),
405-
tooth : new RegExp( '^tooth$' , 'gi' ),
406-
goose : new RegExp( '^goose$' , 'gi' ),
407-
quiz : new RegExp( '(quiz)$' , 'gi' ),
408-
whereas : new RegExp( '^(whereas)$' , 'gi' ),
409-
criterion : new RegExp( '^(criteri)on$' , 'gi' ),
410-
s : new RegExp( 's$' , 'gi' ),
411-
common : new RegExp( '$' , 'gi' )
386+
man : new RegExp( '^(m|wom)an$' , 'gi' ),
387+
person : new RegExp( '(pe)rson$' , 'gi' ),
388+
child : new RegExp( '(child)$' , 'gi' ),
389+
ox : new RegExp( '^(ox)$' , 'gi' ),
390+
axis : new RegExp( '(ax|test)is$' , 'gi' ),
391+
octopus : new RegExp( '(octop|vir)us$' , 'gi' ),
392+
alias : new RegExp( '(alias|status|canvas)$', 'gi' ),
393+
summons : new RegExp( '^(summons)$' , 'gi' ),
394+
bus : new RegExp( '(bu)s$' , 'gi' ),
395+
buffalo : new RegExp( '(buffal|tomat|potat)o$', 'gi' ),
396+
tium : new RegExp( '([ti])um$' , 'gi' ),
397+
sis : new RegExp( 'sis$' , 'gi' ),
398+
ffe : new RegExp( '(?:([^f])fe|([lr])f)$' , 'gi' ),
399+
hive : new RegExp( '(hi|ti)ve$' , 'gi' ),
400+
aeiouyy : new RegExp( '([^aeiouy]|qu)y$' , 'gi' ),
401+
x : new RegExp( '(x|ch|ss|sh)$' , 'gi' ),
402+
matrix : new RegExp( '(matr)ix$' , 'gi' ),
403+
vertex : new RegExp( '(vert|ind)ex$' , 'gi' ),
404+
mouse : new RegExp( '([m|l])ouse$' , 'gi' ),
405+
foot : new RegExp( '^foot$' , 'gi' ),
406+
tooth : new RegExp( '^tooth$' , 'gi' ),
407+
goose : new RegExp( '^goose$' , 'gi' ),
408+
quiz : new RegExp( '(quiz)$' , 'gi' ),
409+
whereas : new RegExp( '^(whereas)$' , 'gi' ),
410+
criterion : new RegExp( '^(criteri)on$' , 'gi' ),
411+
genus : new RegExp( '^genus$' , 'gi' ),
412+
s : new RegExp( 's$' , 'gi' ),
413+
common : new RegExp( '$' , 'gi' )
412414
}
413415
};
414416

@@ -444,33 +446,35 @@
444446
[ regex.plural.quizzes ],
445447
[ regex.plural.whereases ],
446448
[ regex.plural.criteria ],
449+
[ regex.plural.genera ],
447450

448451
// original rule
449-
[ regex.singular.man , '$1en' ],
450-
[ regex.singular.person , '$1ople' ],
451-
[ regex.singular.child , '$1ren' ],
452-
[ regex.singular.ox , '$1en' ],
453-
[ regex.singular.axis , '$1es' ],
454-
[ regex.singular.octopus, '$1i' ],
455-
[ regex.singular.alias , '$1es' ],
456-
[ regex.singular.summons, '$1es' ],
457-
[ regex.singular.bus , '$1ses' ],
458-
[ regex.singular.buffalo, '$1oes' ],
459-
[ regex.singular.tium , '$1a' ],
460-
[ regex.singular.sis , 'ses' ],
461-
[ regex.singular.ffe , '$1$2ves' ],
462-
[ regex.singular.hive , '$1ves' ],
463-
[ regex.singular.aeiouyy, '$1ies' ],
464-
[ regex.singular.matrix , '$1ices' ],
465-
[ regex.singular.vertex , '$1ices' ],
466-
[ regex.singular.x , '$1es' ],
467-
[ regex.singular.mouse , '$1ice' ],
468-
[ regex.singular.foot , 'feet' ],
469-
[ regex.singular.tooth , 'teeth' ],
470-
[ regex.singular.goose , 'geese' ],
471-
[ regex.singular.quiz , '$1zes' ],
472-
[ regex.singular.whereas, '$1es' ],
452+
[ regex.singular.man , '$1en' ],
453+
[ regex.singular.person , '$1ople' ],
454+
[ regex.singular.child , '$1ren' ],
455+
[ regex.singular.ox , '$1en' ],
456+
[ regex.singular.axis , '$1es' ],
457+
[ regex.singular.octopus , '$1i' ],
458+
[ regex.singular.alias , '$1es' ],
459+
[ regex.singular.summons , '$1es' ],
460+
[ regex.singular.bus , '$1ses' ],
461+
[ regex.singular.buffalo , '$1oes' ],
462+
[ regex.singular.tium , '$1a' ],
463+
[ regex.singular.sis , 'ses' ],
464+
[ regex.singular.ffe , '$1$2ves' ],
465+
[ regex.singular.hive , '$1ves' ],
466+
[ regex.singular.aeiouyy , '$1ies' ],
467+
[ regex.singular.matrix , '$1ices' ],
468+
[ regex.singular.vertex , '$1ices' ],
469+
[ regex.singular.x , '$1es' ],
470+
[ regex.singular.mouse , '$1ice' ],
471+
[ regex.singular.foot , 'feet' ],
472+
[ regex.singular.tooth , 'teeth' ],
473+
[ regex.singular.goose , 'geese' ],
474+
[ regex.singular.quiz , '$1zes' ],
475+
[ regex.singular.whereas , '$1es' ],
473476
[ regex.singular.criterion, '$1a' ],
477+
[ regex.singular.genus , 'genera' ],
474478

475479
[ regex.singular.s , 's' ],
476480
[ regex.singular.common, 's' ]
@@ -507,12 +511,14 @@
507511
[ regex.singular.quiz ],
508512
[ regex.singular.whereas ],
509513
[ regex.singular.criterion ],
514+
[ regex.singular.genus ],
510515

511516
// original rule
512517
[ regex.plural.men , '$1an' ],
513518
[ regex.plural.people , '$1rson' ],
514519
[ regex.plural.children , '$1' ],
515-
[ regex.plural.criteria, '$1on'],
520+
[ regex.plural.genera , 'genus'],
521+
[ regex.plural.criteria , '$1on'],
516522
[ regex.plural.tia , '$1um' ],
517523
[ regex.plural.analyses , '$1$2sis' ],
518524
[ regex.plural.hives , '$1ve' ],
@@ -1071,7 +1077,7 @@
10711077
/**
10721078
* @public
10731079
*/
1074-
inflector.version = '1.8.0';
1080+
inflector.version = '1.9.0';
10751081

10761082
return inflector;
10771083
}));

0 commit comments

Comments
 (0)