in java/de/jflex/ucd_generator/scanner/AbstractScriptExtensionsScanner.java [80:123]
private ImmutableSortedMap<String, String> getUsedPropertyValueAliases() {
ImmutableSortedMap.Builder<String, String> usedPropertyValueAliases =
ImmutableSortedMap.naturalOrder();
for (String binaryProperty : unicodeData.usedBinaryProperties()) {
for (String nameAlias : unicodeData.getPropertyAliases(binaryProperty)) {
if (!Objects.equals(nameAlias, binaryProperty)) {
usedPropertyValueAliases.put(nameAlias, binaryProperty);
}
}
}
if (unicodeData.hasUsedEnumeratedProperty(NORMALIZED_GENERAL_CATEGORY)) {
usedPropertyValueAliases.put(NORMALIZED_GENERAL_CATEGORY, "lc");
}
for (String propName : unicodeData.usedEnumeratedProperties().keySet()) {
Collection<String> propValues = unicodeData.usedEnumeratedProperties().get(propName);
for (String propValue : propValues) {
String canonicalValue = PropertyNames.canonicalValue(propName, propValue);
// Add value-only aliases for General Category and Script properties.
if (DEFAULT_CATEGORIES.contains(propName)) {
for (String valueAlias : unicodeData.getPropertyValueAliases(propName, propValue)) {
if (!Objects.equals(valueAlias, propValue)) {
usedPropertyValueAliases.put(valueAlias, propValue);
}
}
}
for (String nameAlias : unicodeData.getPropertyAliases(propName)) {
for (String valueAlias : unicodeData.getPropertyValueAliases(propName, propValue)) {
// Both property names and values have self-aliases; when generating
// all possible alias combinations, exclude the one that is the same
// as the full property name + full property value, unless the
// property is General Category or Script.
if (DEFAULT_CATEGORIES.contains(propName)
|| !(Objects.equals(nameAlias, propName)
&& Objects.equals(valueAlias, propValue))) {
String alias = nameAlias + '=' + valueAlias;
usedPropertyValueAliases.put(alias, canonicalValue);
}
}
}
}
}
return usedPropertyValueAliases.build();
}