

'''simple docstring'''






import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_funnel import FunnelTokenizer


lowerCAmelCase__      		=			logging.get_logger(__name__)

lowerCAmelCase__      		=			{'''vocab_file''': '''vocab.txt''', '''tokenizer_file''': '''tokenizer.json'''}

lowerCAmelCase__      		=			[
    '''small''',
    '''small-base''',
    '''medium''',
    '''medium-base''',
    '''intermediate''',
    '''intermediate-base''',
    '''large''',
    '''large-base''',
    '''xlarge''',
    '''xlarge-base''',
]

lowerCAmelCase__      		=			{
    '''vocab_file''': {
        '''funnel-transformer/small''': '''https://huggingface.co/funnel-transformer/small/resolve/main/vocab.txt''',
        '''funnel-transformer/small-base''': '''https://huggingface.co/funnel-transformer/small-base/resolve/main/vocab.txt''',
        '''funnel-transformer/medium''': '''https://huggingface.co/funnel-transformer/medium/resolve/main/vocab.txt''',
        '''funnel-transformer/medium-base''': (
            '''https://huggingface.co/funnel-transformer/medium-base/resolve/main/vocab.txt'''
        ),
        '''funnel-transformer/intermediate''': (
            '''https://huggingface.co/funnel-transformer/intermediate/resolve/main/vocab.txt'''
        ),
        '''funnel-transformer/intermediate-base''': (
            '''https://huggingface.co/funnel-transformer/intermediate-base/resolve/main/vocab.txt'''
        ),
        '''funnel-transformer/large''': '''https://huggingface.co/funnel-transformer/large/resolve/main/vocab.txt''',
        '''funnel-transformer/large-base''': '''https://huggingface.co/funnel-transformer/large-base/resolve/main/vocab.txt''',
        '''funnel-transformer/xlarge''': '''https://huggingface.co/funnel-transformer/xlarge/resolve/main/vocab.txt''',
        '''funnel-transformer/xlarge-base''': (
            '''https://huggingface.co/funnel-transformer/xlarge-base/resolve/main/vocab.txt'''
        ),
    },
    '''tokenizer_file''': {
        '''funnel-transformer/small''': '''https://huggingface.co/funnel-transformer/small/resolve/main/tokenizer.json''',
        '''funnel-transformer/small-base''': (
            '''https://huggingface.co/funnel-transformer/small-base/resolve/main/tokenizer.json'''
        ),
        '''funnel-transformer/medium''': '''https://huggingface.co/funnel-transformer/medium/resolve/main/tokenizer.json''',
        '''funnel-transformer/medium-base''': (
            '''https://huggingface.co/funnel-transformer/medium-base/resolve/main/tokenizer.json'''
        ),
        '''funnel-transformer/intermediate''': (
            '''https://huggingface.co/funnel-transformer/intermediate/resolve/main/tokenizer.json'''
        ),
        '''funnel-transformer/intermediate-base''': (
            '''https://huggingface.co/funnel-transformer/intermediate-base/resolve/main/tokenizer.json'''
        ),
        '''funnel-transformer/large''': '''https://huggingface.co/funnel-transformer/large/resolve/main/tokenizer.json''',
        '''funnel-transformer/large-base''': (
            '''https://huggingface.co/funnel-transformer/large-base/resolve/main/tokenizer.json'''
        ),
        '''funnel-transformer/xlarge''': '''https://huggingface.co/funnel-transformer/xlarge/resolve/main/tokenizer.json''',
        '''funnel-transformer/xlarge-base''': (
            '''https://huggingface.co/funnel-transformer/xlarge-base/resolve/main/tokenizer.json'''
        ),
    },
}
lowerCAmelCase__      		=			{f'funnel-transformer/{name}': 512 for name in _model_names}
lowerCAmelCase__      		=			{f'funnel-transformer/{name}': {'''do_lower_case''': True} for name in _model_names}






class     lowercase_			(lowerCamelCase__   ):




  """simple docstring"""




  SCREAMING_SNAKE_CASE					:						Any           =    VOCAB_FILES_NAMES
  SCREAMING_SNAKE_CASE					:						Optional[int]           =    PRETRAINED_VOCAB_FILES_MAP
  SCREAMING_SNAKE_CASE					:						int           =    PRETRAINED_INIT_CONFIGURATION
  SCREAMING_SNAKE_CASE					:						List[str]           =    FunnelTokenizer
  SCREAMING_SNAKE_CASE					:						str           =    PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
  SCREAMING_SNAKE_CASE					:						int           =    2






  def __init__(   self     :  str      ,lowercase__     :  List[str]=None      ,lowercase__     :  Dict=None      ,lowercase__     :  Optional[int]=True      ,lowercase__     :  Optional[int]="<unk>"      ,lowercase__     :  List[Any]="<sep>"      ,lowercase__     :  List[Any]="<pad>"      ,lowercase__     :  str="<cls>"      ,lowercase__     :  List[str]="<mask>"      ,lowercase__     :  Any="<s>"      ,lowercase__     :  str="</s>"      ,lowercase__     :  int=True      ,lowercase__     :  Dict=True      ,lowercase__     :  int=None      ,lowercase__     :  Dict="##"      ,**lowercase__     :  Optional[Any]      ,):
   super().__init__(
       lowercase__      ,tokenizer_file=lowercase__      ,do_lower_case=lowercase__      ,unk_token=lowercase__      ,sep_token=lowercase__      ,pad_token=lowercase__      ,cls_token=lowercase__      ,mask_token=lowercase__      ,bos_token=lowercase__      ,eos_token=lowercase__      ,clean_text=lowercase__      ,tokenize_chinese_chars=lowercase__      ,strip_accents=lowercase__      ,wordpieces_prefix=lowercase__      ,**lowercase__      ,)

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

   __lowercase													=				do_lower_case






  def       SCREAMING_SNAKE_CASE   (   self     :  Optional[int]      ,lowercase__     :  Optional[int]      ,lowercase__     :  int=None    ):
   __lowercase													=				[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       SCREAMING_SNAKE_CASE   (   self     :  Tuple      ,lowercase__     :  List[int]      ,lowercase__     :  Optional[List[int]] = None    ):
   __lowercase													=				[self.sep_token_id]
   __lowercase													=				[self.cls_token_id]
   if token_ids_a is None:
    return len(cls    ) * [self.cls_token_type_id] + len(token_ids_a + sep    ) * [0]
   return len(cls    ) * [self.cls_token_type_id] + len(token_ids_a + sep    ) * [0] + len(token_ids_a + sep    ) * [1]






  def       SCREAMING_SNAKE_CASE   (   self     :  Union[str, Any]      ,lowercase__     :  str      ,lowercase__     :  Optional[str] = None    ):
   __lowercase													=				self._tokenizer.model.save(lowercase__      ,name=lowercase__    )
   return tuple(lowercase__    )





'''simple docstring'''






import re


def 	_A  (					A__   ):






 """simple docstring"""



 __lowercase													=				re.compile(
     R'''^(?:0|94|\+94|0{2}94)''' R'''7(0|1|2|4|5|6|7|8)''' R'''(-| |)''' R'''\d{7}$'''   )

 return bool(re.search(A__  ,       A__   )   )


if __name__ == "__main__":
 lowerCAmelCase__      		=			'''0094702343221'''

 print(is_sri_lankan_phone_number(phone))

