This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def normalize(obj, dict_key=None, regx="text"): | |
| """ This function cleans and normalize a given string. It performs three | |
| main operations: Sets to lower case, strips any trailing whitespace and | |
| finally substracts any character that isn't allowed in the string type | |
| regex, the character is replaced with an empty string. | |
| :param obj: this object can be 'str' or 'dict' instance type. | |
| :type obj:str It performs a directly normalization | |
| :type obj:dict It expects a key ( from 'dict_key' arg ) string | |
| to extract the string to be normalize, otherwise returns None. |
NewerOlder