diff --git a/wrangles/extract.py b/wrangles/extract.py index 48d18073..9333272f 100644 --- a/wrangles/extract.py +++ b/wrangles/extract.py @@ -427,6 +427,20 @@ def codes( e.g. 'Something ABC123ZZ something' -> 'ABC123ZZ' + :param input: A string or list of strings to search for codes. + :param first_element: Get the first element from results. + :param min_length: Minimum length of allowed results. + :param max_length: Maximum length of allowed results. + :param strategy: Controls filtering of likely false positives such as measurements. + 'lenient' skips this filter, while 'balanced' and 'strict' currently apply + the same filter. Default is 'balanced'. Unless min_length is provided, + minimum lengths default to 3 for lenient, 4 for balanced, and 5 for strict. + :param sort_order: Default is input order. Also allows 'longest' or 'shortest'. + :param disallowed_patterns: A pattern or JSON array of regex patterns to not include in the found codes. + :param include_multi_part_tokens: Whether to include multi-part tokens that have a space. Default True. + :param extract_raw: Whether to return tokens with their adjacent non-whitespace characters + included, rather than the cleaned token. Default False. + :return: A list of codes found. """ if isinstance(input, str): json_data = [input] diff --git a/wrangles/recipe_wrangles/extract.py b/wrangles/recipe_wrangles/extract.py index b63a6275..7f4c9358 100644 --- a/wrangles/recipe_wrangles/extract.py +++ b/wrangles/recipe_wrangles/extract.py @@ -856,7 +856,7 @@ def codes( description: Maximum length of allowed results strategy: type: string - description: How aggressive to be at removing false positives such as measurements. + description: Controls filtering of likely false positives such as measurements. Lenient skips this filter; balanced and strict currently apply the same filter. Default is balanced. Unless min_length is provided, minimum lengths default to 3 for lenient, 4 for balanced, and 5 for strict. enum: - lenient - balanced @@ -876,7 +876,7 @@ def codes( description: Whether to include multi-part tokens that have a space. Default True. extract_raw: type: boolean - description: Whether to return tokens with their adjacent non-whitespace characters. Default False. + description: Whether to return tokens with their adjacent non-whitespace characters included, rather than the cleaned token. Default False. """ # If output is not specified, overwrite input columns in place if output is None: output = input