# Path: src/analyzer/morphotactics/common.py
# START_STATE = "START"
# ACCEPT_STATE = "ACCEPT"
# EPSILON = "<eps>"


import re
from typing import List
from src.analyzer.morphotactics import common
  Args:
    input_label: input label of a morphotactics rule definition.

  Raises:
    InvalidMorphotacticsRuleError: input label of the morphotactics rule
        definition does not have a valid structure.
  """
  if input_label.lower() == common.EPSILON:
    return

  if not _RULE_INPUT_REGEX.fullmatch(input_label):
    raise InvalidMorphotacticsRuleError("Invalid rule input label.")


def _rule_output_is_valid(output_label: str) -> None:
  """Checks if the output label of the rule definition is valid.

  Output label is valid if its structure is one of the following:
    - Epsilon (e.g. '<eps>')
    - Meta-morpheme (e.g. '+lAr')
    - Morphophonemics of a number (e.g. '4*ört~*')
    - Comma, full-stop or apostrophe.

  Args:
    output_label: output label of a morphotactics rule definition.

  Raises:
    InvalidMorphotacticsRuleError: output label of the morphotactics rule
        definition does not have a valid structure.
  """

# Path: src/analyzer/morphotactics/common.py
# START_STATE = "START"
# ACCEPT_STATE = "ACCEPT"
# EPSILON = "<eps>"


# Path: src/analyzer/morphotactics/validator.py
import re
from typing import List
from src.analyzer.morphotactics import common

  Args:
    input_label: input label of a morphotactics rule definition.

  Raises:
    InvalidMorphotacticsRuleError: input label of the morphotactics rule
        definition does not have a valid structure.
  """
  if input_label.lower() == common.EPSILON:
    return

  if not _RULE_INPUT_REGEX.fullmatch(input_label):
    raise InvalidMorphotacticsRuleError("Invalid rule input label.")


def _rule_output_is_valid(output_label: str) -> None:
  """Checks if the output label of the rule definition is valid.

  Output label is valid if its structure is one of the following:
    - Epsilon (e.g. '<eps>')
    - Meta-morpheme (e.g. '+lAr')
    - Morphophonemics of a number (e.g. '4*ört~*')
    - Comma, full-stop or apostrophe.

  Args:
    output_label: output label of a morphotactics rule definition.

  Raises:
    InvalidMorphotacticsRuleError: output label of the morphotactics rule
        definition does not have a valid structure.
  """

  if output_label.lower() == common.EPSILON: