def __init__(self, entity_name, language=ENGLISH_LANG, locale=None): """ Args: entity_name (str): A string by which the detected numbers would be replaced with on calling detect_entity() language (str, optional): language code of number text, defaults to 'en' locale(str, optional): locale of the country from which you are dialing. Ex: 'en-IN' """ self._supported_languages = NumberDetector.get_supported_languages() super(PhoneDetector, self).__init__(language, locale) self.language = language self.locale = locale or 'en-IN' self.text = '' self.phone, self.original_phone_text = [], [] self.country_code = self.get_country_code_from_locale() self.entity_name = entity_name self.tag = '__' + self.entity_name + '__'
def __init__(self, entity_name, language=ENGLISH_LANG): """ Args: entity_name (str): A string by which the detected numbers would be replaced with on calling detect_entity() language (str, optional): language code of number text, defaults to 'en' """ self._supported_languages = NumberDetector.get_supported_languages() super(PhoneDetector, self).__init__(language) self.language = language self.entity_name = entity_name self.text = '' self.tagged_text = '' self.processed_text = '' self.phone = [] self.original_phone_text = [] self.tag = '__' + self.entity_name + '__'