Decoding Value Extractor

class etk.extractors.decoding_value_extractor.DecodingValueExtractor(decoding_dict: dict, extractor_name: str, default_action: str = 'delete', case_sensitive: bool = False, strip_key: bool = True, strip_value: bool = False)[source]

Bases: etk.extractor.Extractor

Description
This class takes a ‘decoding_dict’ as reference, decoding the input text based on the ‘decoding_dict’

Examples

decoding_dict = {
'CA': 'California',
'ny': 'New York',
'AZ': ' Arizona',
' TX ': 'Texas',
' fl': 'Florida',
}
decoding_value_extractor = DecodingValueExtractor(decoding_dict=decoding_dict,
                                                extractor_name='default_decoding',
                                                case_sensitive=True,
                                                strip_key=False,
                                                strip_value=True)
decoding_value_extractor.extract(value=value_to_be_decoded)
extract(value: str) → List[etk.extraction.Extraction][source]
Parameters:value (str) – the value to be decode
Returns:actually a single Extraction wrapped in a list if there is a match
Return type:List[Extraction]