ICU-20473 Moving collation ucadata option to filter file.

This commit is contained in:
Shane Carr 2019-03-19 18:27:37 -07:00 committed by Shane F. Carr
parent 15cb156e56
commit e57c45c5c6
2 changed files with 9 additions and 9 deletions

View 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:

View file

@ -53,6 +53,10 @@
},
"additionalProperties": false,
"required": ["directory", "replacements"]
},
"collationUCAData": {
"type": "string",
"enum": ["unihan", "implicithan"]
}
},
"additionalProperties": false,