
class __snake_case		:
    def __init__(  self      ):



           '''simple docstring'''







           lowercase							:     Optional[Any]       	=      """"""
           lowercase							:     Tuple       	=      """"""
           lowercase							:     List[Any]       	=      []
    def       _SCREAMING_SNAKE_CASE       (  self		,snake_case		,snake_case      ):



           '''simple docstring'''







           if m == -1:
                  return n + 1
           elif n == -1:
                  return m + 1
           elif self.dp[m][n] > -1:
                  return self.dp[m][n]
           else:
                  if self.worda[m] == self.worda[n]:
                         lowercase							:     List[str]       	=      self.__min_dist_top_down_dp(m - 1		,n - 1      )
                  else:
                         lowercase							:     Any       	=      self.__min_dist_top_down_dp(snake_case		,n - 1      )
                         lowercase							:     List[Any]       	=      self.__min_dist_top_down_dp(m - 1		,snake_case      )
                         lowercase							:     Tuple       	=      self.__min_dist_top_down_dp(m - 1		,n - 1      )
                         lowercase							:     Union[str, Any]       	=      1 + min(snake_case		,snake_case		,snake_case      )

                  return self.dp[m][n]
    def       _SCREAMING_SNAKE_CASE       (  self		,snake_case		,snake_case      ):



           '''simple docstring'''







           lowercase							:     str       	=      worda
           lowercase							:     Dict       	=      worda
           lowercase							:     str       	=      [[-1 for _ in range(len(snake_case      )      )] for _ in range(len(snake_case      )      )]

           return self.__min_dist_top_down_dp(len(snake_case      ) - 1		,len(snake_case      ) - 1      )
    def       _SCREAMING_SNAKE_CASE       (  self		,snake_case		,snake_case      ):



           '''simple docstring'''







           lowercase							:     Optional[int]       	=      worda
           lowercase							:     int       	=      worda
           lowercase							:     List[Any]       	=      len(snake_case      )
           lowercase							:     Tuple       	=      len(snake_case      )
           lowercase							:     str       	=      [[0 for _ in range(n + 1      )] for _ in range(m + 1      )]

           for i in range(m + 1      ):
                  for j in range(n + 1      ):
                         if i == 0:  # first string is empty
                                lowercase							:     str       	=      j
                         elif j == 0:  # second string is empty
                                lowercase							:     Dict       	=      i
                         elif worda[i - 1] == worda[j - 1]:  # last characters are equal
                                lowercase							:     str       	=      self.dp[i - 1][j - 1]
                         else:
                                lowercase							:     Dict       	=      self.dp[i][j - 1]
                                lowercase							:     Optional[int]       	=      self.dp[i - 1][j]
                                lowercase							:     Dict       	=      self.dp[i - 1][j - 1]
                                lowercase							:     int       	=      1 + min(snake_case		,snake_case		,snake_case      )
           return self.dp[m][n]


if __name__ == "__main__":
  lowercase  :					Union[str, Any]						    =							EditDistance()

  print("""****************** Testing Edit Distance DP Algorithm ******************""")
  print()

  lowercase  :					Optional[Any]						    =							input("""Enter the first string: """).strip()
  lowercase  :					str						    =							input("""Enter the second string: """).strip()

  print()
  print(F'''The minimum edit distance is: {solver.min_dist_top_down(Sa, Sa)}''')
  print(F'''The minimum edit distance is: {solver.min_dist_bottom_up(Sa, Sa)}''')
  print()
  print("""*************** End of Testing Edit Distance DP Algorithm ***************""")


from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


lowercase  :					str						    =							{
    """configuration_funnel""": ["""FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP""", """FunnelConfig"""],
    """convert_funnel_original_tf_checkpoint_to_pytorch""": [],
    """tokenization_funnel""": ["""FunnelTokenizer"""],
}

try:
  if not is_tokenizers_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  lowercase  :					Tuple						    =							["""FunnelTokenizerFast"""]

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  lowercase  :					List[str]						    =							[
      """FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST""",
      """FunnelBaseModel""",
      """FunnelForMaskedLM""",
      """FunnelForMultipleChoice""",
      """FunnelForPreTraining""",
      """FunnelForQuestionAnswering""",
      """FunnelForSequenceClassification""",
      """FunnelForTokenClassification""",
      """FunnelModel""",
      """FunnelPreTrainedModel""",
      """load_tf_weights_in_funnel""",
  ]

try:
  if not is_tf_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  lowercase  :					Optional[Any]						    =							[
      """TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST""",
      """TFFunnelBaseModel""",
      """TFFunnelForMaskedLM""",
      """TFFunnelForMultipleChoice""",
      """TFFunnelForPreTraining""",
      """TFFunnelForQuestionAnswering""",
      """TFFunnelForSequenceClassification""",
      """TFFunnelForTokenClassification""",
      """TFFunnelModel""",
      """TFFunnelPreTrainedModel""",
  ]


if TYPE_CHECKING:
  from .configuration_funnel import FUNNEL_PRETRAINED_CONFIG_ARCHIVE_MAP, FunnelConfig
  from .tokenization_funnel import FunnelTokenizer

  try:
    if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .tokenization_funnel_fast import FunnelTokenizerFast

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_funnel import (
        FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST,
        FunnelBaseModel,
        FunnelForMaskedLM,
        FunnelForMultipleChoice,
        FunnelForPreTraining,
        FunnelForQuestionAnswering,
        FunnelForSequenceClassification,
        FunnelForTokenClassification,
        FunnelModel,
        FunnelPreTrainedModel,
        load_tf_weights_in_funnel,
    )

  try:
    if not is_tf_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_tf_funnel import (
        TF_FUNNEL_PRETRAINED_MODEL_ARCHIVE_LIST,
        TFFunnelBaseModel,
        TFFunnelForMaskedLM,
        TFFunnelForMultipleChoice,
        TFFunnelForPreTraining,
        TFFunnelForQuestionAnswering,
        TFFunnelForSequenceClassification,
        TFFunnelForTokenClassification,
        TFFunnelModel,
        TFFunnelPreTrainedModel,
    )

else:
  import sys

  lowercase  :					Any						    =							_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)
