/external/icu/tools/cldr/cldr-to-icu/src/main/java/org/unicode/icu/tool/cldrtoicu/ |
D | IcuData.java | 67 public void add(RbPath rbPath, String element) { in add() argument 68 add(rbPath, RbValue.of(element)); in add() 72 public void add(RbPath rbPath, RbValue rbValue) { in add() argument 73 rbPathToValues.put(rbPath, rbValue); in add() 74 paths.add(rbPath); in add() 78 public void add(RbPath rbPath, Iterable<RbValue> rbValues) { in add() argument 79 rbValues.forEach(v -> rbPathToValues.put(rbPath, v)); in add() 80 paths.add(rbPath); in add() 84 public void replace(RbPath rbPath, String element) { in replace() argument 85 rbPathToValues.removeAll(rbPath); in replace() [all …]
|
D | IcuTextWriter.java | 179 static FormatOptions forPath(RbPath rbPath) { in forPath() argument 181 !rbPath.isIntPath() && !rbPath.isBinPath(), in forPath() 182 !rbPath.endsWith(RB_SEQUENCE) && !rbPath.isBinPath(), in forPath() 183 !rbPath.isBinPath()); in forPath() 200 String icuDataName, RbPath rbPath, List<RbValue> values, PrintWriter out) { in appendValues() argument 204 FormatOptions format = FormatOptions.forPath(rbPath); in appendValues() 205 if (values.size() == 1 && !mustBeArray(true, icuDataName, rbPath)) { in appendValues() 207 if (onlyValue.isSingleton() && !mustBeArray(false, icuDataName, rbPath)) { in appendValues() 217 int maxWidth = Math.max(68, 80 - Math.min(4, rbPath.length()) * INDENT.length()); in appendValues() 265 private static boolean mustBeArray(boolean topValues, String name, RbPath rbPath) { in mustBeArray() argument [all …]
|
/external/icu/tools/cldr/cldr-to-icu/src/main/java/org/unicode/icu/tool/cldrtoicu/mapper/ |
D | LocaleMapper.java | 84 RbPath rbPath = result.getKey(); in collectResultPath() local 85 validRbPaths.add(rbPath); in collectResultPath() 86 if (rbPath.isAnonymous()) { in collectResultPath() 87 RbPath parent = rbPath.getParent(); in collectResultPath() 88 checkState(!parent.isAnonymous(), "anonymous paths must not be nested: %s", rbPath); in collectResultPath() 116 for (RbPath rbPath : icuData.getPaths()) { in doDateTimeHack() 117 if (rbPath.length() == 3 in doDateTimeHack() 118 && rbPath.getSegment(0).equals("calendar") in doDateTimeHack() 119 && rbPath.getSegment(2).equals("DateTimePatterns")) { in doDateTimeHack() 121 List<RbValue> valuesToHack = icuData.get(rbPath); in doDateTimeHack() [all …]
|
D | AbstractPathValueMapper.java | 125 for (RbPath rbPath : resultsByRbPath.keySet()) { in finalizeResults() 126 Set<Result> existingResults = resultsByRbPath.get(rbPath); in finalizeResults() 127 out.putAll(rbPath, existingResults); in finalizeResults() 128 for (Result fallback : transformer.getFallbackResultsFor(rbPath, this::getVarsFn)) { in finalizeResults() 130 out.put(rbPath, fallback); in finalizeResults() 156 for (RbPath rbPath : results.keySet()) { in addResultsToIcuData() 157 for (Result r : results.get(rbPath)) { in addResultsToIcuData() 160 map.put(rbPath, ValueOrAlias.value(RbValue.of(r.getValues()))); in addResultsToIcuData() 161 } else if (rbPath.isAlias()) { in addResultsToIcuData() 169 map.put(rbPath, ValueOrAlias.value(Iterables.getOnlyElement(r.getValues()))); in addResultsToIcuData() [all …]
|
D | SupplementalMapper.java | 84 RbPath rbPath = r.getKey(); in collectResult() local 85 if (rbPath.contains(RB_FIFO)) { in collectResult() 87 rbPath = rbPath.mapSegments( in collectResult() 90 addResult(rbPath, r); in collectResult()
|
D | CollationMapper.java | 99 RbPath rbPath = RbPath.of("collations", type, "Sequence"); in collectRule() local 111 if (isShort || !icuData.getPaths().contains(rbPath)) { in collectRule() 116 icuData.replace(rbPath, rules); in collectRule() 140 RbPath rbPath = RbPath.of( in maybeAddSpecial() local 143 icuData.add(rbPath, key.valueFrom(value)); in maybeAddSpecial()
|
D | RbnfMapper.java | 75 private final RbPath rbPath; field in RbnfMapper.Ruleset 81 this.rbPath = RB_ROOT.extendBy(GROUPING_TYPE.valueFrom(prefix)); in Ruleset() 92 icuData.add(rbPath, (isPrivate ? "%%" : "%") + rulesetType + ":"); in addRule() 101 icuData.add(rbPath, rulePrefix + ESCAPE_RBNF_DATA.escape(value.getValue())); in addRule()
|
/external/icu/tools/cldr/cldr-to-icu/src/test/java/org/unicode/icu/tool/cldrtoicu/regex/ |
D | RegexTransformerTest.java | 289 RbPath rbPath = RbPath.of("Currencies", "Foo"); in testFallbacks_simple() local 290 ImmutableList<Result> fallbacks = transformer.getFallbackResultsFor(rbPath, p -> null); in testFallbacks_simple() 294 assertThat(fallbacks.get(0)).hasKey(rbPath); in testFallbacks_simple() 296 assertThat(fallbacks.get(1)).hasKey(rbPath); in testFallbacks_simple() 325 RbPath rbPath = RbPath.of("fake", "two", "four", "one", "three"); in testFallbacks_multipleArgs() local 332 transformer.getFallbackResultsFor(rbPath, p -> null), in testFallbacks_multipleArgs() 333 rbPath, in testFallbacks_multipleArgs() local 344 RbPath rbPath = RbPath.of("fake", "Foo", "Bar"); in testFallbacks_valueSplitting() local 345 ImmutableList<Result> fallbacks = transformer.getFallbackResultsFor(rbPath, p -> null); in testFallbacks_valueSplitting() 346 assertSingleResult(fallbacks, rbPath, "Foo", "and", "Bar"); in testFallbacks_valueSplitting() [all …]
|
/external/icu/tools/cldr/cldr-to-icu/src/test/java/org/unicode/icu/tool/cldrtoicu/testing/ |
D | IcuDataSubject.java | 35 public void hasEmptyValue(String rbPath) { in hasEmptyValue() argument 36 hasValuesFor(rbPath, RbValue.of("")); in hasEmptyValue() 39 public void hasValuesFor(String rbPath, String... values) { in hasValuesFor() argument 40 hasValuesFor(rbPath, RbValue.of(values)); in hasValuesFor() 43 public void hasValuesFor(String rbPath, RbValue... values) { in hasValuesFor() argument 44 hasValuesFor(RbPath.parse(rbPath), values); in hasValuesFor()
|
/external/icu/tools/cldr/cldr-to-icu/src/main/java/org/unicode/icu/tool/cldrtoicu/regex/ |
D | ResultSpec.java | 301 RbPath rbPath, DynamicVars varFn, Pattern rbPathMatcher, VarString fallbackSpec) { in getFallbackResult() argument 303 Matcher matcher = rbPathMatcher.matcher(rbPath.toString()); in getFallbackResult() 323 return Optional.of(new FallbackResult(rbPath, values)); in getFallbackResult() 491 FallbackResult(RbPath rbPath, Iterable<String> values) { 492 super(rbPath, values, Optional.empty()); 567 private static int getSplitArgIndex(String rbPath) { in getSplitArgIndex() argument 569 Matcher matcher = ARGUMENT.matcher(rbPath); in getSplitArgIndex() 571 char startChar = rbPath.charAt(matcher.start()); in getSplitArgIndex() 572 char endChar = rbPath.charAt(matcher.end() - 1); in getSplitArgIndex()
|
D | RegexTransformer.java | 135 public ImmutableList<Result> getFallbackResultsFor(RbPath rbPath, DynamicVars varLookupFn) { in getFallbackResultsFor() argument 137 .map(f -> f.apply(rbPath, varLookupFn)) in getFallbackResultsFor()
|
/external/icu/tools/cldr/cldr-to-icu/src/test/java/org/unicode/icu/tool/cldrtoicu/ |
D | IcuDataTest.java | 47 RbPath rbPath = RbPath.of("Version"); in testSetVersion() local 48 assertThat(icuData.getPaths()).containsExactly(rbPath); in testSetVersion() 49 assertThat(icuData.get(rbPath)).isEqualTo(ImmutableList.of(RbValue.of("VERSION"))); in testSetVersion()
|
/external/icu/tools/cldr/cldr-to-icu/src/test/java/org/unicode/icu/tool/cldrtoicu/localedistance/ |
D | LocaleDistanceMapperTest.java | 271 RbPath rbPath = RbPath.parse(path); in getBytes() local 272 … checkArgument(rbPath.isBinPath(), "only binary paths (:bin) should have binary data: %s", path); in getBytes() 273 List<RbValue> rbValues = icuData.get(rbPath); in getBytes() 274 checkArgument(rbValues != null, "missing value for: %s", rbPath); in getBytes()
|