]> granicus.if.org Git - icu/commitdiff
ICU-20473 Moving collation ucadata option to filter file. 539/head
authorShane Carr <shane@unicode.org>
Wed, 20 Mar 2019 01:27:37 +0000 (18:27 -0700)
committerShane F. Carr <shane@unicode.org>
Thu, 21 Mar 2019 00:44:48 +0000 (17:44 -0700)
icu4c/source/data/buildtool/__main__.py
icu4c/source/data/buildtool/filtration_schema.json

index 41435330355d564ad1522feefeb9b8b52263393e..52d869c89514ef2fdc06ab2a93e20645486a881f 100644 (file)
@@ -78,12 +78,6 @@ flag_parser.add_argument(
     help = "Path to an ICU data filter JSON file.",
     default = None
 )
-flag_parser.add_argument(
-    "--collation_ucadata",
-    help = "Which data set to use for ucadata in collation.",
-    choices = ["unihan", "implicithan"],
-    default = "unihan"
-)
 flag_parser.add_argument(
     "--include_uni_core_data",
     help = "Include the full Unicode core data in the dat file.",
@@ -126,9 +120,6 @@ class Config(object):
         # Process arguments
         self.max_parallel = (args.seqmode == "parallel")
 
-        # Either "unihan" or "implicithan"
-        self.coll_han_type = args.collation_ucadata
-
         # Boolean: Whether to include core Unicode data files in the .dat file
         self.include_uni_core_data = args.include_uni_core_data
 
@@ -145,6 +136,11 @@ class Config(object):
                 print("Error: Could not read filter file %s." % args.filter_file, file=sys.stderr)
                 exit(1)
 
+        # Either "unihan" or "implicithan"
+        self.coll_han_type = "unihan"
+        if "collationUCAData" in self.filters_json_data:
+            self.coll_han_type = self.filters_json_data["collationUCAData"]
+
     def _parse_filter_file(self, f):
         # Use the Hjson parser if it is available; otherwise, use vanilla JSON.
         try:
index 3f407ce18b0b16054410d0af83c34b6f628f5102..479c65affe60089b9120808b2b330ac654768145 100644 (file)
             },
             "additionalProperties": false,
             "required": ["directory", "replacements"]
+        },
+        "collationUCAData": {
+            "type": "string",
+            "enum": ["unihan", "implicithan"]
         }
     },
     "additionalProperties": false,