Skip to content

Commit

Permalink
Allow Uβ
Browse files Browse the repository at this point in the history
  • Loading branch information
eggrobin committed Jun 7, 2024
1 parent d9ae420 commit 465b9ff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
11 changes: 7 additions & 4 deletions docs/help/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@
The Unicode Utilities have been modified to support both properties from the
released version of Unicode (via ICU) and from the new Unicode beta.

To get the beta version of the property, U(version number)β *before* the property name.
To get the beta version of the property, insert `Uβ:` *before* the property name.
The explicit version number for the β can be used;
the resulting property is then only valid when that specific β is current.
Examples:

| `\p{Word_Break=ALetter}` | Released version of Unicode |
| `\p{U16β:Word_Break=ALetter}` | Beta version of Unicode |
| `\p{Word_Break=ALetter}` | Released version of Unicode. |
| `\p{Uβ:Word_Break=ALetter}` | Beta version of Unicode; error outside of beta review. |
| `\p{U16β:Word_Break=ALetter}` | Beta version of Unicode 16.0; error during the beta review of any other version. |


For example, to see additions to that property value in the beta version, use:

<center>

[`\p{U16β:Word_Break=ALetter}-\p{Word_Break=ALetter}`](https://util.unicode.org/UnicodeJsps/list-unicodeset.jsp?a=%5Cp%7BU16%CE%B2%3AWord_Break%3DALetter%7D-%5Cp%7BWord_Break%3DALetter%7D&g=&i=)
[`\p{:Word_Break=ALetter}-\p{Word_Break=ALetter}`](https://util.unicode.org/UnicodeJsps/list-unicodeset.jsp?a=%5Cp%7BU16%CE%B2%3AWord_Break%3DALetter%7D-%5Cp%7BWord_Break%3DALetter%7D&g=&i=)

</center>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.Set;
import java.util.TreeMap;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import org.unicode.props.IndexUnicodeProperties;
import org.unicode.props.UnicodeProperty;
import org.unicode.props.UnicodeProperty.Factory;
Expand Down Expand Up @@ -51,6 +52,7 @@ public static VersionedProperty forJSPs(Supplier<VersionInfo> oldestLoadedUcd) {
result.throwOnUnknownProperty = false;
result.defaultVersion = Settings.lastVersion;
result.versionAliases.put("dev", Settings.latestVersion);
result.versionAliases.put(Settings.latestVersionPhase.toString(), Settings.latestVersion);
result.oldestLoadedUcd = oldestLoadedUcd;
for (String latest = Settings.latestVersion;
;
Expand Down Expand Up @@ -102,7 +104,9 @@ public VersionedProperty set(String xPropertyName) {
"Unreleased version "
+ version
+ "; use suffix: "
+ String.join(", ", versionAliases.keySet()));
+ versionAliases.keySet().stream()
.map(v -> "U" + v)
.collect(Collectors.joining(", ")));
}
}
xPropertyName = names[1];
Expand Down

0 comments on commit 465b9ff

Please sign in to comment.