/third_party/icu/tools/cldr/cldr-to-icu/src/test/java/org/unicode/icu/tool/cldrtoicu/ |
D | IcuDataTest.java | 18 IcuData icuData = new IcuData("icu-name", true); in testSimple() local 19 assertThat(icuData.getName()).isEqualTo("icu-name"); in testSimple() 20 assertThat(icuData.hasFallback()).isTrue(); in testSimple() 29 IcuData icuData = new IcuData("icu-name", false); in testFileComment() local 30 assertThat(icuData.getFileComment()).isEmpty(); in testFileComment() 32 icuData.setFileComment("Hello", "World"); in testFileComment() 33 assertThat(icuData.getFileComment()).containsExactly("Hello", "World").inOrder(); in testFileComment() 35 icuData.setFileComment(Arrays.asList("Foo", "Bar")); in testFileComment() 36 assertThat(icuData.getFileComment()).containsExactly("Foo", "Bar").inOrder(); in testFileComment() 38 icuData.setFileComment(ImmutableList.of()); in testFileComment() [all …]
|
/third_party/icu/tools/cldr/cldr-to-icu/src/test/java/org/unicode/icu/tool/cldrtoicu/mapper/ |
D | PluralsMapperTest.java | 67 IcuData icuData = PluralsMapper.process(cldrData); in testSimple() local 69 assertThat(icuData).hasName("plurals"); in testSimple() 70 assertThat(icuData).hasFallback(false); in testSimple() 73 assertThat(icuData).hasValuesFor("/locales/en_GB", "set0"); in testSimple() 74 assertThat(icuData).hasValuesFor("/locales/en_NZ", "set0"); in testSimple() 75 assertThat(icuData).hasValuesFor("/locales_ordinals/en_GB", "set1"); in testSimple() 76 assertThat(icuData).hasValuesFor("/locales_ordinals/en_NZ", "set1"); in testSimple() 78 assertThat(icuData).hasValuesFor("/rules/set0/zero", "!zero!"); in testSimple() 79 assertThat(icuData).hasValuesFor("/rules/set0/one", "!one!"); in testSimple() 80 assertThat(icuData).hasValuesFor("/rules/set0/two", "!two!"); in testSimple() [all …]
|
D | DayPeriodsMapperTest.java | 61 IcuData icuData = DayPeriodsMapper.process(cldrData); in testSimple() local 63 assertThat(icuData).hasName("dayPeriods"); in testSimple() 64 assertThat(icuData).hasFallback(false); in testSimple() 65 assertThat(icuData).hasValuesFor("/locales/en_AU", "set1"); in testSimple() 66 assertThat(icuData).hasValuesFor("/locales/en_GB", "set1"); in testSimple() 67 assertThat(icuData).hasValuesFor("/locales/en_NZ", "set1"); in testSimple() 69 assertThat(icuData).hasValuesFor("/rules/set1/morning1/from", "04:00"); in testSimple() 70 assertThat(icuData).hasValuesFor("/rules/set1/morning1/before", "12:00"); in testSimple() 71 assertThat(icuData).hasValuesFor("/rules/set1/noon/at", "12:00"); in testSimple() 72 assertThat(icuData).hasValuesFor("/rules/set1/afternoon1/from", "12:00"); in testSimple() [all …]
|
D | CollationMapperTest.java | 26 IcuData icuData = new IcuData("xx", true); in testEmpty() local 27 CollationMapper.process(icuData, cldrData(), Optional.empty(), CLDR_VERSION); in testEmpty() 29 assertThat(icuData).hasName("xx"); in testEmpty() 30 assertThat(icuData).hasFallback(true); in testEmpty() 31 assertThat(icuData).getPaths().isEmpty(); in testEmpty() 49 IcuData icuData = new IcuData("xx", true); in testDefault() local 50 CollationMapper.process(icuData, cldrData, Optional.empty(), CLDR_VERSION); in testDefault() 51 assertThat(icuData).getPaths().hasSize(1); in testDefault() 52 assertThat(icuData).hasValuesFor("/collations/default", "any value"); in testDefault() 69 IcuData icuData = new IcuData("xx", true); in testLastAltRuleOverridesExisting() local [all …]
|
D | LocaleMapperTest.java | 41 IcuData icuData = process("xx"); in testSimple() local 42 assertThat(icuData).getPaths().hasSize(1); in testSimple() 43 assertThat(icuData).hasValuesFor("/durationUnits/foo", "Bar"); in testSimple() 56 IcuData icuData = process("yy"); in testCorrectLocaleIsUsed() local 57 assertThat(icuData).getPaths().hasSize(1); in testCorrectLocaleIsUsed() 58 assertThat(icuData).hasValuesFor("/durationUnits/foo", "YY"); in testCorrectLocaleIsUsed() 72 IcuData icuData = process("xx"); in testInheritedValuesNotIncludedByDefault() local 75 assertThat(icuData).getPaths().hasSize(1); in testInheritedValuesNotIncludedByDefault() 76 assertThat(icuData).hasValuesFor("/durationUnits/foo", "Bar"); in testInheritedValuesNotIncludedByDefault() 93 IcuData icuData = process("xx"); in testInheritedValuesIncludedWhenSameResourceBundle() local [all …]
|
D | TransformsMapperTest.java | 70 IcuData icuData = TransformsMapper.process(cldrData(), wrap(fileMap), HEADER_LINES); in testDefaultContent() local 74 assertThat(icuData).getPaths().hasSize(DEFAULT_PATH_COUNT); in testDefaultContent() 75 assertThat(icuData).hasValuesFor("/\"%Translit%Hex\"", "%Translit%Hex"); in testDefaultContent() 76 assertThat(icuData).hasValuesFor("/\"%Translit%UnicodeChar\"", "%Translit%UnicodeChar"); in testDefaultContent() 77 assertThat(icuData).hasValuesFor("/\"%Translit%UnicodeName\"", "%Translit%UnicodeName"); in testDefaultContent() 78 assertThat(icuData) in testDefaultContent() 80 assertThat(icuData) in testDefaultContent() 82 assertThat(icuData).hasValuesFor("TransliterateLATIN", "", ""); in testDefaultContent() 83 assertThat(icuData) in testDefaultContent() 94 IcuData icuData = TransformsMapper.process(cldrData, wrap(fileMap), HEADER_LINES); in testForward() local [all …]
|
D | AbstractPathValueMapperTest.java | 33 IcuData icuData = mapper.addIcuData("foo"); in testUngroupedConcatenation() local 35 assertThat(icuData).getPaths().hasSize(2); in testUngroupedConcatenation() 36 assertThat(icuData).hasValuesFor("foo/bar", singletonValues("one", "two", "three", "four")); in testUngroupedConcatenation() 37 assertThat(icuData).hasValuesFor("foo/baz", singletonValues("other", "path")); in testUngroupedConcatenation() 46 IcuData icuData = mapper.addIcuData("foo"); in testGrouping() local 48 assertThat(icuData).getPaths().hasSize(2); in testGrouping() 49 assertThat(icuData) in testGrouping() 51 assertThat(icuData) in testGrouping() 104 IcuData icuData = mapper.addIcuData("foo"); in testAliases_ungrouped() local 106 assertThat(icuData).getPaths().hasSize(5); in testAliases_ungrouped() [all …]
|
D | BreakIteratorMapperTest.java | 53 IcuData icuData = new IcuData("xx", true); in testSingleSuppression() local 54 BreakIteratorMapper.process(icuData, cldrData, Optional.empty()); in testSingleSuppression() 56 assertThat(icuData).getPaths().hasSize(1); in testSingleSuppression() 57 assertThat(icuData).hasValuesFor("/exceptions/SentenceBreak:array", in testSingleSuppression() 76 IcuData icuData = new IcuData("xx", true); in testMultipleSupressionTypes() local 77 BreakIteratorMapper.process(icuData, cldrData, Optional.empty()); in testMultipleSupressionTypes() 79 assertThat(icuData).getPaths().hasSize(2); in testMultipleSupressionTypes() 80 assertThat(icuData).hasValuesFor("/exceptions/SentenceBreak:array", in testMultipleSupressionTypes() 84 assertThat(icuData).hasValuesFor("/exceptions/LineBreak:array", in testMultipleSupressionTypes() 96 IcuData icuData = new IcuData("xx", true); in testSpecials_dictionary() local [all …]
|
D | Bcp47MapperTest.java | 42 ImmutableList<IcuData> icuData = Bcp47Mapper.process(cldrData); in testSimple() local 44 IcuData bcp47Data = icuData.get(0); in testSimple() 61 IcuData tzData = icuData.get(1); in testSimple() 76 ImmutableList<IcuData> icuData = Bcp47Mapper.process(cldrData); in testSimpleTimezone() local 78 IcuData bcp47Data = icuData.get(0); in testSimpleTimezone() 92 IcuData tzData = icuData.get(1); in testSimpleTimezone() 108 ImmutableList<IcuData> icuData = Bcp47Mapper.process(cldrData); in testKeyAliases() local 109 IcuData bcp47Data = icuData.get(0); in testKeyAliases() 121 ImmutableList<IcuData> icuData = Bcp47Mapper.process(cldrData); in testTypeAliases_single() local 122 IcuData bcp47Data = icuData.get(0); in testTypeAliases_single() [all …]
|
D | SupplementalMapperTest.java | 35 IcuData icuData = SupplementalMapper.process(src, transformer, "name", p -> true); in testSimple() local 37 assertThat(icuData).getPaths().hasSize(1); in testSimple() 38 assertThat(icuData).hasValuesFor("/Foo", "Bar"); in testSimple() 60 IcuData icuData = SupplementalMapper.process(src, transformer, "name", p -> true); in testFifoLabel() local 62 assertThat(icuData).getPaths().hasSize(3); in testFifoLabel() 63 assertThat(icuData).hasValuesFor("/CurrencyMap/US/<0000>/id", "USD"); in testFifoLabel() 64 assertThat(icuData).hasValuesFor("/CurrencyMap/US/<0001>/id", "USN"); in testFifoLabel() 65 assertThat(icuData).hasValuesFor("/CurrencyMap/US/<0002>/id", "USS"); in testFifoLabel() 79 IcuData icuData = SupplementalMapper.process(src, transformer, "name", filter); in testPathFilter() local 81 assertThat(icuData).getPaths().hasSize(1); in testPathFilter() [all …]
|
D | PluralRangesMapperTest.java | 49 IcuData icuData = PluralRangesMapper.process(cldrData); in testSimple() local 51 assertThat(icuData).hasName("pluralRanges"); in testSimple() 52 assertThat(icuData).hasFallback(false); in testSimple() 54 assertThat(icuData).hasValuesFor("/locales/en_GB", "set00"); in testSimple() 55 assertThat(icuData).hasValuesFor("/locales/en_NZ", "set00"); in testSimple() 59 assertThat(icuData) in testSimple() 77 IcuData icuData = PluralRangesMapper.process(cldrData); in testMultipleSets() local 79 assertThat(icuData).hasName("pluralRanges"); in testMultipleSets() 80 assertThat(icuData).hasFallback(false); in testMultipleSets() 82 assertThat(icuData).hasValuesFor("/locales/en_AU", "set00"); in testMultipleSets() [all …]
|
D | RbnfMapperTest.java | 58 IcuData icuData = new IcuData("xx", true); in testSingleRuleset() local 59 RbnfMapper.process(icuData, cldrData, Optional.empty()); in testSingleRuleset() 61 assertThat(icuData).hasValuesFor("/RBNFRules/SpelloutRules", in testSingleRuleset() 86 IcuData icuData = new IcuData("xx", true); in testMultipleRulesets() local 87 RbnfMapper.process(icuData, cldrData, Optional.empty()); in testMultipleRulesets() 89 assertThat(icuData).hasValuesFor("/RBNFRules/SpelloutRules", in testMultipleRulesets() 120 IcuData icuData = new IcuData("xx", true); in testSpecials() local 121 RbnfMapper.process(icuData, cldrData, Optional.of(specials)); in testSpecials() 123 assertThat(icuData).hasValuesFor("/RBNFRules/OrdinalRules", in testSpecials() 129 assertThat(icuData).hasValuesFor("/RBNFRules/DurationRules", in testSpecials() [all …]
|
/third_party/icu/tools/cldr/cldr-to-icu/src/main/java/org/unicode/icu/tool/cldrtoicu/mapper/ |
D | CollationMapper.java | 72 IcuData icuData, CldrData cldrData, Optional<CldrData> icuSpecialData, String cldrVersion) { in process() argument 74 CollationMapper mapper = new CollationMapper(icuData, cldrVersion); in process() 77 return icuData; in process() 80 private final IcuData icuData; field in CollationMapper 83 private CollationMapper(IcuData icuData, String cldrVersion) { in CollationMapper() argument 84 this.icuData = checkNotNull(icuData); in CollationMapper() 90 if (icuData.getName().equals("root")) { in CollationMapper() 91 icuData.replace(RB_STANDARD_SEQUENCE, ""); in CollationMapper() 93 icuData.replace(RB_STANDARD_VERSION, cldrVersion); in CollationMapper() 111 if (isShort || !icuData.getPaths().contains(rbPath)) { in collectRule() [all …]
|
D | TransformsMapper.java | 110 addSpecialCaseValues(mapper.icuData); in process() 111 return mapper.icuData; in process() 114 private final IcuData icuData = new IcuData("root", false); field in TransformsMapper 121 icuData.setFileComment("File: root.txt"); in TransformsMapper() 158 .forEach(a -> icuData.add(RB_TRANSLITERATOR_IDS.extendBy(a, "alias"), id)); in writeRootIndexEntry() 160 icuData.add(rbPrefix.extendBy("resource:process(transliterator)"), filename); in writeRootIndexEntry() 161 icuData.add(rbPrefix.extendBy("direction"), "FORWARD"); in writeRootIndexEntry() 166 .forEach(a -> icuData.add(RB_TRANSLITERATOR_IDS.extendBy(a, "alias"), id)); in writeRootIndexEntry() 168 icuData.add(rbPrefix.extendBy("resource:process(transliterator)"), filename); in writeRootIndexEntry() 169 icuData.add(rbPrefix.extendBy("direction"), "REVERSE"); in writeRootIndexEntry() [all …]
|
D | RbnfMapper.java | 57 IcuData icuData, CldrData cldrData, Optional<CldrData> icuSpecialData) { in process() argument 62 RbnfMapper mapper = new RbnfMapper(icuData); in process() 65 return mapper.icuData; in process() 68 private final IcuData icuData; field in RbnfMapper 70 private RbnfMapper(IcuData icuData) { in RbnfMapper() argument 71 this.icuData = checkNotNull(icuData); in RbnfMapper() 92 icuData.add(rbPath, (isPrivate ? "%%" : "%") + rulesetType + ":"); in addRule() 101 icuData.add(rbPath, rulePrefix + ESCAPE_RBNF_DATA.escape(value.getValue())); in addRule()
|
D | BreakIteratorMapper.java | 63 IcuData icuData, CldrData cldrData, Optional<CldrData> icuSpecialData) { in process() argument 65 BreakIteratorMapper mapper = new BreakIteratorMapper(icuData); in process() 68 return mapper.icuData; in process() 72 private final IcuData icuData; field in BreakIteratorMapper 74 private BreakIteratorMapper(IcuData icuData) { in BreakIteratorMapper() argument 75 this.icuData = checkNotNull(icuData); in BreakIteratorMapper() 81 icuData.add( in addSuppression() 97 icuData.add( in addDependency()
|
D | LocaleMapper.java | 44 IcuData icuData, in process() argument 51 new LocaleMapper(unresolved, resolved, icuSpecialData, transformer).addIcuData(icuData); in process() 52 doDateTimeHack(icuData); in process() 53 defaultCalendar.ifPresent(c -> icuData.add(RB_CALENDAR, c)); in process() 115 private static void doDateTimeHack(IcuData icuData) { in doDateTimeHack() argument 116 for (RbPath rbPath : icuData.getPaths()) { in doDateTimeHack() 121 List<RbValue> valuesToHack = icuData.get(rbPath); in doDateTimeHack()
|
D | DayPeriodsMapper.java | 57 return CLDR_PROCESSOR.process(data, new DayPeriodsMapper(), NESTED_GROUPING).icuData; in process() 61 private final IcuData icuData = new IcuData("dayPeriods", false); field in DayPeriodsMapper 77 .forEach(locale -> icuData.add(localePrefix.extendBy(locale), setName)); in prefixStart() 83 .forEach((k, v) -> icuData.add(prefix.extendBy(k.getAttributeName()), v)); in visitRule()
|
D | PluralRangesMapper.java | 61 return CLDR_PROCESSOR.process(data, new PluralRangesMapper(), NESTED_GROUPING).icuData; in process() 64 private final IcuData icuData = new IcuData("pluralRanges", false); field in PluralRangesMapper 75 .forEach(l -> icuData.add(RB_LOCALES.extendBy(l), label)); in Ranges() 82 icuData.add(RB_RULES.extendBy(label), in visitRange()
|
D | Bcp47Mapper.java | 135 private final IcuData icuData; field in Bcp47Mapper.ValueCollector 139 this.icuData = keyName.equals("tz") ? tzData : keyTypeData; in ValueCollector() 152 icuData.add(RbPath.of("bcpTypeAlias", keyName, typeName), prefName.get()); in collect() 172 icuData.add(typeMapPrefix.extendBy(typeName), ""); in collect() 175 icuData.add(typeMapPrefix.extendBy(quoteAlias(mainAlias)), typeName); in collect() 181 .forEach(a -> icuData.add(typeAliasPrefix.extendBy(a), mainAlias)); in collect()
|
D | SupplementalMapper.java | 46 IcuData icuData = new IcuData(icuName, false); in process() local 47 new SupplementalMapper(src, transformer, paths).addIcuData(icuData); in process() 48 return icuData; in process()
|
/third_party/icu/tools/cldr/cldr-to-icu/src/test/java/org/unicode/icu/tool/cldrtoicu/localedistance/ |
D | LocaleDistanceMapperTest.java | 130 IcuData icuData = LocaleDistanceMapper.process(testData); in testEndToEnd() local 132 assertThat(icuData).hasValuesFor("likely/languageAliases", "cmn", "zh"); in testEndToEnd() 133 assertThat(icuData).hasValuesFor("likely/regionAliases", "AN", "CW", "UK", "GB"); in testEndToEnd() 138 assertThat(icuData).hasValuesFor("likely/lsrs", in testEndToEnd() 149 getTrieMap(icuData, "likely/trie:bin", "*").asMultimap().inverse(); in testEndToEnd() 177 assertThat(icuData).hasValuesFor("match/paradigms", in testEndToEnd() 184 assertThat(icuData).hasValuesFor("match/partitions", in testEndToEnd() 187 ImmutableMap<String, Integer> matchTrie = getTrieMap(icuData, "match/trie:bin", "*-*"); in testEndToEnd() 188 byte[] regionLookup = getBytes(icuData, "match/regionToPartitions:bin"); in testEndToEnd() 190 icuData.get(RbPath.parse("match/partitions")).get(0).getElements(); in testEndToEnd() [all …]
|
/third_party/icu/tools/cldr/cldr-to-icu/src/main/java/org/unicode/icu/tool/cldrtoicu/ |
D | IcuTextWriter.java | 48 IcuData icuData, Path outDir, List<String> header, boolean allowOverwrite) { in writeToFile() argument 52 Path file = outDir.resolve(icuData.getName() + ".txt"); in writeToFile() 56 new IcuTextWriter(icuData).writeTo(out, header); in writeToFile() 59 throw new RuntimeException("cannot write ICU data file: " + icuData.getName(), e); in writeToFile() 63 private final IcuData icuData; field in IcuTextWriter 67 IcuTextWriter(IcuData icuData) { in IcuTextWriter() argument 68 this.icuData = checkNotNull(icuData); in IcuTextWriter() 74 writeHeaderAndComments(out, header, icuData.getFileComment()); in writeTo() 85 String root = icuData.getName(); in writeTo() 86 if (!icuData.hasFallback()) { in writeTo() [all …]
|
D | LdmlConverter.java | 303 IcuData icuData = new IcuData(id, true); in processLdml() local 308 BreakIteratorMapper.process(icuData, unresolved, specials); in processLdml() 309 CollationMapper.process(icuData, unresolved, specials, cldrVersion); in processLdml() 310 RbnfMapper.process(icuData, unresolved, specials); in processLdml() 315 icuData, unresolved, resolved, specials, localeTransformer, defaultCalendar); in processLdml() 318 for (RbPath p : icuData.getPaths()) { in processLdml() 340 IcuData splitData = new IcuData(icuData.getName(), icuData.hasFallback()); in processLdml() 344 splitPaths.get(dir).forEach(p -> splitData.add(p, icuData.get(p))); in processLdml() 548 IcuData icuData = in processSupplemental() local 554 icuData.add(RB_CLDR_VERSION, config.getVersionInfo().getCldrVersion()); in processSupplemental() [all …]
|
/third_party/icu/tools/cldr/cldr-to-icu/src/main/java/org/unicode/icu/tool/cldrtoicu/localedistance/ |
D | LocaleDistanceMapper.java | 130 IcuData icuData = new IcuData("langInfo", false); in process() local 133 icuData.add(LIKELY_LANGUAGES, ofMapEntries(likelyData.languageAliases)); in process() 134 icuData.add(LIKELY_REGIONS, ofMapEntries(likelyData.regionAliases)); in process() 135 icuData.add(LIKELY_TRIE, ofBytes(likelyData.trie)); in process() 136 icuData.add(LIKELY_LSRS, ofLsrs(asList(likelyData.lsrs))); in process() 139 icuData.add(MATCH_TRIE, ofBytes(distanceData.trie)); in process() 140 icuData.add(MATCH_REGION_TO_PARTITIONS, ofBytes(distanceData.regionToPartitionsIndex)); in process() 141 icuData.add(MATCH_PARTITIONS, RbValue.of(distanceData.partitionArrays)); in process() 142 icuData.add(MATCH_PARADIGMS, ofLsrs(distanceData.paradigmLSRs)); in process() 143 …icuData.add(MATCH_DISTANCES, RbValue.of(Arrays.stream(distanceData.distances).mapToObj(Integer::to… in process() [all …]
|