"""simple docstring"""




class 						__A							:






     def __init__(		self  ):
       _lowerCAmelCase						:       List[Any]  			=     """"""
       _lowerCAmelCase						:       Optional[int]  			=     """"""
       _lowerCAmelCase						:       List[str]  			=     []






     def     __A  (		self				,     a__				,     a__  ):
       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]:
           _lowerCAmelCase						:       str  			=     self.__min_dist_top_down_dp(m - 1				,     n - 1  )
         else:
           _lowerCAmelCase						:       Dict  			=     self.__min_dist_top_down_dp(a__				,     n - 1  )
           _lowerCAmelCase						:       int  			=     self.__min_dist_top_down_dp(m - 1				,     a__  )
           _lowerCAmelCase						:       str  			=     self.__min_dist_top_down_dp(m - 1				,     n - 1  )
           _lowerCAmelCase						:       Optional[int]  			=     1 + min(a__				,     a__				,     a__  )

         return self.dp[m][n]






     def     __A  (		self				,     a__				,     a__  ):
       _lowerCAmelCase						:       Optional[Any]  			=     worda
       _lowerCAmelCase						:       Any  			=     worda
       _lowerCAmelCase						:       List[Any]  			=     [[-1 for _ in range(len(a__  )  )] for _ in range(len(a__  )  )]

       return self.__min_dist_top_down_dp(len(a__  ) - 1				,     len(a__  ) - 1  )






     def     __A  (		self				,     a__				,     a__  ):
       _lowerCAmelCase						:       Dict  			=     worda
       _lowerCAmelCase						:       Union[str, Any]  			=     worda
       _lowerCAmelCase						:       Optional[Any]  			=     len(a__  )
       _lowerCAmelCase						:       Union[str, Any]  			=     len(a__  )
       _lowerCAmelCase						:       Tuple  			=     [[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
             _lowerCAmelCase						:       Any  			=     j
           elif j == 0:  # second string is empty
             _lowerCAmelCase						:       Tuple  			=     i
           elif worda[i - 1] == worda[j - 1]:  # last characters are equal
             _lowerCAmelCase						:       int  			=     self.dp[i - 1][j - 1]
           else:
             _lowerCAmelCase						:       List[str]  			=     self.dp[i][j - 1]
             _lowerCAmelCase						:       Tuple  			=     self.dp[i - 1][j]
             _lowerCAmelCase						:       Dict  			=     self.dp[i - 1][j - 1]
             _lowerCAmelCase						:       Optional[int]  			=     1 + min(a__				,     a__				,     a__  )
       return self.dp[m][n]


if __name__ == "__main__":
     _a      :		List[str]           =   EditDistance()

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

     _a      :		List[Any]           =   input('Enter the first string: ').strip()
     _a      :		List[Any]           =   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 ***************')





"""simple docstring"""




import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from .tokenization_electra import ElectraTokenizer


_a      :		List[Any]           =   {'vocab_file': 'vocab.txt', 'tokenizer_file': 'tokenizer.json'}

_a      :		Union[str, Any]           =   {
    'vocab_file': {
        'google/electra-small-generator': (
            'https://huggingface.co/google/electra-small-generator/resolve/main/vocab.txt'
        ),
        'google/electra-base-generator': 'https://huggingface.co/google/electra-base-generator/resolve/main/vocab.txt',
        'google/electra-large-generator': (
            'https://huggingface.co/google/electra-large-generator/resolve/main/vocab.txt'
        ),
        'google/electra-small-discriminator': (
            'https://huggingface.co/google/electra-small-discriminator/resolve/main/vocab.txt'
        ),
        'google/electra-base-discriminator': (
            'https://huggingface.co/google/electra-base-discriminator/resolve/main/vocab.txt'
        ),
        'google/electra-large-discriminator': (
            'https://huggingface.co/google/electra-large-discriminator/resolve/main/vocab.txt'
        ),
    },
    'tokenizer_file': {
        'google/electra-small-generator': (
            'https://huggingface.co/google/electra-small-generator/resolve/main/tokenizer.json'
        ),
        'google/electra-base-generator': (
            'https://huggingface.co/google/electra-base-generator/resolve/main/tokenizer.json'
        ),
        'google/electra-large-generator': (
            'https://huggingface.co/google/electra-large-generator/resolve/main/tokenizer.json'
        ),
        'google/electra-small-discriminator': (
            'https://huggingface.co/google/electra-small-discriminator/resolve/main/tokenizer.json'
        ),
        'google/electra-base-discriminator': (
            'https://huggingface.co/google/electra-base-discriminator/resolve/main/tokenizer.json'
        ),
        'google/electra-large-discriminator': (
            'https://huggingface.co/google/electra-large-discriminator/resolve/main/tokenizer.json'
        ),
    },
}

_a      :		Optional[Any]           =   {
    'google/electra-small-generator': 512,
    'google/electra-base-generator': 512,
    'google/electra-large-generator': 512,
    'google/electra-small-discriminator': 512,
    'google/electra-base-discriminator': 512,
    'google/electra-large-discriminator': 512,
}

_a      :		Any           =   {
    'google/electra-small-generator': {'do_lower_case': True},
    'google/electra-base-generator': {'do_lower_case': True},
    'google/electra-large-generator': {'do_lower_case': True},
    'google/electra-small-discriminator': {'do_lower_case': True},
    'google/electra-base-discriminator': {'do_lower_case': True},
    'google/electra-large-discriminator': {'do_lower_case': True},
}
class 						__A							( SCREAMING_SNAKE_CASE_		):
     _UpperCamelCase							:			Tuple							=		VOCAB_FILES_NAMES
     _UpperCamelCase							:			List[Any]							=		PRETRAINED_VOCAB_FILES_MAP
     _UpperCamelCase							:			List[Any]							=		PRETRAINED_INIT_CONFIGURATION
     _UpperCamelCase							:			Union[str, Any]							=		PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
     _UpperCamelCase							:			Optional[Any]							=		ElectraTokenizer






     def __init__(		self				,     a__=None				,     a__=None				,     a__=True				,     a__="[UNK]"				,     a__="[SEP]"				,     a__="[PAD]"				,     a__="[CLS]"				,     a__="[MASK]"				,     a__=True				,     a__=None				,     **a__				,     ):
       super().__init__(
           a__				,     tokenizer_file=a__				,     do_lower_case=a__				,     unk_token=a__				,     sep_token=a__				,     pad_token=a__				,     cls_token=a__				,     mask_token=a__				,     tokenize_chinese_chars=a__				,     strip_accents=a__				,     **a__				,     )

       _lowerCAmelCase						:       int  			=     json.loads(self.backend_tokenizer.normalizer.__getstate__()  )
       if (
           normalizer_state.get("""lowercase"""				,     a__  ) != do_lower_case
           or normalizer_state.get("""strip_accents"""				,     a__  ) != strip_accents
           or normalizer_state.get("""handle_chinese_chars"""				,     a__  ) != tokenize_chinese_chars
       ):
         _lowerCAmelCase						:       Dict  			=     getattr(a__				,     normalizer_state.pop("""type"""  )  )
         _lowerCAmelCase						:       int  			=     do_lower_case
         _lowerCAmelCase						:       str  			=     strip_accents
         _lowerCAmelCase						:       Dict  			=     tokenize_chinese_chars
         _lowerCAmelCase						:       str  			=     normalizer_class(**a__  )

       _lowerCAmelCase						:       List[str]  			=     do_lower_case






     def     __A  (		self				,     a__				,     a__=None  ):
       _lowerCAmelCase						:       int  			=     [self.cls_token_id] + token_ids_a + [self.sep_token_id]

       if token_ids_a:
         output += token_ids_a + [self.sep_token_id]

       return output






     def     __A  (		self				,     a__				,     a__ = None  ):
       _lowerCAmelCase						:       List[str]  			=     [self.sep_token_id]
       _lowerCAmelCase						:       Any  			=     [self.cls_token_id]
       if token_ids_a is None:
         return len(cls + token_ids_a + sep  ) * [0]
       return len(cls + token_ids_a + sep  ) * [0] + len(token_ids_a + sep  ) * [1]






     def     __A  (		self				,     a__				,     a__ = None  ):
       _lowerCAmelCase						:       Optional[Any]  			=     self._tokenizer.model.save(a__				,     name=a__  )
       return tuple(a__  )




