make-plural 4.0.1 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/make-plural.js CHANGED
@@ -1,20 +1,33 @@
1
- (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.MakePlural = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
2
- 'use strict';
1
+ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.MakePlural = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
2
+ "use strict";
3
3
 
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
+ exports.default = void 0;
7
8
 
8
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
9
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
9
10
 
10
- function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
11
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
11
12
 
12
- function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); }
13
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
14
+
15
+ function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _nonIterableRest(); }
16
+
17
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
18
+
19
+ function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
20
+
21
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
22
 
14
23
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
15
24
 
25
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
26
+
27
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
28
+
16
29
  /**
17
- * make-plural.js -- https://github.com/eemeli/make-plural.js/
30
+ * make-plural -- https://github.com/eemeli/make-plural
18
31
  * Copyright (c) 2014-2016 by Eemeli Aro <eemeli@gmail.com>
19
32
  *
20
33
  * Permission to use, copy, modify, and/or distribute this software for any
@@ -29,23 +42,26 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
29
42
  * action of contract, negligence or other tortious action, arising out of
30
43
  * or in connection with the use or performance of this software.
31
44
  */
32
-
33
- var Parser = function () {
45
+ var Parser =
46
+ /*#__PURE__*/
47
+ function () {
34
48
  function Parser() {
35
49
  _classCallCheck(this, Parser);
36
50
  }
37
51
 
38
52
  _createClass(Parser, [{
39
- key: 'parse',
53
+ key: "parse",
40
54
  value: function parse(cond) {
41
55
  var _this = this;
42
56
 
43
57
  if (cond === 'i = 0 or n = 1') return 'n >= 0 && n <= 1';
44
58
  if (cond === 'i = 0,1') return 'n >= 0 && n < 2';
59
+
45
60
  if (cond === 'i = 1 and v = 0') {
46
61
  this.v0 = 1;
47
62
  return 'n == 1 && v0';
48
63
  }
64
+
49
65
  return cond.replace(/([tv]) (!?)= 0/g, function (m, sym, noteq) {
50
66
  var sn = sym + '0';
51
67
  _this[sn] = 1;
@@ -63,18 +79,22 @@ var Parser = function () {
63
79
  return '(' + se + x.split(',').join(' || ' + se) + ')';
64
80
  }).replace(/(\w+) (!?)= ([0-9]+)\.\.([0-9]+)/g, function (m, sym, noteq, x0, x1) {
65
81
  if (Number(x0) + 1 === Number(x1)) {
66
- if (noteq) return sym + ' != ' + x0 + ' && ' + sym + ' != ' + x1;
67
- return '(' + sym + ' == ' + x0 + ' || ' + sym + ' == ' + x1 + ')';
82
+ if (noteq) return "".concat(sym, " != ").concat(x0, " && ").concat(sym, " != ").concat(x1);
83
+ return "(".concat(sym, " == ").concat(x0, " || ").concat(sym, " == ").concat(x1, ")");
68
84
  }
69
- if (noteq) return '(' + sym + ' < ' + x0 + ' || ' + sym + ' > ' + x1 + ')';
85
+
86
+ if (noteq) return "(".concat(sym, " < ").concat(x0, " || ").concat(sym, " > ").concat(x1, ")");
87
+
70
88
  if (sym === 'n') {
71
- _this.t0 = 1;return '(t0 && n >= ' + x0 + ' && n <= ' + x1 + ')';
89
+ _this.t0 = 1;
90
+ return "(t0 && n >= ".concat(x0, " && n <= ").concat(x1, ")");
72
91
  }
73
- return '(' + sym + ' >= ' + x0 + ' && ' + sym + ' <= ' + x1 + ')';
92
+
93
+ return "(".concat(sym, " >= ").concat(x0, " && ").concat(sym, " <= ").concat(x1, ")");
74
94
  }).replace(/ and /g, ' && ').replace(/ or /g, ' || ').replace(/ = /g, ' == ');
75
95
  }
76
96
  }, {
77
- key: 'vars',
97
+ key: "vars",
78
98
  value: function vars() {
79
99
  var vars = [];
80
100
  if (this.i) vars.push('i = s[0]');
@@ -83,12 +103,14 @@ var Parser = function () {
83
103
  if (this.v) vars.push('v = f.length');
84
104
  if (this.v0) vars.push('v0 = !s[1]');
85
105
  if (this.t0 || this.n10 || this.n100) vars.push('t0 = Number(s[0]) == n');
106
+
86
107
  for (var k in this) {
87
108
  if (/^.10+$/.test(k)) {
88
109
  var k0 = k[0] === 'n' ? 't0 && s[0]' : k[0];
89
- vars.push(k + ' = ' + k0 + '.slice(-' + k.substr(2).length + ')');
110
+ vars.push("".concat(k, " = ").concat(k0, ".slice(-").concat(k.substr(2).length, ")"));
90
111
  }
91
112
  }
113
+
92
114
  if (!vars.length) return '';
93
115
  return 'var ' + ["s = String(n).split('.')"].concat(vars).join(', ');
94
116
  }
@@ -97,7 +119,9 @@ var Parser = function () {
97
119
  return Parser;
98
120
  }();
99
121
 
100
- var Tests = function () {
122
+ var Tests =
123
+ /*#__PURE__*/
124
+ function () {
101
125
  function Tests(obj) {
102
126
  _classCallCheck(this, Tests);
103
127
 
@@ -107,124 +131,146 @@ var Tests = function () {
107
131
  }
108
132
 
109
133
  _createClass(Tests, [{
110
- key: 'add',
134
+ key: "add",
111
135
  value: function add(type, cat, src) {
112
- this[type][cat] = { src: src, values: null };
136
+ this[type][cat] = {
137
+ src: src,
138
+ values: null
139
+ };
113
140
  }
114
141
  }, {
115
- key: 'testCond',
142
+ key: "testCond",
116
143
  value: function testCond(n, type, expResult, fn) {
117
144
  try {
118
145
  var r = (fn || this.obj.fn)(n, type === 'ordinal');
119
146
  } catch (e) {
120
147
  r = e.toString();
121
148
  }
149
+
122
150
  if (r !== expResult) {
123
151
  throw new Error('Locale ' + JSON.stringify(this.obj.lc) + type + ' rule self-test failed for v = ' + JSON.stringify(n) + ' (was ' + JSON.stringify(r) + ', expected ' + JSON.stringify(expResult) + ')');
124
152
  }
153
+
125
154
  return true;
126
155
  }
127
156
  }, {
128
- key: 'testCat',
157
+ key: "testCat",
129
158
  value: function testCat(type, cat, fn) {
130
159
  var _this2 = this;
131
160
 
132
161
  var data = this[type][cat];
162
+
133
163
  if (!data.values) {
134
164
  data.values = data.src.join(' ').replace(/^[ ,]+|[ ,…]+$/g, '').replace(/(0\.[0-9])~(1\.[1-9])/g, '$1 1.0 $2').split(/[ ,~…]+/);
135
165
  }
166
+
136
167
  data.values.forEach(function (n) {
137
168
  _this2.testCond(n, type, cat, fn);
169
+
138
170
  if (!/\.0+$/.test(n)) _this2.testCond(Number(n), type, cat, fn);
139
171
  });
140
172
  return true;
141
173
  }
142
174
  }, {
143
- key: 'testAll',
175
+ key: "testAll",
144
176
  value: function testAll() {
145
177
  for (var cat in this.cardinal) {
146
178
  this.testCat('cardinal', cat);
147
- }for (var _cat in this.ordinal) {
179
+ }
180
+
181
+ for (var _cat in this.ordinal) {
148
182
  this.testCat('ordinal', _cat);
149
- }return true;
183
+ }
184
+
185
+ return true;
150
186
  }
151
187
  }]);
152
188
 
153
189
  return Tests;
154
190
  }();
155
191
 
156
- var MakePlural = function () {
192
+ var MakePlural =
193
+ /*#__PURE__*/
194
+ function () {
157
195
  function MakePlural(lc) {
158
- var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : MakePlural;
159
-
160
- var cardinals = _ref.cardinals;
161
- var ordinals = _ref.ordinals;
196
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : MakePlural,
197
+ cardinals = _ref.cardinals,
198
+ ordinals = _ref.ordinals;
162
199
 
163
200
  _classCallCheck(this, MakePlural);
164
201
 
165
202
  if (!cardinals && !ordinals) throw new Error('At least one type of plural is required');
166
203
  this.lc = lc;
167
- this.categories = { cardinal: [], ordinal: [] };
204
+ this.categories = {
205
+ cardinal: [],
206
+ ordinal: []
207
+ };
168
208
  this.parser = new Parser();
169
209
  this.tests = new Tests(this);
170
210
  this.fn = this.buildFunction(cardinals, ordinals);
171
211
  this.fn._obj = this;
172
212
  this.fn.categories = this.categories;
213
+
173
214
  this.fn.test = function () {
174
215
  return this.tests.testAll() && this.fn;
175
216
  }.bind(this);
217
+
176
218
  this.fn.toString = this.fnToString.bind(this);
177
219
  return this.fn;
178
220
  }
179
221
 
180
222
  _createClass(MakePlural, [{
181
- key: 'compile',
223
+ key: "compile",
182
224
  value: function compile(type, req) {
183
225
  var cases = [];
184
226
  var rules = MakePlural.getRules(type, this.lc);
227
+
185
228
  if (!rules) {
186
- if (req) throw new Error('Locale "' + this.lc + '" ' + type + ' rules not found');
229
+ if (req) throw new Error("Locale \"".concat(this.lc, "\" ").concat(type, " rules not found"));
187
230
  this.categories[type] = ['other'];
188
231
  return "'other'";
189
232
  }
190
- for (var r in rules) {
191
- var _rules$r$trim$split = rules[r].trim().split(/\s*@\w*/);
192
-
193
- var _rules$r$trim$split2 = _toArray(_rules$r$trim$split);
194
233
 
195
- var cond = _rules$r$trim$split2[0];
196
-
197
- var examples = _rules$r$trim$split2.slice(1);
234
+ for (var r in rules) {
235
+ var _rules$r$trim$split = rules[r].trim().split(/\s*@\w*/),
236
+ _rules$r$trim$split2 = _toArray(_rules$r$trim$split),
237
+ cond = _rules$r$trim$split2[0],
238
+ examples = _rules$r$trim$split2.slice(1);
198
239
 
199
240
  var cat = r.replace('pluralRule-count-', '');
200
241
  if (cond) cases.push([this.parser.parse(cond), cat]);
201
242
  this.tests.add(type, cat, examples);
202
243
  }
244
+
203
245
  this.categories[type] = cases.map(function (c) {
204
246
  return c[1];
205
247
  }).concat('other');
248
+
206
249
  if (cases.length === 1) {
207
- return '(' + cases[0][0] + ') ? \'' + cases[0][1] + '\' : \'other\'';
250
+ return "(".concat(cases[0][0], ") ? '").concat(cases[0][1], "' : 'other'");
208
251
  } else {
209
- return [].concat(_toConsumableArray(cases.map(function (c) {
210
- return '(' + c[0] + ') ? \'' + c[1] + '\'';
211
- })), ["'other'"]).join('\n : ');
252
+ return _toConsumableArray(cases.map(function (c) {
253
+ return "(".concat(c[0], ") ? '").concat(c[1], "'");
254
+ })).concat(["'other'"]).join('\n : ');
212
255
  }
213
256
  }
214
257
  }, {
215
- key: 'buildFunction',
258
+ key: "buildFunction",
216
259
  value: function buildFunction(cardinals, ordinals) {
217
260
  var _this3 = this;
218
261
 
219
262
  var compile = function compile(c) {
220
263
  return c ? (c[1] ? 'return ' : 'if (ord) return ') + _this3.compile.apply(_this3, _toConsumableArray(c)) : '';
221
264
  };
222
- var fold = { vars: function vars(str) {
223
- return (' ' + str + ';').replace(/(.{1,78})(,|$) ?/g, '$1$2\n ');
265
+
266
+ var fold = {
267
+ vars: function vars(str) {
268
+ return " ".concat(str, ";").replace(/(.{1,78})(,|$) ?/g, '$1$2\n ');
224
269
  },
225
270
  cond: function cond(str) {
226
- return (' ' + str + ';').replace(/(.{1,78}) (\|\| |$) ?/gm, '$1\n $2');
227
- } };
271
+ return " ".concat(str, ";").replace(/(.{1,78}) (\|\| |$) ?/gm, '$1\n $2');
272
+ }
273
+ };
228
274
  var cond = [ordinals && ['ordinal', !cardinals], cardinals && ['cardinal', true]].map(compile).map(fold.cond);
229
275
  var body = [fold.vars(this.parser.vars())].concat(_toConsumableArray(cond)).filter(function (line) {
230
276
  return !/^[\s;]*$/.test(line);
@@ -232,17 +278,17 @@ var MakePlural = function () {
232
278
  return line.replace(/\s+$/gm, '');
233
279
  }).join('\n');
234
280
  var args = ordinals && cardinals ? 'n, ord' : 'n';
235
- return new Function(args, body);
281
+ return new Function(args, body); // eslint-disable-line no-new-func
236
282
  }
237
283
  }, {
238
- key: 'fnToString',
284
+ key: "fnToString",
239
285
  value: function fnToString(name) {
240
- return Function.prototype.toString.call(this.fn).replace(/^function( \w+)?/, name ? 'function ' + name : 'function').replace('\n/**/', '');
286
+ return Function.prototype.toString.call(this.fn).replace(/^function( \w+)?/, name ? 'function ' + name : 'function').replace(/\n\/\*(``)?\*\//, '');
241
287
  }
242
288
  }], [{
243
- key: 'load',
289
+ key: "load",
244
290
  value: function load() {
245
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
291
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
246
292
  args[_key] = arguments[_key];
247
293
  }
248
294
 
@@ -257,16 +303,18 @@ var MakePlural = function () {
257
303
  return MakePlural;
258
304
  }
259
305
  }, {
260
- key: 'getRules',
306
+ key: "getRules",
261
307
  value: function getRules(type, locale) {
262
308
  if (locale.length) {
263
309
  var cat = MakePlural.rules[type];
264
310
  if (locale in cat) return cat[locale];
265
311
  var lc0 = locale.toLowerCase();
312
+
266
313
  for (var lc in cat) {
267
314
  if (lc.toLowerCase() === lc0) return cat[lc];
268
315
  }
269
316
  }
317
+
270
318
  return null;
271
319
  }
272
320
  }]);
@@ -275,12 +323,13 @@ var MakePlural = function () {
275
323
  }();
276
324
 
277
325
  exports.default = MakePlural;
278
-
279
-
280
326
  MakePlural.cardinals = true;
281
327
  MakePlural.ordinals = false;
282
- MakePlural.rules = { cardinal: {}, ordinal: {} };
283
- module.exports = exports['default'];
328
+ MakePlural.rules = {
329
+ cardinal: {},
330
+ ordinal: {}
331
+ };
332
+ module.exports = exports.default;
284
333
 
285
334
  },{}]},{},[1])(1)
286
- });
335
+ });
@@ -1 +1 @@
1
- !function(n){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.MakePlural=n()}}(function(){return function n(t,r,e){function i(a,u){if(!r[a]){if(!t[a]){var s="function"==typeof require&&require;if(!u&&s)return s(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var f=r[a]={exports:{}};t[a][0].call(f.exports,function(n){var r=t[a][1][n];return i(r?r:n)},f,f.exports,n,t,r,e)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a<e.length;a++)i(e[a]);return i}({1:[function(n,t,r){"use strict";function e(n){if(Array.isArray(n)){for(var t=0,r=Array(n.length);t<n.length;t++)r[t]=n[t];return r}return Array.from(n)}function i(n){return Array.isArray(n)?n:Array.from(n)}function o(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function n(n,t){for(var r=0;r<t.length;r++){var e=t[r];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}return function(t,r,e){return r&&n(t.prototype,r),e&&n(t,e),t}}(),u=function(){function n(){o(this,n)}return a(n,[{key:"parse",value:function(n){var t=this;return"i = 0 or n = 1"===n?"n >= 0 && n <= 1":"i = 0,1"===n?"n >= 0 && n < 2":"i = 1 and v = 0"===n?(this.v0=1,"n == 1 && v0"):n.replace(/([tv]) (!?)= 0/g,function(n,r,e){var i=r+"0";return t[i]=1,e?"!"+i:i}).replace(/\b[fintv]\b/g,function(n){return t[n]=1,n}).replace(/([fin]) % (10+)/g,function(n,r,e){var i=r+e;return t[i]=1,i}).replace(/n10+ = 0/g,"t0 && $&").replace(/(\w+ (!?)= )([0-9.]+,[0-9.,]+)/g,function(n,t,r,e){return"n = 0,1"===n?"(n == 0 || n == 1)":r?t+e.split(",").join(" && "+t):"("+t+e.split(",").join(" || "+t)+")"}).replace(/(\w+) (!?)= ([0-9]+)\.\.([0-9]+)/g,function(n,r,e,i,o){return Number(i)+1===Number(o)?e?r+" != "+i+" && "+r+" != "+o:"("+r+" == "+i+" || "+r+" == "+o+")":e?"("+r+" < "+i+" || "+r+" > "+o+")":"n"===r?(t.t0=1,"(t0 && n >= "+i+" && n <= "+o+")"):"("+r+" >= "+i+" && "+r+" <= "+o+")"}).replace(/ and /g," && ").replace(/ or /g," || ").replace(/ = /g," == ")}},{key:"vars",value:function n(){var n=[];this.i&&n.push("i = s[0]"),(this.f||this.v)&&n.push("f = s[1] || ''"),this.t&&n.push("t = (s[1] || '').replace(/0+$/, '')"),this.v&&n.push("v = f.length"),this.v0&&n.push("v0 = !s[1]"),(this.t0||this.n10||this.n100)&&n.push("t0 = Number(s[0]) == n");for(var t in this)if(/^.10+$/.test(t)){var r="n"===t[0]?"t0 && s[0]":t[0];n.push(t+" = "+r+".slice(-"+t.substr(2).length+")")}return n.length?"var "+["s = String(n).split('.')"].concat(n).join(", "):""}}]),n}(),s=function(){function n(t){o(this,n),this.obj=t,this.ordinal={},this.cardinal={}}return a(n,[{key:"add",value:function(n,t,r){this[n][t]={src:r,values:null}}},{key:"testCond",value:function(n,t,r,e){try{var i=(e||this.obj.fn)(n,"ordinal"===t)}catch(n){i=n.toString()}if(i!==r)throw new Error("Locale "+JSON.stringify(this.obj.lc)+t+" rule self-test failed for v = "+JSON.stringify(n)+" (was "+JSON.stringify(i)+", expected "+JSON.stringify(r)+")");return!0}},{key:"testCat",value:function(n,t,r){var e=this,i=this[n][t];return i.values||(i.values=i.src.join(" ").replace(/^[ ,]+|[ ,…]+$/g,"").replace(/(0\.[0-9])~(1\.[1-9])/g,"$1 1.0 $2").split(/[ ,~…]+/)),i.values.forEach(function(i){e.testCond(i,n,t,r),/\.0+$/.test(i)||e.testCond(Number(i),n,t,r)}),!0}},{key:"testAll",value:function(){for(var n in this.cardinal)this.testCat("cardinal",n);for(var t in this.ordinal)this.testCat("ordinal",t);return!0}}]),n}(),l=function(){function n(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n,e=r.cardinals,i=r.ordinals;if(o(this,n),!e&&!i)throw new Error("At least one type of plural is required");return this.lc=t,this.categories={cardinal:[],ordinal:[]},this.parser=new u,this.tests=new s(this),this.fn=this.buildFunction(e,i),this.fn._obj=this,this.fn.categories=this.categories,this.fn.test=function(){return this.tests.testAll()&&this.fn}.bind(this),this.fn.toString=this.fnToString.bind(this),this.fn}return a(n,[{key:"compile",value:function(t,r){var o=[],a=n.getRules(t,this.lc);if(!a){if(r)throw new Error('Locale "'+this.lc+'" '+t+" rules not found");return this.categories[t]=["other"],"'other'"}for(var u in a){var s=a[u].trim().split(/\s*@\w*/),l=i(s),f=l[0],c=l.slice(1),h=u.replace("pluralRule-count-","");f&&o.push([this.parser.parse(f),h]),this.tests.add(t,h,c)}return this.categories[t]=o.map(function(n){return n[1]}).concat("other"),1===o.length?"("+o[0][0]+") ? '"+o[0][1]+"' : 'other'":[].concat(e(o.map(function(n){return"("+n[0]+") ? '"+n[1]+"'"})),["'other'"]).join("\n : ")}},{key:"buildFunction",value:function(n,t){var r=this,i=function(n){return n?(n[1]?"return ":"if (ord) return ")+r.compile.apply(r,e(n)):""},o={vars:function(n){return(" "+n+";").replace(/(.{1,78})(,|$) ?/g,"$1$2\n ")},cond:function(n){return(" "+n+";").replace(/(.{1,78}) (\|\| |$) ?/gm,"$1\n $2")}},a=[t&&["ordinal",!n],n&&["cardinal",!0]].map(i).map(o.cond),u=[o.vars(this.parser.vars())].concat(e(a)).filter(function(n){return!/^[\s;]*$/.test(n)}).map(function(n){return n.replace(/\s+$/gm,"")}).join("\n"),s=t&&n?"n, ord":"n";return new Function(s,u)}},{key:"fnToString",value:function(n){return Function.prototype.toString.call(this.fn).replace(/^function( \w+)?/,n?"function "+n:"function").replace("\n/**/","")}}],[{key:"load",value:function(){for(var t=arguments.length,r=Array(t),e=0;e<t;e++)r[e]=arguments[e];return r.forEach(function(t){var r=t&&t.supplemental||null;if(!r)throw new Error("Data does not appear to be CLDR data");n.rules={cardinal:r["plurals-type-cardinal"]||n.rules.cardinal,ordinal:r["plurals-type-ordinal"]||n.rules.ordinal}}),n}},{key:"getRules",value:function(t,r){if(r.length){var e=n.rules[t];if(r in e)return e[r];var i=r.toLowerCase();for(var o in e)if(o.toLowerCase()===i)return e[o]}return null}}]),n}();r.default=l,l.cardinals=!0,l.ordinals=!1,l.rules={cardinal:{},ordinal:{}},t.exports=r.default},{}]},{},[1])(1)});
1
+ !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).MakePlural=t()}}(function(){return function o(a,c,u){function s(n,t){if(!c[n]){if(!a[n]){var r="function"==typeof require&&require;if(!t&&r)return r(n,!0);if(l)return l(n,!0);var e=new Error("Cannot find module '"+n+"'");throw e.code="MODULE_NOT_FOUND",e}var i=c[n]={exports:{}};a[n][0].call(i.exports,function(t){return s(a[n][1][t]||t)},i,i.exports,o,a,c,u)}return c[n].exports}for(var l="function"==typeof require&&require,t=0;t<u.length;t++)s(u[t]);return s}({1:[function(t,n,r){"use strict";function l(t){return function(t){if(Array.isArray(t)){for(var n=0,r=new Array(t.length);n<t.length;n++)r[n]=t[n];return r}}(t)||e(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function f(t){return function(t){if(Array.isArray(t))return t}(t)||e(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function e(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function i(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function o(t,n){for(var r=0;r<n.length;r++){var e=n[r];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}function a(t,n,r){return n&&o(t.prototype,n),r&&o(t,r),t}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var c=function(){function t(){i(this,t)}return a(t,[{key:"parse",value:function(t){var o=this;return"i = 0 or n = 1"===t?"n >= 0 && n <= 1":"i = 0,1"===t?"n >= 0 && n < 2":"i = 1 and v = 0"===t?(this.v0=1,"n == 1 && v0"):t.replace(/([tv]) (!?)= 0/g,function(t,n,r){var e=n+"0";return o[e]=1,r?"!"+e:e}).replace(/\b[fintv]\b/g,function(t){return o[t]=1,t}).replace(/([fin]) % (10+)/g,function(t,n,r){var e=n+r;return o[e]=1,e}).replace(/n10+ = 0/g,"t0 && $&").replace(/(\w+ (!?)= )([0-9.]+,[0-9.,]+)/g,function(t,n,r,e){return"n = 0,1"===t?"(n == 0 || n == 1)":r?n+e.split(",").join(" && "+n):"("+n+e.split(",").join(" || "+n)+")"}).replace(/(\w+) (!?)= ([0-9]+)\.\.([0-9]+)/g,function(t,n,r,e,i){return Number(e)+1===Number(i)?r?"".concat(n," != ").concat(e," && ").concat(n," != ").concat(i):"(".concat(n," == ").concat(e," || ").concat(n," == ").concat(i,")"):r?"(".concat(n," < ").concat(e," || ").concat(n," > ").concat(i,")"):"n"===n?(o.t0=1,"(t0 && n >= ".concat(e," && n <= ").concat(i,")")):"(".concat(n," >= ").concat(e," && ").concat(n," <= ").concat(i,")")}).replace(/ and /g," && ").replace(/ or /g," || ").replace(/ = /g," == ")}},{key:"vars",value:function(){var t=[];for(var n in this.i&&t.push("i = s[0]"),(this.f||this.v)&&t.push("f = s[1] || ''"),this.t&&t.push("t = (s[1] || '').replace(/0+$/, '')"),this.v&&t.push("v = f.length"),this.v0&&t.push("v0 = !s[1]"),(this.t0||this.n10||this.n100)&&t.push("t0 = Number(s[0]) == n"),this)if(/^.10+$/.test(n)){var r="n"===n[0]?"t0 && s[0]":n[0];t.push("".concat(n," = ").concat(r,".slice(-").concat(n.substr(2).length,")"))}return t.length?"var "+["s = String(n).split('.')"].concat(t).join(", "):""}}]),t}(),u=function(){function n(t){i(this,n),this.obj=t,this.ordinal={},this.cardinal={}}return a(n,[{key:"add",value:function(t,n,r){this[t][n]={src:r,values:null}}},{key:"testCond",value:function(t,n,r,e){try{var i=(e||this.obj.fn)(t,"ordinal"===n)}catch(t){i=t.toString()}if(i!==r)throw new Error("Locale "+JSON.stringify(this.obj.lc)+n+" rule self-test failed for v = "+JSON.stringify(t)+" (was "+JSON.stringify(i)+", expected "+JSON.stringify(r)+")");return!0}},{key:"testCat",value:function(n,r,e){var i=this,t=this[n][r];return t.values||(t.values=t.src.join(" ").replace(/^[ ,]+|[ ,…]+$/g,"").replace(/(0\.[0-9])~(1\.[1-9])/g,"$1 1.0 $2").split(/[ ,~…]+/)),t.values.forEach(function(t){i.testCond(t,n,r,e),/\.0+$/.test(t)||i.testCond(Number(t),n,r,e)}),!0}},{key:"testAll",value:function(){for(var t in this.cardinal)this.testCat("cardinal",t);for(var n in this.ordinal)this.testCat("ordinal",n);return!0}}]),n}(),s=function(){function s(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:s,r=n.cardinals,e=n.ordinals;if(i(this,s),!r&&!e)throw new Error("At least one type of plural is required");return this.lc=t,this.categories={cardinal:[],ordinal:[]},this.parser=new c,this.tests=new u(this),this.fn=this.buildFunction(r,e),(this.fn._obj=this).fn.categories=this.categories,this.fn.test=function(){return this.tests.testAll()&&this.fn}.bind(this),this.fn.toString=this.fnToString.bind(this),this.fn}return a(s,[{key:"compile",value:function(t,n){var r=[],e=s.getRules(t,this.lc);if(!e){if(n)throw new Error('Locale "'.concat(this.lc,'" ').concat(t," rules not found"));return this.categories[t]=["other"],"'other'"}for(var i in e){var o=f(e[i].trim().split(/\s*@\w*/)),a=o[0],c=o.slice(1),u=i.replace("pluralRule-count-","");a&&r.push([this.parser.parse(a),u]),this.tests.add(t,u,c)}return this.categories[t]=r.map(function(t){return t[1]}).concat("other"),1===r.length?"(".concat(r[0][0],") ? '").concat(r[0][1],"' : 'other'"):l(r.map(function(t){return"(".concat(t[0],") ? '").concat(t[1],"'")})).concat(["'other'"]).join("\n : ")}},{key:"buildFunction",value:function(t,n){var r=this,e=function(t){return" ".concat(t,";").replace(/(.{1,78})(,|$) ?/g,"$1$2\n ")},i=function(t){return" ".concat(t,";").replace(/(.{1,78}) (\|\| |$) ?/gm,"$1\n $2")},o=[n&&["ordinal",!t],t&&["cardinal",!0]].map(function(t){return t?(t[1]?"return ":"if (ord) return ")+r.compile.apply(r,l(t)):""}).map(i),a=[e(this.parser.vars())].concat(l(o)).filter(function(t){return!/^[\s;]*$/.test(t)}).map(function(t){return t.replace(/\s+$/gm,"")}).join("\n");return new Function(n&&t?"n, ord":"n",a)}},{key:"fnToString",value:function(t){return Function.prototype.toString.call(this.fn).replace(/^function( \w+)?/,t?"function "+t:"function").replace(/\n\/\*(``)?\*\//,"")}}],[{key:"load",value:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.forEach(function(t){var n=t&&t.supplemental||null;if(!n)throw new Error("Data does not appear to be CLDR data");s.rules={cardinal:n["plurals-type-cardinal"]||s.rules.cardinal,ordinal:n["plurals-type-ordinal"]||s.rules.ordinal}}),s}},{key:"getRules",value:function(t,n){if(n.length){var r=s.rules[t];if(n in r)return r[n];var e=n.toLowerCase();for(var i in r)if(i.toLowerCase()===e)return r[i]}return null}}]),s}();(r.default=s).cardinals=!0,s.ordinals=!1,s.rules={cardinal:{},ordinal:{}},n.exports=r.default},{}]},{},[1])(1)});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "make-plural",
3
- "version": "4.0.1",
3
+ "version": "4.3.0",
4
4
  "description": "Translates Unicode CLDR pluralization rules to executable JavaScript",
5
5
  "keywords": [
6
6
  "unicode",
@@ -11,13 +11,10 @@
11
11
  ],
12
12
  "author": "Eemeli Aro <eemeli@gmail.com>",
13
13
  "license": "ISC",
14
- "homepage": "https://github.com/eemeli/make-plural.js",
15
- "repository": {
16
- "type": "git",
17
- "url": "https://github.com/eemeli/make-plural.js.git"
18
- },
14
+ "homepage": "https://github.com/eemeli/make-plural#readme",
15
+ "repository": "eemeli/make-plural",
19
16
  "bugs": {
20
- "url": "https://github.com/eemeli/make-plural.js/issues"
17
+ "url": "https://github.com/eemeli/make-plural/issues"
21
18
  },
22
19
  "files": [
23
20
  "bin/",
@@ -31,41 +28,25 @@
31
28
  },
32
29
  "main": "umd/plurals",
33
30
  "scripts": {
34
- "lint": "eslint src/",
31
+ "lint": "standard 'src/*.js'",
35
32
  "test": "make test",
36
33
  "version": "git add -f $FILES"
37
34
  },
38
35
  "devDependencies": {
39
- "babel-cli": "^6.7.7",
40
- "babel-plugin-add-module-exports": "^0.2.1",
41
- "babel-preset-es2015": "^6.6.0",
42
- "babelify": "^7.2.0",
43
- "browserify": "^13.0.0",
44
- "cldr-core": "^30.0.0",
45
- "eslint": "^3.7.1",
46
- "eslint-config-standard": "^6.2.0",
47
- "eslint-plugin-promise": "^3.0.0",
48
- "eslint-plugin-standard": "^2.0.1",
36
+ "@babel/cli": "^7.1.2",
37
+ "@babel/core": "^7.1.2",
38
+ "@babel/preset-env": "^7.1.0",
39
+ "babel-plugin-add-module-exports": "^1.0.0",
40
+ "babelify": "^10.0.0",
41
+ "browserify": "^16.2.3",
42
+ "cldr-core": "^34.0.0",
49
43
  "expect.js": "*",
50
- "http-server": "^0.9.0",
51
- "mocha": "*",
52
- "uglify-js": "*"
44
+ "http-server": "^0.11.1",
45
+ "mocha": "^5.2.0",
46
+ "standard": "^12.0.1",
47
+ "uglify-js": "^3.4.9"
53
48
  },
54
49
  "optionalDependencies": {
55
50
  "minimist": "^1.2.0"
56
- },
57
- "eslintConfig": {
58
- "extends": "standard",
59
- "plugins": [
60
- "standard",
61
- "promise"
62
- ],
63
- "rules": {
64
- "no-new-func": 0,
65
- "space-before-function-paren": [
66
- 2,
67
- "never"
68
- ]
69
- }
70
51
  }
71
52
  }
@@ -62,7 +62,7 @@ fr: _cc[2],
62
62
  fur: _cc[1],
63
63
  fy: _cc[1],
64
64
  ga: {cardinal:["one","two","few","many","other"],ordinal:["one","other"]},
65
- gd: {cardinal:["one","two","few","other"],ordinal:["other"]},
65
+ gd: {cardinal:["one","two","few","other"],ordinal:["one","two","few","other"]},
66
66
  gl: _cc[1],
67
67
  gsw: _cc[1],
68
68
  gu: {cardinal:["one","other"],ordinal:["one","two","few","many","other"]},
@@ -76,10 +76,12 @@ hr: {cardinal:["one","few","other"],ordinal:["other"]},
76
76
  hsb: {cardinal:["one","two","few","other"],ordinal:["other"]},
77
77
  hu: _cc[2],
78
78
  hy: _cc[2],
79
+ ia: _cc[1],
79
80
  id: _cc[0],
80
81
  ig: _cc[0],
81
82
  ii: _cc[0],
82
83
  "in": _cc[0],
84
+ io: _cc[1],
83
85
  is: _cc[1],
84
86
  it: {cardinal:["one","other"],ordinal:["many","other"]},
85
87
  iu: _cc[3],
@@ -143,7 +145,7 @@ nso: _cc[1],
143
145
  ny: _cc[1],
144
146
  nyn: _cc[1],
145
147
  om: _cc[1],
146
- or: _cc[1],
148
+ or: {cardinal:["one","other"],ordinal:["one","two","few","many","other"]},
147
149
  os: _cc[1],
148
150
  pa: _cc[1],
149
151
  pap: _cc[1],
@@ -160,6 +162,9 @@ ru: {cardinal:["one","few","many","other"],ordinal:["other"]},
160
162
  rwk: _cc[1],
161
163
  sah: _cc[0],
162
164
  saq: _cc[1],
165
+ sc: {cardinal:["one","other"],ordinal:["many","other"]},
166
+ scn: {cardinal:["one","other"],ordinal:["many","other"]},
167
+ sd: _cc[1],
163
168
  sdh: _cc[1],
164
169
  se: _cc[3],
165
170
  seh: _cc[1],
@@ -191,7 +196,7 @@ teo: _cc[1],
191
196
  th: _cc[0],
192
197
  ti: _cc[1],
193
198
  tig: _cc[1],
194
- tk: _cc[1],
199
+ tk: {cardinal:["one","other"],ordinal:["few","other"]},
195
200
  tl: _cc[2],
196
201
  tn: _cc[1],
197
202
  to: _cc[0],
@@ -1 +1 @@
1
- var _cc=[{cardinal:["other"],ordinal:["other"]},{cardinal:["one","other"],ordinal:["other"]},{cardinal:["one","other"],ordinal:["one","other"]},{cardinal:["one","two","other"],ordinal:["other"]}];!function(c,o){"function"==typeof define&&define.amd?define(o):"object"==typeof exports?module.exports=o:c.pluralCategories=o}(this,{af:_cc[1],ak:_cc[1],am:_cc[1],ar:{cardinal:["zero","one","two","few","many","other"],ordinal:["other"]},ars:{cardinal:["zero","one","two","few","many","other"],ordinal:["other"]},as:{cardinal:["one","other"],ordinal:["one","two","few","many","other"]},asa:_cc[1],ast:_cc[1],az:{cardinal:["one","other"],ordinal:["one","few","many","other"]},be:{cardinal:["one","few","many","other"],ordinal:["few","other"]},bem:_cc[1],bez:_cc[1],bg:_cc[1],bh:_cc[1],bm:_cc[0],bn:{cardinal:["one","other"],ordinal:["one","two","few","many","other"]},bo:_cc[0],br:{cardinal:["one","two","few","many","other"],ordinal:["other"]},brx:_cc[1],bs:{cardinal:["one","few","other"],ordinal:["other"]},ca:{cardinal:["one","other"],ordinal:["one","two","few","other"]},ce:_cc[1],cgg:_cc[1],chr:_cc[1],ckb:_cc[1],cs:{cardinal:["one","few","many","other"],ordinal:["other"]},cy:{cardinal:["zero","one","two","few","many","other"],ordinal:["zero","one","two","few","many","other"]},da:_cc[1],de:_cc[1],dsb:{cardinal:["one","two","few","other"],ordinal:["other"]},dv:_cc[1],dz:_cc[0],ee:_cc[1],el:_cc[1],en:{cardinal:["one","other"],ordinal:["one","two","few","other"]},eo:_cc[1],es:_cc[1],et:_cc[1],eu:_cc[1],fa:_cc[1],ff:_cc[1],fi:_cc[1],fil:_cc[2],fo:_cc[1],fr:_cc[2],fur:_cc[1],fy:_cc[1],ga:{cardinal:["one","two","few","many","other"],ordinal:["one","other"]},gd:{cardinal:["one","two","few","other"],ordinal:["other"]},gl:_cc[1],gsw:_cc[1],gu:{cardinal:["one","other"],ordinal:["one","two","few","many","other"]},guw:_cc[1],gv:{cardinal:["one","two","few","many","other"],ordinal:["other"]},ha:_cc[1],haw:_cc[1],he:{cardinal:["one","two","many","other"],ordinal:["other"]},hi:{cardinal:["one","other"],ordinal:["one","two","few","many","other"]},hr:{cardinal:["one","few","other"],ordinal:["other"]},hsb:{cardinal:["one","two","few","other"],ordinal:["other"]},hu:_cc[2],hy:_cc[2],id:_cc[0],ig:_cc[0],ii:_cc[0],in:_cc[0],is:_cc[1],it:{cardinal:["one","other"],ordinal:["many","other"]},iu:_cc[3],iw:{cardinal:["one","two","many","other"],ordinal:["other"]},ja:_cc[0],jbo:_cc[0],jgo:_cc[1],ji:_cc[1],jmc:_cc[1],jv:_cc[0],jw:_cc[0],ka:{cardinal:["one","other"],ordinal:["one","many","other"]},kab:_cc[1],kaj:_cc[1],kcg:_cc[1],kde:_cc[0],kea:_cc[0],kk:{cardinal:["one","other"],ordinal:["many","other"]},kkj:_cc[1],kl:_cc[1],km:_cc[0],kn:_cc[1],ko:_cc[0],ks:_cc[1],ksb:_cc[1],ksh:{cardinal:["zero","one","other"],ordinal:["other"]},ku:_cc[1],kw:_cc[3],ky:_cc[1],lag:{cardinal:["zero","one","other"],ordinal:["other"]},lb:_cc[1],lg:_cc[1],lkt:_cc[0],ln:_cc[1],lo:{cardinal:["other"],ordinal:["one","other"]},lt:{cardinal:["one","few","many","other"],ordinal:["other"]},lv:{cardinal:["zero","one","other"],ordinal:["other"]},mas:_cc[1],mg:_cc[1],mgo:_cc[1],mk:{cardinal:["one","other"],ordinal:["one","two","many","other"]},ml:_cc[1],mn:_cc[1],mo:{cardinal:["one","few","other"],ordinal:["one","other"]},mr:{cardinal:["one","other"],ordinal:["one","two","few","other"]},ms:{cardinal:["other"],ordinal:["one","other"]},mt:{cardinal:["one","few","many","other"],ordinal:["other"]},my:_cc[0],nah:_cc[1],naq:_cc[3],nb:_cc[1],nd:_cc[1],ne:_cc[2],nl:_cc[1],nn:_cc[1],nnh:_cc[1],no:_cc[1],nqo:_cc[0],nr:_cc[1],nso:_cc[1],ny:_cc[1],nyn:_cc[1],om:_cc[1],or:_cc[1],os:_cc[1],pa:_cc[1],pap:_cc[1],pl:{cardinal:["one","few","many","other"],ordinal:["other"]},prg:{cardinal:["zero","one","other"],ordinal:["other"]},ps:_cc[1],pt:_cc[1],"pt-PT":_cc[1],rm:_cc[1],ro:{cardinal:["one","few","other"],ordinal:["one","other"]},rof:_cc[1],root:_cc[0],ru:{cardinal:["one","few","many","other"],ordinal:["other"]},rwk:_cc[1],sah:_cc[0],saq:_cc[1],sdh:_cc[1],se:_cc[3],seh:_cc[1],ses:_cc[0],sg:_cc[0],sh:{cardinal:["one","few","other"],ordinal:["other"]},shi:{cardinal:["one","few","other"],ordinal:["other"]},si:_cc[1],sk:{cardinal:["one","few","many","other"],ordinal:["other"]},sl:{cardinal:["one","two","few","other"],ordinal:["other"]},sma:_cc[3],smi:_cc[3],smj:_cc[3],smn:_cc[3],sms:_cc[3],sn:_cc[1],so:_cc[1],sq:{cardinal:["one","other"],ordinal:["one","many","other"]},sr:{cardinal:["one","few","other"],ordinal:["other"]},ss:_cc[1],ssy:_cc[1],st:_cc[1],sv:_cc[2],sw:_cc[1],syr:_cc[1],ta:_cc[1],te:_cc[1],teo:_cc[1],th:_cc[0],ti:_cc[1],tig:_cc[1],tk:_cc[1],tl:_cc[2],tn:_cc[1],to:_cc[0],tr:_cc[1],ts:_cc[1],tzm:_cc[1],ug:_cc[1],uk:{cardinal:["one","few","many","other"],ordinal:["few","other"]},ur:_cc[1],uz:_cc[1],ve:_cc[1],vi:{cardinal:["other"],ordinal:["one","other"]},vo:_cc[1],vun:_cc[1],wa:_cc[1],wae:_cc[1],wo:_cc[0],xh:_cc[1],xog:_cc[1],yi:_cc[1],yo:_cc[0],yue:_cc[0],zh:_cc[0],zu:_cc[1]});
1
+ var _cc=[{cardinal:["other"],ordinal:["other"]},{cardinal:["one","other"],ordinal:["other"]},{cardinal:["one","other"],ordinal:["one","other"]},{cardinal:["one","two","other"],ordinal:["other"]}];!function(c,o){"function"==typeof define&&define.amd?define(o):"object"==typeof exports?module.exports=o:c.pluralCategories=o}(this,{af:_cc[1],ak:_cc[1],am:_cc[1],ar:{cardinal:["zero","one","two","few","many","other"],ordinal:["other"]},ars:{cardinal:["zero","one","two","few","many","other"],ordinal:["other"]},as:{cardinal:["one","other"],ordinal:["one","two","few","many","other"]},asa:_cc[1],ast:_cc[1],az:{cardinal:["one","other"],ordinal:["one","few","many","other"]},be:{cardinal:["one","few","many","other"],ordinal:["few","other"]},bem:_cc[1],bez:_cc[1],bg:_cc[1],bh:_cc[1],bm:_cc[0],bn:{cardinal:["one","other"],ordinal:["one","two","few","many","other"]},bo:_cc[0],br:{cardinal:["one","two","few","many","other"],ordinal:["other"]},brx:_cc[1],bs:{cardinal:["one","few","other"],ordinal:["other"]},ca:{cardinal:["one","other"],ordinal:["one","two","few","other"]},ce:_cc[1],cgg:_cc[1],chr:_cc[1],ckb:_cc[1],cs:{cardinal:["one","few","many","other"],ordinal:["other"]},cy:{cardinal:["zero","one","two","few","many","other"],ordinal:["zero","one","two","few","many","other"]},da:_cc[1],de:_cc[1],dsb:{cardinal:["one","two","few","other"],ordinal:["other"]},dv:_cc[1],dz:_cc[0],ee:_cc[1],el:_cc[1],en:{cardinal:["one","other"],ordinal:["one","two","few","other"]},eo:_cc[1],es:_cc[1],et:_cc[1],eu:_cc[1],fa:_cc[1],ff:_cc[1],fi:_cc[1],fil:_cc[2],fo:_cc[1],fr:_cc[2],fur:_cc[1],fy:_cc[1],ga:{cardinal:["one","two","few","many","other"],ordinal:["one","other"]},gd:{cardinal:["one","two","few","other"],ordinal:["one","two","few","other"]},gl:_cc[1],gsw:_cc[1],gu:{cardinal:["one","other"],ordinal:["one","two","few","many","other"]},guw:_cc[1],gv:{cardinal:["one","two","few","many","other"],ordinal:["other"]},ha:_cc[1],haw:_cc[1],he:{cardinal:["one","two","many","other"],ordinal:["other"]},hi:{cardinal:["one","other"],ordinal:["one","two","few","many","other"]},hr:{cardinal:["one","few","other"],ordinal:["other"]},hsb:{cardinal:["one","two","few","other"],ordinal:["other"]},hu:_cc[2],hy:_cc[2],ia:_cc[1],id:_cc[0],ig:_cc[0],ii:_cc[0],in:_cc[0],io:_cc[1],is:_cc[1],it:{cardinal:["one","other"],ordinal:["many","other"]},iu:_cc[3],iw:{cardinal:["one","two","many","other"],ordinal:["other"]},ja:_cc[0],jbo:_cc[0],jgo:_cc[1],ji:_cc[1],jmc:_cc[1],jv:_cc[0],jw:_cc[0],ka:{cardinal:["one","other"],ordinal:["one","many","other"]},kab:_cc[1],kaj:_cc[1],kcg:_cc[1],kde:_cc[0],kea:_cc[0],kk:{cardinal:["one","other"],ordinal:["many","other"]},kkj:_cc[1],kl:_cc[1],km:_cc[0],kn:_cc[1],ko:_cc[0],ks:_cc[1],ksb:_cc[1],ksh:{cardinal:["zero","one","other"],ordinal:["other"]},ku:_cc[1],kw:_cc[3],ky:_cc[1],lag:{cardinal:["zero","one","other"],ordinal:["other"]},lb:_cc[1],lg:_cc[1],lkt:_cc[0],ln:_cc[1],lo:{cardinal:["other"],ordinal:["one","other"]},lt:{cardinal:["one","few","many","other"],ordinal:["other"]},lv:{cardinal:["zero","one","other"],ordinal:["other"]},mas:_cc[1],mg:_cc[1],mgo:_cc[1],mk:{cardinal:["one","other"],ordinal:["one","two","many","other"]},ml:_cc[1],mn:_cc[1],mo:{cardinal:["one","few","other"],ordinal:["one","other"]},mr:{cardinal:["one","other"],ordinal:["one","two","few","other"]},ms:{cardinal:["other"],ordinal:["one","other"]},mt:{cardinal:["one","few","many","other"],ordinal:["other"]},my:_cc[0],nah:_cc[1],naq:_cc[3],nb:_cc[1],nd:_cc[1],ne:_cc[2],nl:_cc[1],nn:_cc[1],nnh:_cc[1],no:_cc[1],nqo:_cc[0],nr:_cc[1],nso:_cc[1],ny:_cc[1],nyn:_cc[1],om:_cc[1],or:{cardinal:["one","other"],ordinal:["one","two","few","many","other"]},os:_cc[1],pa:_cc[1],pap:_cc[1],pl:{cardinal:["one","few","many","other"],ordinal:["other"]},prg:{cardinal:["zero","one","other"],ordinal:["other"]},ps:_cc[1],pt:_cc[1],"pt-PT":_cc[1],rm:_cc[1],ro:{cardinal:["one","few","other"],ordinal:["one","other"]},rof:_cc[1],root:_cc[0],ru:{cardinal:["one","few","many","other"],ordinal:["other"]},rwk:_cc[1],sah:_cc[0],saq:_cc[1],sc:{cardinal:["one","other"],ordinal:["many","other"]},scn:{cardinal:["one","other"],ordinal:["many","other"]},sd:_cc[1],sdh:_cc[1],se:_cc[3],seh:_cc[1],ses:_cc[0],sg:_cc[0],sh:{cardinal:["one","few","other"],ordinal:["other"]},shi:{cardinal:["one","few","other"],ordinal:["other"]},si:_cc[1],sk:{cardinal:["one","few","many","other"],ordinal:["other"]},sl:{cardinal:["one","two","few","other"],ordinal:["other"]},sma:_cc[3],smi:_cc[3],smj:_cc[3],smn:_cc[3],sms:_cc[3],sn:_cc[1],so:_cc[1],sq:{cardinal:["one","other"],ordinal:["one","many","other"]},sr:{cardinal:["one","few","other"],ordinal:["other"]},ss:_cc[1],ssy:_cc[1],st:_cc[1],sv:_cc[2],sw:_cc[1],syr:_cc[1],ta:_cc[1],te:_cc[1],teo:_cc[1],th:_cc[0],ti:_cc[1],tig:_cc[1],tk:{cardinal:["one","other"],ordinal:["few","other"]},tl:_cc[2],tn:_cc[1],to:_cc[0],tr:_cc[1],ts:_cc[1],tzm:_cc[1],ug:_cc[1],uk:{cardinal:["one","few","many","other"],ordinal:["few","other"]},ur:_cc[1],uz:_cc[1],ve:_cc[1],vi:{cardinal:["other"],ordinal:["one","other"]},vo:_cc[1],vun:_cc[1],wa:_cc[1],wae:_cc[1],wo:_cc[0],xh:_cc[1],xog:_cc[1],yi:_cc[1],yo:_cc[0],yue:_cc[0],zh:_cc[0],zu:_cc[1]});