# Path: src/analyzer/morphotactics/validator.py
# _RULE_INPUT_REGEX = re.compile(
#     # Inflectional group boundaries.
#     r"(?:\)?\(\[[A-Z]+?\]-([^\W\d_]|')+?\[[A-z]+?=[A-z]+?\]|"
#     # Inflectional morphemes and features.
#     r"\+([^\W\d_]|['\.])*?\[[A-z]+?=[A-z0-9]+?\]|"
#     # Proper noun analysis.
#     r"\)\+\[Proper=(?:True|False)\]|"
#     # Numbers.
#     r"\d+?(?:\[[A-Z]+?\])?)+|"
#     # Parenthesis or decimal point separators.
#     r"[\(\.,]")
# _RULE_OUTPUT_REGEX = re.compile(
#     # Meta-morphemes.
#     r"'?\+[^\W\d_]+|"
#     # Morphophonemics of numbers.
#     r"\d+(?:\.?\*?([^\W\d_]|['~])+\*?)?|"
#     # Comma, full-stop or apostrophe.
#     r"[',\.]")
# class InvalidMorphotacticsRuleError(Exception):
# def _rule_has_expected_number_of_tokens(
#     rule_definition: _RuleDefinition) -> None:
# def _rule_has_non_empty_tokens(rule_definition: _RuleDefinition) -> None:
# def _rule_input_is_valid(input_label: str) -> None:
# def _rule_output_is_valid(output_label: str) -> None:
# def validate(rule_definition: _RuleDefinition) -> None:


from src.analyzer.morphotactics import validator
from absl.testing import absltest
from absl.testing import parameterized
              "TO-STATE",
              "5[TAG]foo",
              "<eps>",
          ],
          "message": "Invalid rule input label.",
      },
      {
          "testcase_name": "InvalidRuleInputToken",
          "rule_definition": [
              "FROM-STATE",
              "TO-STATE",
              "Invalid-Input",
              "<eps>",
          ],
          "message": "Invalid rule input label.",
      },
      {
          "testcase_name": "InvalidRuleOutputToken",
          "rule_definition": [
              "FROM-STATE",
              "TO-STATE",
              "<eps>",
              "Invalid-Output",
          ],
          "message": "Invalid rule output label.",
      },
  ])
  def test_raises_exception(self, rule_definition, message):
    with self.assertRaisesRegexp(validator.InvalidMorphotacticsRuleError,
                                 message):

# Path: src/analyzer/morphotactics/validator.py
# _RULE_INPUT_REGEX = re.compile(
#     # Inflectional group boundaries.
#     r"(?:\)?\(\[[A-Z]+?\]-([^\W\d_]|')+?\[[A-z]+?=[A-z]+?\]|"
#     # Inflectional morphemes and features.
#     r"\+([^\W\d_]|['\.])*?\[[A-z]+?=[A-z0-9]+?\]|"
#     # Proper noun analysis.
#     r"\)\+\[Proper=(?:True|False)\]|"
#     # Numbers.
#     r"\d+?(?:\[[A-Z]+?\])?)+|"
#     # Parenthesis or decimal point separators.
#     r"[\(\.,]")
# _RULE_OUTPUT_REGEX = re.compile(
#     # Meta-morphemes.
#     r"'?\+[^\W\d_]+|"
#     # Morphophonemics of numbers.
#     r"\d+(?:\.?\*?([^\W\d_]|['~])+\*?)?|"
#     # Comma, full-stop or apostrophe.
#     r"[',\.]")
# class InvalidMorphotacticsRuleError(Exception):
# def _rule_has_expected_number_of_tokens(
#     rule_definition: _RuleDefinition) -> None:
# def _rule_has_non_empty_tokens(rule_definition: _RuleDefinition) -> None:
# def _rule_input_is_valid(input_label: str) -> None:
# def _rule_output_is_valid(output_label: str) -> None:
# def validate(rule_definition: _RuleDefinition) -> None:


# Path: src/analyzer/morphotactics/validator_test.py
from src.analyzer.morphotactics import validator
from absl.testing import absltest
from absl.testing import parameterized

              "TO-STATE",
              "5[TAG]foo",
              "<eps>",
          ],
          "message": "Invalid rule input label.",
      },
      {
          "testcase_name": "InvalidRuleInputToken",
          "rule_definition": [
              "FROM-STATE",
              "TO-STATE",
              "Invalid-Input",
              "<eps>",
          ],
          "message": "Invalid rule input label.",
      },
      {
          "testcase_name": "InvalidRuleOutputToken",
          "rule_definition": [
              "FROM-STATE",
              "TO-STATE",
              "<eps>",
              "Invalid-Output",
          ],
          "message": "Invalid rule output label.",
      },
  ])
  def test_raises_exception(self, rule_definition, message):
    with self.assertRaisesRegexp(validator.InvalidMorphotacticsRuleError,
                                 message):

      validator.validate(rule_definition)