





'''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


_SCREAMING_SNAKE_CASE									=				{"vocab_file": "vocab.txt", "tokenizer_file": "tokenizer.json"}

_SCREAMING_SNAKE_CASE									=				{
    "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"
        ),
    },
}

_SCREAMING_SNAKE_CASE									=				{
    "google/electra-small-generator": 5_12,
    "google/electra-base-generator": 5_12,
    "google/electra-large-generator": 5_12,
    "google/electra-small-discriminator": 5_12,
    "google/electra-base-discriminator": 5_12,
    "google/electra-large-discriminator": 5_12,
}

_SCREAMING_SNAKE_CASE									=				{
    "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  lowerCAmelCase_		(		__magic_name__		):
 __lowerCamelCase    :				Dict								=       VOCAB_FILES_NAMES
 __lowerCamelCase    :				Any								=       PRETRAINED_VOCAB_FILES_MAP
 __lowerCamelCase    :				List[str]								=       PRETRAINED_INIT_CONFIGURATION
 __lowerCamelCase    :				List[str]								=       PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
 __lowerCamelCase    :				List[Any]								=       ElectraTokenizer




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

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

     _lowerCAmelCase						      =   do_lower_case




 def 				_snake_case (						self      ,  _lowerCAmelCase      ,  _lowerCAmelCase=None		)     ->				str:
     _lowerCAmelCase						      =   [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 				_snake_case (						self      ,  _lowerCAmelCase      ,  _lowerCAmelCase = None		)     ->				List[int]:
     _lowerCAmelCase						      =   [self.sep_token_id]
     _lowerCAmelCase						      =   [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 				_snake_case (						self      ,  _lowerCAmelCase      ,  _lowerCAmelCase = None		)     ->				Tuple[str]:
     _lowerCAmelCase						      =   self._tokenizer.model.save(_lowerCAmelCase      ,  name=_lowerCAmelCase		)
     return tuple(_lowerCAmelCase		)









'''simple docstring'''


def 						__a(SCREAMING_SNAKE_CASE_	:       int		,							SCREAMING_SNAKE_CASE_	:       int     ):



    '''simple docstring'''





    return numa ^ numa < 0


if __name__ == "__main__":
       import doctest

       doctest.testmod()


