diff --git a/nisaba/brahmic/BUILD.bazel b/nisaba/brahmic/BUILD.bazel index 330159a0..47948ec1 100644 --- a/nisaba/brahmic/BUILD.bazel +++ b/nisaba/brahmic/BUILD.bazel @@ -64,10 +64,6 @@ nisaba_grm_regression_test( nisaba_compile_multi_grm_py( name = "fixed", - outs = { - "byte": "fixed.far", - "utf8": "fixed_utf8.far", - }, data = [":sigma_utf8.far"] + [ "//nisaba/brahmic/data/script/{}:fixed.tsv".format(script) for script in FIXED_RULE_SCRIPTS @@ -90,10 +86,6 @@ nisaba_grm_regression_test( nisaba_compile_multi_grm_py( name = "nfc", - outs = { - "byte": "nfc.far", - "utf8": "nfc_utf8.far", - }, data = [ ":sigma_utf8.far", ] + ["//nisaba/brahmic/data/script/{}:nfc.tsv".format(script) for script in SCRIPTS], @@ -235,10 +227,6 @@ py_test( nisaba_compile_multi_grm_py( name = "visual_norm", - outs = { - "byte": "visual_norm.far", - "utf8": "visual_norm_utf8.far", - }, data = [ ":nfc.far", ":nfc_utf8.far", @@ -288,10 +276,6 @@ nisaba_grm_regression_test( nisaba_compile_multi_grm_py( name = "wellformed", - outs = { - "byte": "wellformed.far", - "utf8": "wellformed_utf8.far", - }, data = [ "//nisaba/brahmic/data/script/{}:{}.tsv".format(script, file_name) for script in SCRIPTS diff --git a/nisaba/utils/grammars.bzl b/nisaba/utils/grammars.bzl index f13c7b97..d8b1ecc8 100644 --- a/nisaba/utils/grammars.bzl +++ b/nisaba/utils/grammars.bzl @@ -55,7 +55,6 @@ def nisaba_compile_grm_py( def nisaba_compile_multi_grm_py( name, - outs, deps = None, data = None, **kwds): @@ -63,11 +62,11 @@ def nisaba_compile_multi_grm_py( Turns a Pynini file into a FAR file with the specified FAR and FST types. + Assumes that there are exactly two output files, and that they are "byte" + and "utf8" mode versions of the created FSTs. + Args: name: The BUILD rule name and the file prefix for the generated output. - outs: A dictionary mapping designators to files, where designator - is the designating name used in the Pynini file to refer to the - corresponding file. The designated files must have extension ".far". deps: A list of other compile_grm rules that we'll need for this grammar. data: Extra data dependencies used in the Pynini file. **kwds: Attributes common to all BUILD rules, e.g., testonly, visibility. @@ -75,7 +74,7 @@ def nisaba_compile_multi_grm_py( compile_multi_grm_py( name = name, fst_type = _FST_TYPE, - outs = outs, + outs = {"byte": name + ".far", "utf8": name + "_utf8.far"}, data = data, deps = deps + [ ],