# Path: nisaba/scripts/brahmic/util.py
# def BuildSigmaFstFromSymbolTable(syms: pynini.SymbolTableView) -> pynini.Fst:
# def OpenFstFromBrahmicFar(far_name: str, fst_name: str, *,
#                           token_type: str) -> pynini.Fst:
# def OpenFstFromBrahmicFarSafe(far_name: str, fst_name: str, token_type: str,
#                               default: pynini.Fst) -> pynini.Fst:
# def OpenSigma(script: str, *, token_type: str) -> pynini.Fst:
# def MaybeLoadScriptConfig(
#     file_path: os.PathLike) -> script_config_pb2.ScriptConfig:
# SCRIPTS = [
#     "Beng",
#     "Bugi",
#     "Deva",
#     "Gujr",
#     "Guru",
#     "Knda",
#     "Lepc",
#     "Limb",
#     "Mlym",
#     "Mtei",
#     "Newa",
#     "Orya",
#     "Sinh",
#     "Sylo",
#     "Takr",
#     "Taml",
#     "Telu",
#     "Tglg",
#     "Thaa",
#     "Tirh",
# ]
# LANG_SCRIPT_MAP = {
#     "Beng": ["as", "bn"]
# }
# FIXED_RULE_SCRIPTS = ["Mlym"]
# READING_NORM_SCRIPTS = ["Lepc", "Mlym"]
# READING_NORM_LANG_SCRIPT_MAP = {
#     "Deva": ["hi"],
# }
# FAR_DIR = pathlib.Path("com_google_nisaba/nisaba/scripts/brahmic")
# SCRIPT_DIR = FAR_DIR / "data"


from absl.testing import absltest
from nisaba.scripts.brahmic import util as u
import nisaba.scripts.utils.file as uf
# Copyright 2022 Nisaba Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Rudimentary unit tests for the utility library."""



class UtilTest(absltest.TestCase):

  def testFileExistence(self):
    filename = 'dead_consonant.tsv'
    self.assertTrue(uf.IsFileExist(u.SCRIPT_DIR / 'Beng' / filename))

# Path: nisaba/scripts/brahmic/util.py
# def BuildSigmaFstFromSymbolTable(syms: pynini.SymbolTableView) -> pynini.Fst:
# def OpenFstFromBrahmicFar(far_name: str, fst_name: str, *,
#                           token_type: str) -> pynini.Fst:
# def OpenFstFromBrahmicFarSafe(far_name: str, fst_name: str, token_type: str,
#                               default: pynini.Fst) -> pynini.Fst:
# def OpenSigma(script: str, *, token_type: str) -> pynini.Fst:
# def MaybeLoadScriptConfig(
#     file_path: os.PathLike) -> script_config_pb2.ScriptConfig:
# SCRIPTS = [
#     "Beng",
#     "Bugi",
#     "Deva",
#     "Gujr",
#     "Guru",
#     "Knda",
#     "Lepc",
#     "Limb",
#     "Mlym",
#     "Mtei",
#     "Newa",
#     "Orya",
#     "Sinh",
#     "Sylo",
#     "Takr",
#     "Taml",
#     "Telu",
#     "Tglg",
#     "Thaa",
#     "Tirh",
# ]
# LANG_SCRIPT_MAP = {
#     "Beng": ["as", "bn"]
# }
# FIXED_RULE_SCRIPTS = ["Mlym"]
# READING_NORM_SCRIPTS = ["Lepc", "Mlym"]
# READING_NORM_LANG_SCRIPT_MAP = {
#     "Deva": ["hi"],
# }
# FAR_DIR = pathlib.Path("com_google_nisaba/nisaba/scripts/brahmic")
# SCRIPT_DIR = FAR_DIR / "data"


# Path: nisaba/scripts/brahmic/util_test.py
from absl.testing import absltest
from nisaba.scripts.brahmic import util as u
import nisaba.scripts.utils.file as uf

# Copyright 2022 Nisaba Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Rudimentary unit tests for the utility library."""



class UtilTest(absltest.TestCase):

  def testFileExistence(self):
    filename = 'dead_consonant.tsv'
    self.assertTrue(uf.IsFileExist(u.SCRIPT_DIR / 'Beng' / filename))

    self.assertFalse(uf.IsFileExist(u.SCRIPT_DIR / 'Taml' / filename))