From e57c45c5c66a8fa72e69ca44f148108f9ddde782 Mon Sep 17 00:00:00 2001 From: Shane Carr Date: Tue, 19 Mar 2019 18:27:37 -0700 Subject: [PATCH] ICU-20473 Moving collation ucadata option to filter file. --- icu4c/source/data/buildtool/__main__.py | 14 +++++--------- icu4c/source/data/buildtool/filtration_schema.json | 4 ++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/icu4c/source/data/buildtool/__main__.py b/icu4c/source/data/buildtool/__main__.py index 41435330355..52d869c8951 100644 --- a/icu4c/source/data/buildtool/__main__.py +++ b/icu4c/source/data/buildtool/__main__.py @@ -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: diff --git a/icu4c/source/data/buildtool/filtration_schema.json b/icu4c/source/data/buildtool/filtration_schema.json index 3f407ce18b0..479c65affe6 100644 --- a/icu4c/source/data/buildtool/filtration_schema.json +++ b/icu4c/source/data/buildtool/filtration_schema.json @@ -53,6 +53,10 @@ }, "additionalProperties": false, "required": ["directory", "replacements"] + }, + "collationUCAData": { + "type": "string", + "enum": ["unihan", "implicithan"] } }, "additionalProperties": false, -- 2.40.0