Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UCDXML and TR42 v2 #1030

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ perf-*.xml
test-*.xml

# Directories
.idea/
.settings/
.vs/
.vscode/
Expand Down
22 changes: 22 additions & 0 deletions docs/ucdxml.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generating TR42

## Step 1 - Generate property value fragments

- mvn compile exec:java '-Dexec.mainClass="org.unicode.xml.GeneratePropertyValues"' '-Dexec.args="--ucdversion 16.0.0 -f $(cd ./unicodetools/src/main/resources/org/unicode/uax42/fragments; pwd)"' -DCLDR_DIR=$(cd ../cldr ; pwd) -DUNICODETOOLS_GEN_DIR=$(cd ../Generated ; pwd) -DUNICODETOOLS_REPO_DIR=$(pwd)

## Step 2 - Generate TR42 index.html and index.rnc

- mvn xml:transform -f $(cd ./unicodetools/src/main/resources/org/unicode/uax42/fragments; pwd) -Doutputdir=../Generated/uax42/

## Step 3 - Validate generated UAX XML files

You'll need a [RELAX NG](https://relaxng.org/) schema validator.
We'll use [jing-trang](https://github.com/relaxng/jing-trang) in this example.

1. Clone and build [jing-trang](https://github.com/relaxng/jing-trang)
2. Run the following:
```
java -jar C:\_git\jing-trang\build\jing.jar -c UNICODETOOLS_REPO_DIR\uax\uax42\output\index.rnc <path to UAX xml file>
```
Note that the UAX xml file has to be saved as NFD as the Unihan syntax regular expressions are expecting NFD.

4 changes: 4 additions & 0 deletions unicodetools/src/main/java/org/unicode/props/UcdProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,16 @@ public enum UcdProperty {
Emoji_SB(PropertyType.Miscellaneous, "ESB"),
ISO_Comment(PropertyType.Miscellaneous, "isc"),
Jamo_Short_Name(PropertyType.Miscellaneous, "JSN"),
NC_Corrected(PropertyType.Miscellaneous, "ncCorrected"),
NC_Original(PropertyType.Miscellaneous, "ncOriginal"),
NC_Version(PropertyType.Miscellaneous, "ncVersion"),
Name(PropertyType.Miscellaneous, "na"),
Name_Alias(PropertyType.Miscellaneous, null, ValueCardinality.Unordered, "Name_Alias"),
Named_Sequences(PropertyType.Miscellaneous, "NS"),
Named_Sequences_Prov(PropertyType.Miscellaneous, "NSP"),
Standardized_Variant(PropertyType.Miscellaneous, null, ValueCardinality.Unordered, "SV"),
Unicode_1_Name(PropertyType.Miscellaneous, "na1"),
emoji_variation_sequence(PropertyType.Miscellaneous, "EVS"),
kAlternateHanYu(PropertyType.Miscellaneous, "cjkAlternateHanYu"),
kAlternateJEF(PropertyType.Miscellaneous, "cjkAlternateJEF"),
kAlternateKangXi(PropertyType.Miscellaneous, "cjkAlternateKangXi"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,7 @@ public static East_Asian_Width_Values forName(String name) {
// Emoji_DCM
// Emoji_KDDI
// Emoji_SB
// emoji_variation_sequence
// Equivalent_Unified_Ideograph
// FC_NFKC_Closure
public enum General_Category_Values implements Named {
Expand Down Expand Up @@ -1668,6 +1669,9 @@ public static Line_Break_Values forName(String name) {
// Name_Alias
// Named_Sequences
// Named_Sequences_Prov
// NC_Corrected
// NC_Original
// NC_Version
public enum NFC_Quick_Check_Values implements Named {
Maybe("M"),
No("N"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,8 @@ public static void doSb(String outputDir) throws IOException {
// try {
// copy(new URL(url), new File(outputDir + "/sb","sb_" + code + ".gif"));
//// BufferedImage sourceImage = ImageIO.read(new URL(url));
//// writeImage(sourceImage,outputDir + "/sb","sb_" + code, "gif");
//// writeImage(sourceImage,outputDir + "/sb","sb_" + code,
// "gif");
// System.out.println(code);
// } catch (Exception e) {
// System.out.println("Skipping " + code);
Expand Down
Loading
Loading