From c4d713de2b11e31ac613035b64345c4d1cb306f8 Mon Sep 17 00:00:00 2001 From: Mark Banner Date: Wed, 5 Feb 2020 09:04:33 +0000 Subject: [PATCH] Bug 1613139 - Enable ESLint for intl/locale and intl/strres (automatic changes). r=zbraniecki # ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D61580 --HG-- extra : moz-landing-system : lando --- intl/locale/PluralForm.jsm | 234 +- .../tests/unit/data/intl_on_workers_worker.js | 2 +- intl/locale/tests/unit/test_bug1086527.js | 6 +- intl/locale/tests/unit/test_bug22310.js | 92 +- intl/locale/tests/unit/test_collation.js | 11 +- .../locale/tests/unit/test_intl_on_workers.js | 12 +- intl/locale/tests/unit/test_localeService.js | 68 +- .../test_localeService_negotiateLanguages.js | 107 +- intl/locale/tests/unit/test_osPreferences.js | 21 +- intl/locale/tests/unit/test_pluralForm.js | 6805 +++++++++++++++-- .../tests/unit/test_pluralForm_english.js | 15 +- .../tests/unit/test_pluralForm_makeGetter.js | 10 +- intl/strres/tests/unit/test_bug378839.js | 47 +- intl/strres/tests/unit/test_bug397093.js | 45 +- 14 files changed, 6549 insertions(+), 926 deletions(-) diff --git a/intl/locale/PluralForm.jsm b/intl/locale/PluralForm.jsm index 946152927f13..14596673ed51 100644 --- a/intl/locale/PluralForm.jsm +++ b/intl/locale/PluralForm.jsm @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -var EXPORTED_SYMBOLS = [ "PluralForm" ]; +var EXPORTED_SYMBOLS = ["PluralForm"]; /** * This module provides the PluralForm object which contains a method to figure @@ -38,45 +38,151 @@ const kIntlProperties = "chrome://global/locale/intl.properties"; // of plural forms and the second is the function to figure out the index. var gFunctions = [ // 0: Chinese - [1, (n) => 0], + [1, n => 0], // 1: English - [2, (n) => n!=1?1:0], + [2, n => (n != 1 ? 1 : 0)], // 2: French - [2, (n) => n>1?1:0], + [2, n => (n > 1 ? 1 : 0)], // 3: Latvian - [3, (n) => n%10==1&&n%100!=11?1:n%10==0?0:2], + [3, n => (n % 10 == 1 && n % 100 != 11 ? 1 : n % 10 == 0 ? 0 : 2)], // 4: Scottish Gaelic - [4, (n) => n==1||n==11?0:n==2||n==12?1:n>0&&n<20?2:3], + [ + 4, + n => + n == 1 || n == 11 ? 0 : n == 2 || n == 12 ? 1 : n > 0 && n < 20 ? 2 : 3, + ], // 5: Romanian - [3, (n) => n==1?0:n==0||n%100>0&&n%100<20?1:2], + [3, n => (n == 1 ? 0 : n == 0 || (n % 100 > 0 && n % 100 < 20) ? 1 : 2)], // 6: Lithuanian - [3, (n) => n%10==1&&n%100!=11?0:n%10>=2&&(n%100<10||n%100>=20)?2:1], + [ + 3, + n => + n % 10 == 1 && n % 100 != 11 + ? 0 + : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) + ? 2 + : 1, + ], // 7: Russian - [3, (n) => n%10==1&&n%100!=11?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2], + [ + 3, + n => + n % 10 == 1 && n % 100 != 11 + ? 0 + : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) + ? 1 + : 2, + ], // 8: Slovak - [3, (n) => n==1?0:n>=2&&n<=4?1:2], + [3, n => (n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2)], // 9: Polish - [3, (n) => n==1?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2], + [ + 3, + n => + n == 1 + ? 0 + : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) + ? 1 + : 2, + ], // 10: Slovenian - [4, (n) => n%100==1?0:n%100==2?1:n%100==3||n%100==4?2:3], + [ + 4, + n => + n % 100 == 1 + ? 0 + : n % 100 == 2 + ? 1 + : n % 100 == 3 || n % 100 == 4 + ? 2 + : 3, + ], // 11: Irish Gaeilge - [5, (n) => n==1?0:n==2?1:n>=3&&n<=6?2:n>=7&&n<=10?3:4], + [ + 5, + n => + n == 1 + ? 0 + : n == 2 + ? 1 + : n >= 3 && n <= 6 + ? 2 + : n >= 7 && n <= 10 + ? 3 + : 4, + ], // 12: Arabic - [6, (n) => n==0?5:n==1?0:n==2?1:n%100>=3&&n%100<=10?2:n%100>=11&&n%100<=99?3:4], + [ + 6, + n => + n == 0 + ? 5 + : n == 1 + ? 0 + : n == 2 + ? 1 + : n % 100 >= 3 && n % 100 <= 10 + ? 2 + : n % 100 >= 11 && n % 100 <= 99 + ? 3 + : 4, + ], // 13: Maltese - [4, (n) => n==1?0:n==0||n%100>0&&n%100<=10?1:n%100>10&&n%100<20?2:3], + [ + 4, + n => + n == 1 + ? 0 + : n == 0 || (n % 100 > 0 && n % 100 <= 10) + ? 1 + : n % 100 > 10 && n % 100 < 20 + ? 2 + : 3, + ], // 14: Unused - [3, (n) => n%10==1?0:n%10==2?1:2], + [3, n => (n % 10 == 1 ? 0 : n % 10 == 2 ? 1 : 2)], // 15: Icelandic, Macedonian - [2, (n) => n%10==1&&n%100!=11?0:1], + [2, n => (n % 10 == 1 && n % 100 != 11 ? 0 : 1)], // 16: Breton - [5, (n) => n%10==1&&n%100!=11&&n%100!=71&&n%100!=91?0:n%10==2&&n%100!=12&&n%100!=72&&n%100!=92?1:(n%10==3||n%10==4||n%10==9)&&n%100!=13&&n%100!=14&&n%100!=19&&n%100!=73&&n%100!=74&&n%100!=79&&n%100!=93&&n%100!=94&&n%100!=99?2:n%1000000==0&&n!=0?3:4], + [ + 5, + n => + n % 10 == 1 && n % 100 != 11 && n % 100 != 71 && n % 100 != 91 + ? 0 + : n % 10 == 2 && n % 100 != 12 && n % 100 != 72 && n % 100 != 92 + ? 1 + : (n % 10 == 3 || n % 10 == 4 || n % 10 == 9) && + n % 100 != 13 && + n % 100 != 14 && + n % 100 != 19 && + n % 100 != 73 && + n % 100 != 74 && + n % 100 != 79 && + n % 100 != 93 && + n % 100 != 94 && + n % 100 != 99 + ? 2 + : n % 1000000 == 0 && n != 0 + ? 3 + : 4, + ], // 17: Shuar - [2, (n) => n!=0?1:0], + [2, n => (n != 0 ? 1 : 0)], // 18: Welsh - [6, (n) => n==0?0:n==1?1:n==2?2:n==3?3:n==6?4:5], + [ + 6, + n => (n == 0 ? 0 : n == 1 ? 1 : n == 2 ? 2 : n == 3 ? 3 : n == 6 ? 4 : 5), + ], // 19: Slavic languages (bs, hr, sr). Same as rule 7, but resulting in different CLDR categories - [3, (n) => n%10==1&&n%100!=11?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2], + [ + 3, + n => + n % 10 == 1 && n % 100 != 11 + ? 0 + : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) + ? 1 + : 2, + ], ]; var PluralForm = { @@ -89,8 +195,7 @@ var PluralForm = { * A semi-colon (;) separated string of words to pick the plural form * @return The appropriate plural form of the word */ - get get() - { + get get() { // This method will lazily load to avoid perf when it is first needed and // creates getPluralForm function. The function it creates is based on the // value of pluralRule specified in the intl stringbundle. @@ -101,7 +206,9 @@ var PluralForm = { delete PluralForm.get; // Make the plural form get function and set it as the default get - [PluralForm.get, PluralForm.numForms] = PluralForm.makeGetter(PluralForm.ruleNum); + [PluralForm.get, PluralForm.numForms] = PluralForm.makeGetter( + PluralForm.ruleNum + ); return PluralForm.get; }, @@ -113,8 +220,7 @@ var PluralForm = { * @return A pair: [function that gets the right plural form, * function that returns the number of plural forms] */ - makeGetter: function(aRuleNum) - { + makeGetter(aRuleNum) { // Default to "all plural" if the value is out of bounds or invalid if (aRuleNum < 0 || aRuleNum >= gFunctions.length || isNaN(aRuleNum)) { log(["Invalid rule number: ", aRuleNum, " -- defaulting to 0"]); @@ -126,29 +232,44 @@ var PluralForm = { // Return functions that give 1) the number of forms and 2) gets the right // plural form - return [function(aNum, aWords) { - // Figure out which index to use for the semi-colon separated words - let index = pluralFunc(aNum ? Number(aNum) : 0); - let words = aWords ? aWords.split(/;/) : [""]; + return [ + function(aNum, aWords) { + // Figure out which index to use for the semi-colon separated words + let index = pluralFunc(aNum ? Number(aNum) : 0); + let words = aWords ? aWords.split(/;/) : [""]; - // Explicitly check bounds to avoid strict warnings - let ret = index < words.length ? words[index] : undefined; + // Explicitly check bounds to avoid strict warnings + let ret = index < words.length ? words[index] : undefined; - // Check for array out of bounds or empty strings - if ((ret == undefined) || (ret == "")) { - // Report the caller to help figure out who is causing badness - let caller = Components.stack.caller ? Components.stack.caller.name : "top"; + // Check for array out of bounds or empty strings + if (ret == undefined || ret == "") { + // Report the caller to help figure out who is causing badness + let caller = Components.stack.caller + ? Components.stack.caller.name + : "top"; - // Display a message in the error console - log(["Index #", index, " of '", aWords, "' for value ", aNum, - " is invalid -- plural rule #", aRuleNum, "; called by ", caller]); + // Display a message in the error console + log([ + "Index #", + index, + " of '", + aWords, + "' for value ", + aNum, + " is invalid -- plural rule #", + aRuleNum, + "; called by ", + caller, + ]); - // Default to the first entry (which might be empty, but not undefined) - ret = words[0]; - } + // Default to the first entry (which might be empty, but not undefined) + ret = words[0]; + } - return ret; - }, () => numForms]; + return ret; + }, + () => numForms, + ]; }, /** @@ -156,8 +277,7 @@ var PluralForm = { * * @return The number of forms */ - get numForms() - { + get numForms() { // We lazily load numForms, so trigger the init logic with get() PluralForm.get(); return PluralForm.numForms; @@ -168,12 +288,14 @@ var PluralForm = { * * @return The plural rule number */ - get ruleNum() - { - return Number(Cc["@mozilla.org/intl/stringbundle;1"]. - getService(Ci.nsIStringBundleService).createBundle(kIntlProperties). - GetStringFromName("pluralRule")); - } + get ruleNum() { + return Number( + Cc["@mozilla.org/intl/stringbundle;1"] + .getService(Ci.nsIStringBundleService) + .createBundle(kIntlProperties) + .GetStringFromName("pluralRule") + ); + }, }; /** @@ -182,10 +304,10 @@ var PluralForm = { * @param aMsg * Error message to log or an array of strings to concat */ -function log(aMsg) -{ +function log(aMsg) { let msg = "PluralForm.jsm: " + (aMsg.join ? aMsg.join("") : aMsg); - Cc["@mozilla.org/consoleservice;1"].getService(Ci.nsIConsoleService). - logStringMessage(msg); + Cc["@mozilla.org/consoleservice;1"] + .getService(Ci.nsIConsoleService) + .logStringMessage(msg); dump(msg + "\n"); } diff --git a/intl/locale/tests/unit/data/intl_on_workers_worker.js b/intl/locale/tests/unit/data/intl_on_workers_worker.js index 98aeeb5c0b29..fe03359002c2 100644 --- a/intl/locale/tests/unit/data/intl_on_workers_worker.js +++ b/intl/locale/tests/unit/data/intl_on_workers_worker.js @@ -1,4 +1,4 @@ -self.onmessage = function (data) { +self.onmessage = function(data) { let myLocale = Intl.NumberFormat().resolvedOptions().locale; self.postMessage(myLocale); }; diff --git a/intl/locale/tests/unit/test_bug1086527.js b/intl/locale/tests/unit/test_bug1086527.js index 81ecdc7533cd..a3446886980a 100644 --- a/intl/locale/tests/unit/test_bug1086527.js +++ b/intl/locale/tests/unit/test_bug1086527.js @@ -6,7 +6,9 @@ * This unit test makes sure that PluralForm.get can be called from strict mode */ -const {PluralForm} = ChromeUtils.import("resource://gre/modules/PluralForm.jsm"); +const { PluralForm } = ChromeUtils.import( + "resource://gre/modules/PluralForm.jsm" +); delete PluralForm.numForms; delete PluralForm.get; @@ -16,5 +18,5 @@ function run_test() { "use strict"; Assert.equal(3, PluralForm.numForms()); - Assert.equal("one", PluralForm.get(5, 'one;many')); + Assert.equal("one", PluralForm.get(5, "one;many")); } diff --git a/intl/locale/tests/unit/test_bug22310.js b/intl/locale/tests/unit/test_bug22310.js index 9df2ecb86bb0..bc312398dbe6 100644 --- a/intl/locale/tests/unit/test_bug22310.js +++ b/intl/locale/tests/unit/test_bug22310.js @@ -1,51 +1,65 @@ -String.prototype.has = function(s) { return this.includes(s); } +String.prototype.has = function(s) { + return this.includes(s); +}; function dt(locale) { var date = new Date("2008-06-30T13:56:34"); - const dtOptions = { year: 'numeric', month: 'long', day: 'numeric', - hour: 'numeric', minute: 'numeric', second: 'numeric' }; + const dtOptions = { + year: "numeric", + month: "long", + day: "numeric", + hour: "numeric", + minute: "numeric", + second: "numeric", + }; return date.toLocaleString(locale, dtOptions); } var all_passed = true; -const tests = -[ - [dt("en-US").has("June"), "month name in en-US"], - [dt("en-US").has("2008"), "year in en-US"], - [dt("da").has("jun"), "month name in da"], - [dt("da-DK") == dt("da"), "da same as da-DK"], - [dt("en-GB").has("30") && dt("en-GB").has("June") && - dt("en-GB").indexOf("30") < dt("en-GB").indexOf("June"), - "day before month in en-GB"], - [dt("en-US").has("30") && dt("en-US").has("June") && - dt("en-US").indexOf("30") > dt("en-US").indexOf("June"), - "month before day in en-US"], - [dt("ja-JP").has("\u5E746\u670830\u65E5"), "year month and day in ja-JP"], - // The Firefox locale code ja-JP-mac will be resolved to a BCP47-compliant - // tag ja-JP-x-lvariant-mac by uloc_toLanguageTag - [dt("ja-JP") == dt("ja-JP-x-lvariant-mac"), "ja-JP-x-lvariant-mac same as ja-JP"], - [dt("nn-NO").has("juni"), "month name in nn-NO"], - [dt("nb-NO").has("juni"), "month name in nb-NO"], - // Bug 1261775 - failures on win10 - //[dt("no-NO").has("30. juni"), "month name in no-NO"], - [dt("sv-SE").has("30 jun"), "month name in sv-SE"], - [dt("kok").has("\u091C\u0942\u0928"), "month name in kok"], - [dt("ta-IN").has("\u0B9C\u0BC2\u0BA9\u0BCD"), "month name in ta-IN"], - [dt("ab-CD").length > 0, "fallback for ab-CD"] +const tests = [ + [dt("en-US").has("June"), "month name in en-US"], + [dt("en-US").has("2008"), "year in en-US"], + [dt("da").has("jun"), "month name in da"], + [dt("da-DK") == dt("da"), "da same as da-DK"], + [ + dt("en-GB").has("30") && + dt("en-GB").has("June") && + dt("en-GB").indexOf("30") < dt("en-GB").indexOf("June"), + "day before month in en-GB", + ], + [ + dt("en-US").has("30") && + dt("en-US").has("June") && + dt("en-US").indexOf("30") > dt("en-US").indexOf("June"), + "month before day in en-US", + ], + [dt("ja-JP").has("\u5E746\u670830\u65E5"), "year month and day in ja-JP"], + // The Firefox locale code ja-JP-mac will be resolved to a BCP47-compliant + // tag ja-JP-x-lvariant-mac by uloc_toLanguageTag + [ + dt("ja-JP") == dt("ja-JP-x-lvariant-mac"), + "ja-JP-x-lvariant-mac same as ja-JP", + ], + [dt("nn-NO").has("juni"), "month name in nn-NO"], + [dt("nb-NO").has("juni"), "month name in nb-NO"], + // Bug 1261775 - failures on win10 + //[dt("no-NO").has("30. juni"), "month name in no-NO"], + [dt("sv-SE").has("30 jun"), "month name in sv-SE"], + [dt("kok").has("\u091C\u0942\u0928"), "month name in kok"], + [dt("ta-IN").has("\u0B9C\u0BC2\u0BA9\u0BCD"), "month name in ta-IN"], + [!!dt("ab-CD").length, "fallback for ab-CD"], ]; -function one_test(testcase, msg) -{ - if (!testcase) { - all_passed = false; - dump("Unexpected date format: " + msg + "\n"); - } +function one_test(testcase, msg) { + if (!testcase) { + all_passed = false; + dump("Unexpected date format: " + msg + "\n"); + } } -function run_test() -{ - for (var i = 0; i < tests.length; ++i) { - one_test(tests[i][0], tests[i][1]); - } - Assert.ok(all_passed); +function run_test() { + for (var i = 0; i < tests.length; ++i) { + one_test(tests[i][0], tests[i][1]); + } + Assert.ok(all_passed); } diff --git a/intl/locale/tests/unit/test_collation.js b/intl/locale/tests/unit/test_collation.js index 888fc7a7fcf3..1eb3fd2dfe0d 100644 --- a/intl/locale/tests/unit/test_collation.js +++ b/intl/locale/tests/unit/test_collation.js @@ -1,7 +1,6 @@ ChromeUtils.import("resource://gre/modules/Services.jsm"); -function run_test() -{ +function run_test() { var input = [ "Argentina", "Oerlikon", @@ -18,11 +17,11 @@ function run_test() ]; function test(locale, expected) { - var collator = Cc["@mozilla.org/intl/collation-factory;1"]. - createInstance(Ci.nsICollationFactory). - CreateCollationForLocale(locale); + var collator = Cc["@mozilla.org/intl/collation-factory;1"] + .createInstance(Ci.nsICollationFactory) + .CreateCollationForLocale(locale); var strength = Ci.nsICollation.kCollationStrengthDefault; - var actual = input.sort((x, y) => collator.compareString(strength, x,y)); + var actual = input.sort((x, y) => collator.compareString(strength, x, y)); deepEqual(actual, expected, locale); } diff --git a/intl/locale/tests/unit/test_intl_on_workers.js b/intl/locale/tests/unit/test_intl_on_workers.js index 899e39d389da..4de22cf1c322 100644 --- a/intl/locale/tests/unit/test_intl_on_workers.js +++ b/intl/locale/tests/unit/test_intl_on_workers.js @@ -8,11 +8,17 @@ function run_test() { } let mainThreadLocale = Intl.NumberFormat().resolvedOptions().locale; - let testWorker = new Worker("chrome://locale/content/intl_on_workers_worker.js"); - testWorker.onmessage = function (e) { + let testWorker = new Worker( + "chrome://locale/content/intl_on_workers_worker.js" + ); + testWorker.onmessage = function(e) { try { let workerLocale = e.data; - equal(mainThreadLocale, workerLocale, "Worker should inherit Intl locale from main thread."); + equal( + mainThreadLocale, + workerLocale, + "Worker should inherit Intl locale from main thread." + ); } finally { do_test_finished(); } diff --git a/intl/locale/tests/unit/test_localeService.js b/intl/locale/tests/unit/test_localeService.js index 8a1e96251f19..da09e77fc26d 100644 --- a/intl/locale/tests/unit/test_localeService.js +++ b/intl/locale/tests/unit/test_localeService.js @@ -3,20 +3,17 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); -const osPrefs = Cc["@mozilla.org/intl/ospreferences;1"]. - getService(Ci.mozIOSPreferences); +const osPrefs = Cc["@mozilla.org/intl/ospreferences;1"].getService( + Ci.mozIOSPreferences +); -const localeService = - Cc["@mozilla.org/intl/localeservice;1"] - .getService(Ci.mozILocaleService); +const localeService = Cc["@mozilla.org/intl/localeservice;1"].getService( + Ci.mozILocaleService +); /** * Make sure the locale service can be instantiated. */ -function run_test() -{ - run_next_test(); -} add_test(function test_defaultLocale() { const defaultLocale = localeService.defaultLocale; @@ -37,7 +34,10 @@ add_test(function test_appLocalesAsLangTags() { const appLocales = localeService.appLocalesAsLangTags; Assert.ok(Array.isArray(appLocales), "appLocales returns an array"); - Assert.ok(appLocale == appLocales[0], "appLocale matches first entry in appLocales"); + Assert.ok( + appLocale == appLocales[0], + "appLocale matches first entry in appLocales" + ); const enUSLocales = appLocales.filter(loc => loc === "en-US"); Assert.ok(enUSLocales.length == 1, "en-US is present exactly one time"); @@ -50,7 +50,10 @@ const REQ_LOC_CHANGE_EVENT = "intl:requested-locales-changed"; add_test(function test_requestedLocales() { const requestedLocales = localeService.requestedLocales; - Assert.ok(Array.isArray(requestedLocales), "requestedLocales returns an array"); + Assert.ok( + Array.isArray(requestedLocales), + "requestedLocales returns an array" + ); run_next_test(); }); @@ -69,7 +72,7 @@ add_test(function test_requestedLocales_matchOS() { Services.prefs.setCharPref(PREF_REQUESTED_LOCALES, "ar-IR"); const observer = { - observe: function (aSubject, aTopic, aData) { + observe(aSubject, aTopic, aData) { switch (aTopic) { case REQ_LOC_CHANGE_EVENT: const reqLocs = localeService.requestedLocales; @@ -77,7 +80,7 @@ add_test(function test_requestedLocales_matchOS() { Services.obs.removeObserver(observer, REQ_LOC_CHANGE_EVENT); do_test_finished(); } - } + }, }; Services.obs.addObserver(observer, REQ_LOC_CHANGE_EVENT); @@ -97,7 +100,7 @@ add_test(function test_requestedLocales_onChange() { Services.prefs.setCharPref(PREF_REQUESTED_LOCALES, "ar-IR"); const observer = { - observe: function (aSubject, aTopic, aData) { + observe(aSubject, aTopic, aData) { switch (aTopic) { case REQ_LOC_CHANGE_EVENT: const reqLocs = localeService.requestedLocales; @@ -105,7 +108,7 @@ add_test(function test_requestedLocales_onChange() { Services.obs.removeObserver(observer, REQ_LOC_CHANGE_EVENT); do_test_finished(); } - } + }, }; Services.obs.addObserver(observer, REQ_LOC_CHANGE_EVENT); @@ -118,7 +121,10 @@ add_test(function test_requestedLocale() { Services.prefs.setCharPref(PREF_REQUESTED_LOCALES, "tlh"); let requestedLocale = localeService.requestedLocale; - Assert.ok(requestedLocale === "tlh", "requestedLocale returns the right value"); + Assert.ok( + requestedLocale === "tlh", + "requestedLocale returns the right value" + ); Services.prefs.clearUserPref(PREF_REQUESTED_LOCALES); @@ -126,18 +132,18 @@ add_test(function test_requestedLocale() { }); add_test(function test_requestedLocales() { - localeService.requestedLocales = ['de-AT', 'de-DE', 'de-CH']; + localeService.requestedLocales = ["de-AT", "de-DE", "de-CH"]; let locales = localeService.requestedLocales; - Assert.ok(locales[0] === 'de-AT'); - Assert.ok(locales[1] === 'de-DE'); - Assert.ok(locales[2] === 'de-CH'); + Assert.ok(locales[0] === "de-AT"); + Assert.ok(locales[1] === "de-DE"); + Assert.ok(locales[2] === "de-CH"); run_next_test(); }); add_test(function test_isAppLocaleRTL() { - Assert.ok(typeof localeService.isAppLocaleRTL === 'boolean'); + Assert.ok(typeof localeService.isAppLocaleRTL === "boolean"); run_next_test(); }); @@ -179,8 +185,8 @@ add_test(function test_availableLocales() { let locales = localeService.availableLocales; Assert.ok(locales.length == 2); - Assert.ok(locales[0] === 'und'); - Assert.ok(locales[1] === 'ar-IR'); + Assert.ok(locales[0] === "und"); + Assert.ok(locales[1] === "ar-IR"); localeService.availableLocales = avLocales; @@ -191,7 +197,10 @@ add_test(function test_availableLocales() { * This test verifies that all values coming from the pref are sanitized. */ add_test(function test_requestedLocales_sanitize() { - Services.prefs.setStringPref(PREF_REQUESTED_LOCALES, "de,2,#$@#,pl,ąó,!a2,DE-at,,;"); + Services.prefs.setStringPref( + PREF_REQUESTED_LOCALES, + "de,2,#$@#,pl,ąó,!a2,DE-at,,;" + ); let locales = localeService.requestedLocales; Assert.equal(locales[0], "de"); @@ -210,19 +219,19 @@ add_test(function test_handle_ja_JP_mac() { localeService.availableLocales = ["ja-JP-mac", "en-US"]; - localeService.requestedLocales = ['ja-JP-mac']; + localeService.requestedLocales = ["ja-JP-mac"]; let reqLocales = localeService.requestedLocales; - Assert.equal(reqLocales[0], 'ja-JP-macos'); + Assert.equal(reqLocales[0], "ja-JP-macos"); let avLocales = localeService.availableLocales; - Assert.equal(avLocales[0], 'ja-JP-macos'); + Assert.equal(avLocales[0], "ja-JP-macos"); let appLocales = localeService.appLocalesAsBCP47; - Assert.equal(appLocales[0], 'ja-JP-macos'); + Assert.equal(appLocales[0], "ja-JP-macos"); let appLocalesAsLT = localeService.appLocalesAsLangTags; - Assert.equal(appLocalesAsLT[0], 'ja-JP-mac'); + Assert.equal(appLocalesAsLT[0], "ja-JP-mac"); Assert.equal(localeService.appLocaleAsLangTag, "ja-JP-mac"); @@ -231,7 +240,6 @@ add_test(function test_handle_ja_JP_mac() { run_next_test(); }); - registerCleanupFunction(() => { Services.prefs.clearUserPref(PREF_REQUESTED_LOCALES); }); diff --git a/intl/locale/tests/unit/test_localeService_negotiateLanguages.js b/intl/locale/tests/unit/test_localeService_negotiateLanguages.js index 3680b36cd5e2..7f0fa63c62df 100644 --- a/intl/locale/tests/unit/test_localeService_negotiateLanguages.js +++ b/intl/locale/tests/unit/test_localeService_negotiateLanguages.js @@ -2,12 +2,12 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -const localeService = - Cc["@mozilla.org/intl/localeservice;1"] - .getService(Ci.mozILocaleService); +const localeService = Cc["@mozilla.org/intl/localeservice;1"].getService( + Ci.mozILocaleService +); const data = { - "filtering": { + filtering: { "exact match": [ [["en"], ["en"], ["en"]], [["en-US"], ["en-US"], ["en-US"]], @@ -26,7 +26,11 @@ const data = { ], "should match on likely subtag": [ [["en"], ["en-GB", "de", "en-US"], ["en-US", "en-GB"]], - [["en"], ["en-Latn-GB", "de", "en-Latn-US"], ["en-Latn-US", "en-Latn-GB"]], + [ + ["en"], + ["en-Latn-GB", "de", "en-Latn-US"], + ["en-Latn-US", "en-Latn-GB"], + ], [["fr"], ["fr-CA", "fr-FR"], ["fr-FR", "fr-CA"]], [["az-IR"], ["az-Latn", "az-Arab"], ["az-Arab"]], [["sr-RU"], ["sr-Cyrl", "sr-Latn"], ["sr-Latn"]], @@ -48,26 +52,47 @@ const data = { ], "should prioritize properly": [ // exact match first - [["en-US"], ["en-US-windows", "en", "en-US"], ["en-US", "en", "en-US-windows"]], + [ + ["en-US"], + ["en-US-windows", "en", "en-US"], + ["en-US", "en", "en-US-windows"], + ], // available as range second [["en-Latn-US"], ["en-GB", "en-US"], ["en-US", "en-GB"]], // likely subtags third [["en"], ["en-Cyrl-US", "en-Latn-US"], ["en-Latn-US"]], // variant range fourth - [["en-US-macos"], ["en-US-windows", "en-GB-macos"], ["en-US-windows", "en-GB-macos"]], + [ + ["en-US-macos"], + ["en-US-windows", "en-GB-macos"], + ["en-US-windows", "en-GB-macos"], + ], // regional range fifth [["en-US-macos"], ["en-GB-windows"], ["en-GB-windows"]], [["en-US"], ["en-GB", "en"], ["en", "en-GB"]], - [["fr-CA-macos", "de-DE"], ["de-DE", "fr-FR-windows"], ["fr-FR-windows", "de-DE"]], + [ + ["fr-CA-macos", "de-DE"], + ["de-DE", "fr-FR-windows"], + ["fr-FR-windows", "de-DE"], + ], ], "should handle default locale properly": [ [["fr"], ["de", "it"], []], [["fr"], ["de", "it"], "en-US", ["en-US"]], [["fr"], ["de", "en-US"], "en-US", ["en-US"]], - [["fr", "de-DE"], ["de-DE", "fr-CA"], "en-US", ["fr-CA", "de-DE", "en-US"]], + [ + ["fr", "de-DE"], + ["de-DE", "fr-CA"], + "en-US", + ["fr-CA", "de-DE", "en-US"], + ], ], "should handle all matches on the 1st higher than any on the 2nd": [ - [["fr-CA-macos", "de-DE"], ["de-DE", "fr-FR-windows"], ["fr-FR-windows", "de-DE"]], + [ + ["fr-CA-macos", "de-DE"], + ["de-DE", "fr-FR-windows"], + ["fr-FR-windows", "de-DE"], + ], ], "should handle cases and underscores, returning the form given in the 'available' list": [ [["fr_FR"], ["fr-FR"], ["fr-FR"]], @@ -86,33 +111,33 @@ const data = { [["2"], ["ąóżł"], []], [[[""]], ["fr-FR"], []], ], - "should not match on invalid input": [ - [["en"], ["ťŮ"], []], - ], + "should not match on invalid input": [[["en"], ["ťŮ"], []]], }, - "matching": { + matching: { "should match only one per requested": [ [ ["fr", "en"], - ["en-US", "fr-FR", "en", "fr"], null, - localeService.langNegStrategyMatching, ["fr", "en"] + ["en-US", "fr-FR", "en", "fr"], + null, + localeService.langNegStrategyMatching, + ["fr", "en"], ], - ] + ], }, - "lookup": { + lookup: { "should match only one": [ [ ["fr-FR", "en"], - ["en-US", "fr-FR", "en", "fr"], 'en-US', - localeService.langNegStrategyLookup, ["fr-FR"] + ["en-US", "fr-FR", "en", "fr"], + "en-US", + localeService.langNegStrategyLookup, + ["fr-FR"], ], - ] - } + ], + }, }; -function run_test() -{ - +function run_test() { const nl = localeService.negotiateLanguages; const json = JSON.stringify; @@ -127,8 +152,13 @@ function run_test() const supported = test[test.length - 1]; const result = nl(test[0], test[1], defaultLocale, strategy); - deepEqual(result, supported, - `\nExpected ${json(requested)} * ${json(available)} = ${json(supported)}.\n`); + deepEqual( + result, + supported, + `\nExpected ${json(requested)} * ${json(available)} = ${json( + supported + )}.\n` + ); } } } @@ -136,13 +166,13 @@ function run_test() // Verify that we error out when requested or available is not an array. for (const [req, avail] in [ [null, ["fr-FR"]], - [undefined, ["fr-FR"]], - [2, ["fr-FR"]], - ["fr-FR", ["fr-FR"]], - [["fr-FR"], null], - [["fr-FR"], undefined], - [["fr-FR"], 2], - [["fr-FR"], "fr-FR"], + [undefined, ["fr-FR"]], + [2, ["fr-FR"]], + ["fr-FR", ["fr-FR"]], + [["fr-FR"], null], + [["fr-FR"], undefined], + [["fr-FR"], 2], + [["fr-FR"], "fr-FR"], [[null], []], [[undefined], []], [[undefined], [null]], @@ -150,8 +180,11 @@ function run_test() [[null], [null]], [[[]], [[2]]], ]) { - Assert.throws(() => { - nl(req, avail); - }, err => err.result == Cr.NS_ERROR_XPC_CANT_CONVERT_PRIMITIVE_TO_ARRAY); + Assert.throws( + () => { + nl(req, avail); + }, + err => err.result == Cr.NS_ERROR_XPC_CANT_CONVERT_PRIMITIVE_TO_ARRAY + ); } } diff --git a/intl/locale/tests/unit/test_osPreferences.js b/intl/locale/tests/unit/test_osPreferences.js index e44184b665b0..6d1bb637ff55 100644 --- a/intl/locale/tests/unit/test_osPreferences.js +++ b/intl/locale/tests/unit/test_osPreferences.js @@ -2,11 +2,10 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -function run_test() -{ - const osprefs = - Cc["@mozilla.org/intl/ospreferences;1"] - .getService(Ci.mozIOSPreferences); +function run_test() { + const osprefs = Cc["@mozilla.org/intl/ospreferences;1"].getService( + Ci.mozIOSPreferences + ); const systemLocale = osprefs.systemLocale; Assert.ok(systemLocale != "", "systemLocale is non-empty"); @@ -14,8 +13,10 @@ function run_test() const systemLocales = osprefs.systemLocales; Assert.ok(Array.isArray(systemLocales), "systemLocales returns an array"); - Assert.ok(systemLocale == systemLocales[0], - "systemLocale matches first entry in systemLocales"); + Assert.ok( + systemLocale == systemLocales[0], + "systemLocale matches first entry in systemLocales" + ); const rgLocales = osprefs.regionalPrefsLocales; Assert.ok(Array.isArray(rgLocales), "regionalPrefsLocales returns an array"); @@ -31,8 +32,10 @@ function run_test() const test = getDateTimePatternTests[i]; const pattern = osprefs.getDateTimePattern(...test); - if (test[0] !== osprefs.dateTimeFormatStyleNone && - test[1] !== osprefs.dateTImeFormatStyleNone) { + if ( + test[0] !== osprefs.dateTimeFormatStyleNone && + test[1] !== osprefs.dateTImeFormatStyleNone + ) { Assert.greater(pattern.length, 0, "pattern is not empty."); } } diff --git a/intl/locale/tests/unit/test_pluralForm.js b/intl/locale/tests/unit/test_pluralForm.js index 187808460c18..a5c486327c8b 100644 --- a/intl/locale/tests/unit/test_pluralForm.js +++ b/intl/locale/tests/unit/test_pluralForm.js @@ -7,691 +7,6113 @@ * match up in functionality. */ -const {PluralForm} = ChromeUtils.import("resource://gre/modules/PluralForm.jsm"); +const { PluralForm } = ChromeUtils.import( + "resource://gre/modules/PluralForm.jsm" +); -function run_test() -{ - let allExpect = [[ - // 0: Chinese 0-9, 10-19, ..., 90-99 - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - // 100-109, 110-119, ..., 190-199 - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - // 200-209, 210-219, ..., 290-299 - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1, - ], [ - // 1: English 0-9, 10-19, ..., 90-99 - 2,1,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - // 100-109, 110-119, ..., 190-199 - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - // 200-209, 210-219, ..., 290-299 - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - ], [ - // 2: French 0-9, 10-19, ..., 90-99 - 1,1,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - // 100-109, 110-119, ..., 190-199 - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - // 200-209, 210-219, ..., 290-299 - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - ], [ - // 3: Latvian 0-9, 10-19, ..., 90-99 - 1,2,3,3,3,3,3,3,3,3, - 1,3,3,3,3,3,3,3,3,3, - 1,2,3,3,3,3,3,3,3,3, - 1,2,3,3,3,3,3,3,3,3, - 1,2,3,3,3,3,3,3,3,3, - 1,2,3,3,3,3,3,3,3,3, - 1,2,3,3,3,3,3,3,3,3, - 1,2,3,3,3,3,3,3,3,3, - 1,2,3,3,3,3,3,3,3,3, - 1,2,3,3,3,3,3,3,3,3, - // 100-109, 110-119, ..., 190-199 - 1,2,3,3,3,3,3,3,3,3, - 1,3,3,3,3,3,3,3,3,3, - 1,2,3,3,3,3,3,3,3,3, - 1,2,3,3,3,3,3,3,3,3, - 1,2,3,3,3,3,3,3,3,3, - 1,2,3,3,3,3,3,3,3,3, - 1,2,3,3,3,3,3,3,3,3, - 1,2,3,3,3,3,3,3,3,3, - 1,2,3,3,3,3,3,3,3,3, - 1,2,3,3,3,3,3,3,3,3, - // 200-209, 210-219, ..., 290-299 - 1,2,3,3,3,3,3,3,3,3, - 1,3,3,3,3,3,3,3,3,3, - 1,2,3,3,3,3,3,3,3,3, - 1,2,3,3,3,3,3,3,3,3, - 1,2,3,3,3,3,3,3,3,3, - 1,2,3,3,3,3,3,3,3,3, - 1,2,3,3,3,3,3,3,3,3, - 1,2,3,3,3,3,3,3,3,3, - 1,2,3,3,3,3,3,3,3,3, - 1,2,3,3,3,3,3,3,3,3, - ], [ - // 4: Scottish Gaelic 0-9, 10-19, ..., 90-99 - 4,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - // 100-109, 110-119, ..., 190-199 - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - // 200-209, 210-219, ..., 290-299 - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - ], [ - // 5: Romanian 0-9, 10-19, ..., 90-99 - 2,1,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - // 100-109, 110-119, ..., 190-199 - 3,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - // 200-209, 210-219, ..., 290-299 - 3,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - ], [ - // 6: Lithuanian 0-9, 10-19, ..., 90-99 - 2,1,3,3,3,3,3,3,3,3, - 2,2,2,2,2,2,2,2,2,2, - 2,1,3,3,3,3,3,3,3,3, - 2,1,3,3,3,3,3,3,3,3, - 2,1,3,3,3,3,3,3,3,3, - 2,1,3,3,3,3,3,3,3,3, - 2,1,3,3,3,3,3,3,3,3, - 2,1,3,3,3,3,3,3,3,3, - 2,1,3,3,3,3,3,3,3,3, - 2,1,3,3,3,3,3,3,3,3, - // 100-109, 110-119, ..., 190-199 - 2,1,3,3,3,3,3,3,3,3, - 2,2,2,2,2,2,2,2,2,2, - 2,1,3,3,3,3,3,3,3,3, - 2,1,3,3,3,3,3,3,3,3, - 2,1,3,3,3,3,3,3,3,3, - 2,1,3,3,3,3,3,3,3,3, - 2,1,3,3,3,3,3,3,3,3, - 2,1,3,3,3,3,3,3,3,3, - 2,1,3,3,3,3,3,3,3,3, - 2,1,3,3,3,3,3,3,3,3, - // 200-209, 210-219, ..., 290-299 - 2,1,3,3,3,3,3,3,3,3, - 2,2,2,2,2,2,2,2,2,2, - 2,1,3,3,3,3,3,3,3,3, - 2,1,3,3,3,3,3,3,3,3, - 2,1,3,3,3,3,3,3,3,3, - 2,1,3,3,3,3,3,3,3,3, - 2,1,3,3,3,3,3,3,3,3, - 2,1,3,3,3,3,3,3,3,3, - 2,1,3,3,3,3,3,3,3,3, - 2,1,3,3,3,3,3,3,3,3, - ], [ - // 7: Russian 0-9, 10-19, ..., 90-99 - 3,1,2,2,2,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - // 100-109, 110-119, ..., 190-199 - 3,1,2,2,2,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - // 200-209, 210-219, ..., 290-299 - 3,1,2,2,2,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - ], [ - // 8: Slovak 0-9, 10-19, ..., 90-99 - 3,1,2,2,2,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - // 100-109, 110-119, ..., 190-199 - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - // 200-209, 210-219, ..., 290-299 - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - ], [ - // 9: Polish 0-9, 10-19, ..., 90-99 - 3,1,2,2,2,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,2,2,2,3,3,3,3,3, - 3,3,2,2,2,3,3,3,3,3, - 3,3,2,2,2,3,3,3,3,3, - 3,3,2,2,2,3,3,3,3,3, - 3,3,2,2,2,3,3,3,3,3, - 3,3,2,2,2,3,3,3,3,3, - 3,3,2,2,2,3,3,3,3,3, - 3,3,2,2,2,3,3,3,3,3, - // 100-109, 110-119, ..., 190-199 - 3,3,2,2,2,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,2,2,2,3,3,3,3,3, - 3,3,2,2,2,3,3,3,3,3, - 3,3,2,2,2,3,3,3,3,3, - 3,3,2,2,2,3,3,3,3,3, - 3,3,2,2,2,3,3,3,3,3, - 3,3,2,2,2,3,3,3,3,3, - 3,3,2,2,2,3,3,3,3,3, - 3,3,2,2,2,3,3,3,3,3, - // 200-209, 210-219, ..., 290-299 - 3,3,2,2,2,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,3,2,2,2,3,3,3,3,3, - 3,3,2,2,2,3,3,3,3,3, - 3,3,2,2,2,3,3,3,3,3, - 3,3,2,2,2,3,3,3,3,3, - 3,3,2,2,2,3,3,3,3,3, - 3,3,2,2,2,3,3,3,3,3, - 3,3,2,2,2,3,3,3,3,3, - 3,3,2,2,2,3,3,3,3,3, - ], [ - // 10: Slovenian 0-9, 10-19, ..., 90-99 - 4,1,2,3,3,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - // 100-109, 110-119, ..., 190-199 - 4,1,2,3,3,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - // 200-209, 210-219, ..., 290-299 - 4,1,2,3,3,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - ], [ - // 11: Irish Gaeilge 0-9, 10-19, ..., 90-99 - 5,1,2,3,3,3,3,4,4,4, - 4,5,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5, - // 100-109, 110-119, ..., 190-199 - 5,5,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5, - // 200-209, 210-219, ..., 290-299 - 5,5,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5, - 5,5,5,5,5,5,5,5,5,5, - ], [ - // 12: Arabic 0-9, 10-19, ..., 90-99 - 6,1,2,3,3,3,3,3,3,3, - 3,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - // 100-109, 110-119, ..., 190-199 - 5,5,5,3,3,3,3,3,3,3, - 3,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - // 200-209, 210-219, ..., 290-299 - 5,5,5,3,3,3,3,3,3,3, - 3,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - ], [ - // 13: Maltese 0-9, 10-19, ..., 90-99 - 2,1,2,2,2,2,2,2,2,2, - 2,3,3,3,3,3,3,3,3,3, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - // 100-109, 110-119, ..., 190-199 - 4,2,2,2,2,2,2,2,2,2, - 2,3,3,3,3,3,3,3,3,3, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - // 200-209, 210-219, ..., 290-299 - 4,2,2,2,2,2,2,2,2,2, - 2,3,3,3,3,3,3,3,3,3, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - 4,4,4,4,4,4,4,4,4,4, - ], [ - // 14: Unused 0-9, 10-19, ..., 90-99 - 3,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - // 100-109, 110-119, ..., 190-199 - 3,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - // 200-209, 210-219, ..., 290-299 - 3,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - 3,1,2,3,3,3,3,3,3,3, - ], [ - // 15: Icelandic, Macedonian 0-9, 10-19, ..., 90-99 - 2,1,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,1,2,2,2,2,2,2,2,2, - 2,1,2,2,2,2,2,2,2,2, - 2,1,2,2,2,2,2,2,2,2, - 2,1,2,2,2,2,2,2,2,2, - 2,1,2,2,2,2,2,2,2,2, - 2,1,2,2,2,2,2,2,2,2, - 2,1,2,2,2,2,2,2,2,2, - 2,1,2,2,2,2,2,2,2,2, - // 100-109, 110-119, ..., 190-199 - 2,1,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,1,2,2,2,2,2,2,2,2, - 2,1,2,2,2,2,2,2,2,2, - 2,1,2,2,2,2,2,2,2,2, - 2,1,2,2,2,2,2,2,2,2, - 2,1,2,2,2,2,2,2,2,2, - 2,1,2,2,2,2,2,2,2,2, - 2,1,2,2,2,2,2,2,2,2, - 2,1,2,2,2,2,2,2,2,2, - // 200-209, 210-219, ..., 290-299 - 2,1,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,1,2,2,2,2,2,2,2,2, - 2,1,2,2,2,2,2,2,2,2, - 2,1,2,2,2,2,2,2,2,2, - 2,1,2,2,2,2,2,2,2,2, - 2,1,2,2,2,2,2,2,2,2, - 2,1,2,2,2,2,2,2,2,2, - 2,1,2,2,2,2,2,2,2,2, - 2,1,2,2,2,2,2,2,2,2, - ], [ - // 16: Breton 0-9, 10-19, ..., 90-99 - 5,1,2,3,3,5,5,5,5,3, - 5,5,5,5,5,5,5,5,5,5, - 5,1,2,3,3,5,5,5,5,3, - 5,1,2,3,3,5,5,5,5,3, - 5,1,2,3,3,5,5,5,5,3, - 5,1,2,3,3,5,5,5,5,3, - 5,1,2,3,3,5,5,5,5,3, - 5,5,5,5,5,5,5,5,5,5, - 5,1,2,3,3,5,5,5,5,3, - 5,5,5,5,5,5,5,5,5,5, - // 100-109, 110-119, ..., 190-199 - 5,1,2,3,3,5,5,5,5,3, - 5,5,5,5,5,5,5,5,5,5, - 5,1,2,3,3,5,5,5,5,3, - 5,1,2,3,3,5,5,5,5,3, - 5,1,2,3,3,5,5,5,5,3, - 5,1,2,3,3,5,5,5,5,3, - 5,1,2,3,3,5,5,5,5,3, - 5,5,5,5,5,5,5,5,5,5, - 5,1,2,3,3,5,5,5,5,3, - 5,5,5,5,5,5,5,5,5,5, - // 200-209, 210-219, ..., 290-299 - 5,1,2,3,3,5,5,5,5,3, - 5,5,5,5,5,5,5,5,5,5, - 5,1,2,3,3,5,5,5,5,3, - 5,1,2,3,3,5,5,5,5,3, - 5,1,2,3,3,5,5,5,5,3, - 5,1,2,3,3,5,5,5,5,3, - 5,1,2,3,3,5,5,5,5,3, - 5,5,5,5,5,5,5,5,5,5, - 5,1,2,3,3,5,5,5,5,3, - 5,5,5,5,5,5,5,5,5,5, - ], [ - // 17: Shuar 0-9, 10-19, ..., 90-99 - 1,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - // 100-109, 110-119, ..., 190-199 - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - // 200-209, 210-219, ..., 290-299 - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - 2,2,2,2,2,2,2,2,2,2, - ], [ - // 18: Welsh 0-9, 10-19, ..., 90-99 - 1,2,3,4,6,6,5,6,6,6, - 6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6, - // 100-109, 110-119, ..., 190-199 - 6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6, - // 200-209, 210-219, ..., 290-299 - 6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6, - 6,6,6,6,6,6,6,6,6,6, - ], [ - // 19: Slavic languages (bs, hr, sr) 0-9, 10-19, ..., 90-99 - 3,1,2,2,2,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - // 100-109, 110-119, ..., 190-199 - 3,1,2,2,2,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - // 200-209, 210-219, ..., 290-299 - 3,1,2,2,2,3,3,3,3,3, - 3,3,3,3,3,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - 3,1,2,2,2,3,3,3,3,3, - ]]; +function run_test() { + let allExpect = [ + [ + // 0: Chinese 0-9, 10-19, ..., 90-99 + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + // 100-109, 110-119, ..., 190-199 + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + // 200-209, 210-219, ..., 290-299 + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + ], + [ + // 1: English 0-9, 10-19, ..., 90-99 + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + // 100-109, 110-119, ..., 190-199 + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + // 200-209, 210-219, ..., 290-299 + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + ], + [ + // 2: French 0-9, 10-19, ..., 90-99 + 1, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + // 100-109, 110-119, ..., 190-199 + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + // 200-209, 210-219, ..., 290-299 + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + ], + [ + // 3: Latvian 0-9, 10-19, ..., 90-99 + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + // 100-109, 110-119, ..., 190-199 + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + // 200-209, 210-219, ..., 290-299 + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + ], + [ + // 4: Scottish Gaelic 0-9, 10-19, ..., 90-99 + 4, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + // 100-109, 110-119, ..., 190-199 + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + // 200-209, 210-219, ..., 290-299 + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + ], + [ + // 5: Romanian 0-9, 10-19, ..., 90-99 + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + // 100-109, 110-119, ..., 190-199 + 3, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + // 200-209, 210-219, ..., 290-299 + 3, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + ], + [ + // 6: Lithuanian 0-9, 10-19, ..., 90-99 + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + // 100-109, 110-119, ..., 190-199 + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + // 200-209, 210-219, ..., 290-299 + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 1, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + ], + [ + // 7: Russian 0-9, 10-19, ..., 90-99 + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + // 100-109, 110-119, ..., 190-199 + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + // 200-209, 210-219, ..., 290-299 + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + ], + [ + // 8: Slovak 0-9, 10-19, ..., 90-99 + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + // 100-109, 110-119, ..., 190-199 + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + // 200-209, 210-219, ..., 290-299 + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + ], + [ + // 9: Polish 0-9, 10-19, ..., 90-99 + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + // 100-109, 110-119, ..., 190-199 + 3, + 3, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + // 200-209, 210-219, ..., 290-299 + 3, + 3, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + ], + [ + // 10: Slovenian 0-9, 10-19, ..., 90-99 + 4, + 1, + 2, + 3, + 3, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + // 100-109, 110-119, ..., 190-199 + 4, + 1, + 2, + 3, + 3, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + // 200-209, 210-219, ..., 290-299 + 4, + 1, + 2, + 3, + 3, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + ], + [ + // 11: Irish Gaeilge 0-9, 10-19, ..., 90-99 + 5, + 1, + 2, + 3, + 3, + 3, + 3, + 4, + 4, + 4, + 4, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + // 100-109, 110-119, ..., 190-199 + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + // 200-209, 210-219, ..., 290-299 + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + ], + [ + // 12: Arabic 0-9, 10-19, ..., 90-99 + 6, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + // 100-109, 110-119, ..., 190-199 + 5, + 5, + 5, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + // 200-209, 210-219, ..., 290-299 + 5, + 5, + 5, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + ], + [ + // 13: Maltese 0-9, 10-19, ..., 90-99 + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + // 100-109, 110-119, ..., 190-199 + 4, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + // 200-209, 210-219, ..., 290-299 + 4, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + 4, + ], + [ + // 14: Unused 0-9, 10-19, ..., 90-99 + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + // 100-109, 110-119, ..., 190-199 + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + // 200-209, 210-219, ..., 290-299 + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + ], + [ + // 15: Icelandic, Macedonian 0-9, 10-19, ..., 90-99 + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + // 100-109, 110-119, ..., 190-199 + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + // 200-209, 210-219, ..., 290-299 + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + ], + [ + // 16: Breton 0-9, 10-19, ..., 90-99 + 5, + 1, + 2, + 3, + 3, + 5, + 5, + 5, + 5, + 3, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 1, + 2, + 3, + 3, + 5, + 5, + 5, + 5, + 3, + 5, + 1, + 2, + 3, + 3, + 5, + 5, + 5, + 5, + 3, + 5, + 1, + 2, + 3, + 3, + 5, + 5, + 5, + 5, + 3, + 5, + 1, + 2, + 3, + 3, + 5, + 5, + 5, + 5, + 3, + 5, + 1, + 2, + 3, + 3, + 5, + 5, + 5, + 5, + 3, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 1, + 2, + 3, + 3, + 5, + 5, + 5, + 5, + 3, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + // 100-109, 110-119, ..., 190-199 + 5, + 1, + 2, + 3, + 3, + 5, + 5, + 5, + 5, + 3, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 1, + 2, + 3, + 3, + 5, + 5, + 5, + 5, + 3, + 5, + 1, + 2, + 3, + 3, + 5, + 5, + 5, + 5, + 3, + 5, + 1, + 2, + 3, + 3, + 5, + 5, + 5, + 5, + 3, + 5, + 1, + 2, + 3, + 3, + 5, + 5, + 5, + 5, + 3, + 5, + 1, + 2, + 3, + 3, + 5, + 5, + 5, + 5, + 3, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 1, + 2, + 3, + 3, + 5, + 5, + 5, + 5, + 3, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + // 200-209, 210-219, ..., 290-299 + 5, + 1, + 2, + 3, + 3, + 5, + 5, + 5, + 5, + 3, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 1, + 2, + 3, + 3, + 5, + 5, + 5, + 5, + 3, + 5, + 1, + 2, + 3, + 3, + 5, + 5, + 5, + 5, + 3, + 5, + 1, + 2, + 3, + 3, + 5, + 5, + 5, + 5, + 3, + 5, + 1, + 2, + 3, + 3, + 5, + 5, + 5, + 5, + 3, + 5, + 1, + 2, + 3, + 3, + 5, + 5, + 5, + 5, + 3, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 1, + 2, + 3, + 3, + 5, + 5, + 5, + 5, + 3, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + ], + [ + // 17: Shuar 0-9, 10-19, ..., 90-99 + 1, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + // 100-109, 110-119, ..., 190-199 + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + // 200-209, 210-219, ..., 290-299 + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + ], + [ + // 18: Welsh 0-9, 10-19, ..., 90-99 + 1, + 2, + 3, + 4, + 6, + 6, + 5, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + // 100-109, 110-119, ..., 190-199 + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + // 200-209, 210-219, ..., 290-299 + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + 6, + ], + [ + // 19: Slavic languages (bs, hr, sr) 0-9, 10-19, ..., 90-99 + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + // 100-109, 110-119, ..., 190-199 + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + // 200-209, 210-219, ..., 290-299 + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 1, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + ], + ]; for (let [rule, expect] of allExpect.entries()) { print("\nTesting rule #" + rule); @@ -704,13 +6126,24 @@ function run_test() // Make a string of numbers, e.g., 1;2;3;4;5 let words = []; - for (let i = 1; i <= maxExpect; i++) + for (let i = 1; i <= maxExpect; i++) { words.push(i); + } words = words.join(";"); // Make sure we get the expected number for (let [index, number] of expect.entries()) { - print(["Plural form of ", index, " should be ", number, " (", words, ")"].join("")); + print( + [ + "Plural form of ", + index, + " should be ", + number, + " (", + words, + ")", + ].join("") + ); Assert.equal(get(index, words), number); } } diff --git a/intl/locale/tests/unit/test_pluralForm_english.js b/intl/locale/tests/unit/test_pluralForm_english.js index aafb45299b9c..1e4cbf12abe9 100644 --- a/intl/locale/tests/unit/test_pluralForm_english.js +++ b/intl/locale/tests/unit/test_pluralForm_english.js @@ -7,16 +7,21 @@ * development), English, is working for the PluralForm javascript module. */ -const {PluralForm} = ChromeUtils.import("resource://gre/modules/PluralForm.jsm"); +const { PluralForm } = ChromeUtils.import( + "resource://gre/modules/PluralForm.jsm" +); -function run_test() -{ +function run_test() { // English has 2 plural forms Assert.equal(2, PluralForm.numForms()); // Make sure for good inputs, things work as expected - for (var num = 0; num <= 200; num++) - Assert.equal(num == 1 ? "word" : "words", PluralForm.get(num, "word;words")); + for (var num = 0; num <= 200; num++) { + Assert.equal( + num == 1 ? "word" : "words", + PluralForm.get(num, "word;words") + ); + } // Not having enough plural forms defaults to the first form Assert.equal("word", PluralForm.get(2, "word")); diff --git a/intl/locale/tests/unit/test_pluralForm_makeGetter.js b/intl/locale/tests/unit/test_pluralForm_makeGetter.js index 0331c936abdf..a5478d38e67e 100644 --- a/intl/locale/tests/unit/test_pluralForm_makeGetter.js +++ b/intl/locale/tests/unit/test_pluralForm_makeGetter.js @@ -8,10 +8,11 @@ * development), English. */ -const {PluralForm} = ChromeUtils.import("resource://gre/modules/PluralForm.jsm"); +const { PluralForm } = ChromeUtils.import( + "resource://gre/modules/PluralForm.jsm" +); -function run_test() -{ +function run_test() { // Irish is plural rule #11 let [get, numForms] = PluralForm.makeGetter(11); @@ -22,8 +23,9 @@ function run_test() let words = "is 1;is 2;is 3-6;is 7-10;everything else"; let test = function(text, low, high) { - for (let num = low; num <= high; num++) + for (let num = low; num <= high; num++) { Assert.equal(text, get(num, words)); + } }; // Make sure for good inputs, things work as expected diff --git a/intl/strres/tests/unit/test_bug378839.js b/intl/strres/tests/unit/test_bug378839.js index b0ee6594e4e4..8d216a1cc8c4 100644 --- a/intl/strres/tests/unit/test_bug378839.js +++ b/intl/strres/tests/unit/test_bug378839.js @@ -26,39 +26,36 @@ const name_hello = "hello"; const var_hello = "World"; const value_hello = "Hello World"; // tests formatStringFromName with parameter - function run_test() { - var StringBundle = - Cc["@mozilla.org/intl/stringbundle;1"] - .getService(Ci.nsIStringBundleService); - var ios = Cc["@mozilla.org/network/io-service;1"] - .getService(Ci.nsIIOService); - var bundleURI = ios.newFileURI(do_get_file("strres.properties")); + var StringBundle = Cc["@mozilla.org/intl/stringbundle;1"].getService( + Ci.nsIStringBundleService + ); + var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService); + var bundleURI = ios.newFileURI(do_get_file("strres.properties")); - var bundle = StringBundle.createBundle(bundleURI.spec); + var bundle = StringBundle.createBundle(bundleURI.spec); - var bundle_file = bundle.GetStringFromName(name_file); - Assert.equal(bundle_file, value_file); + var bundle_file = bundle.GetStringFromName(name_file); + Assert.equal(bundle_file, value_file); - var bundle_loyal = bundle.GetStringFromName(name_loyal); - Assert.equal(bundle_loyal, value_loyal); + var bundle_loyal = bundle.GetStringFromName(name_loyal); + Assert.equal(bundle_loyal, value_loyal); - var bundle_trout = bundle.GetStringFromName(name_trout); - Assert.equal(bundle_trout, value_trout); + var bundle_trout = bundle.GetStringFromName(name_trout); + Assert.equal(bundle_trout, value_trout); - var bundle_edit = bundle.GetStringFromName(name_edit); - Assert.equal(bundle_edit, value_edit); + var bundle_edit = bundle.GetStringFromName(name_edit); + Assert.equal(bundle_edit, value_edit); - var bundle_view = bundle.GetStringFromName(name_view); - Assert.equal(bundle_view, value_view); + var bundle_view = bundle.GetStringFromName(name_view); + Assert.equal(bundle_view, value_view); - var bundle_go = bundle.GetStringFromName(name_go); - Assert.equal(bundle_go, value_go); + var bundle_go = bundle.GetStringFromName(name_go); + Assert.equal(bundle_go, value_go); - var bundle_message = bundle.GetStringFromName(name_message); - Assert.equal(bundle_message, value_message); + var bundle_message = bundle.GetStringFromName(name_message); + Assert.equal(bundle_message, value_message); - var bundle_hello = bundle.formatStringFromName(name_hello, [var_hello]); - Assert.equal(bundle_hello, value_hello); + var bundle_hello = bundle.formatStringFromName(name_hello, [var_hello]); + Assert.equal(bundle_hello, value_hello); } - diff --git a/intl/strres/tests/unit/test_bug397093.js b/intl/strres/tests/unit/test_bug397093.js index 26eb86d3d0ce..d9f27af1edf7 100644 --- a/intl/strres/tests/unit/test_bug397093.js +++ b/intl/strres/tests/unit/test_bug397093.js @@ -13,31 +13,30 @@ const value_utf8 = ""; const name_latin1 = "latin1"; const value_latin1 = ""; - function run_test() { - var StringBundle = - Cc["@mozilla.org/intl/stringbundle;1"] - .getService(Ci.nsIStringBundleService); - var ios = Cc["@mozilla.org/network/io-service;1"] - .getService(Ci.nsIIOService); - var bundleURI = ios.newFileURI(do_get_file("397093.properties")); + var StringBundle = Cc["@mozilla.org/intl/stringbundle;1"].getService( + Ci.nsIStringBundleService + ); + var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService); + var bundleURI = ios.newFileURI(do_get_file("397093.properties")); - var bundle = StringBundle.createBundle(bundleURI.spec); - - var bundle_ascii="", bundle_utf8="", bundle_latin1=""; - try { - bundle_ascii = bundle.GetStringFromName(name_ascii); - } catch(e) {} - Assert.equal(bundle_ascii, value_ascii); + var bundle = StringBundle.createBundle(bundleURI.spec); - try { - bundle_utf8 = bundle.GetStringFromName(name_utf8); - } catch(e) {} - Assert.equal(bundle_utf8, value_utf8); + var bundle_ascii = "", + bundle_utf8 = "", + bundle_latin1 = ""; + try { + bundle_ascii = bundle.GetStringFromName(name_ascii); + } catch (e) {} + Assert.equal(bundle_ascii, value_ascii); - try { - bundle_latin1 = bundle.GetStringFromName(name_latin1); - } catch(e) {} - Assert.equal(bundle_latin1, value_latin1); + try { + bundle_utf8 = bundle.GetStringFromName(name_utf8); + } catch (e) {} + Assert.equal(bundle_utf8, value_utf8); + + try { + bundle_latin1 = bundle.GetStringFromName(name_latin1); + } catch (e) {} + Assert.equal(bundle_latin1, value_latin1); } -