Skip to content

remove_words enhancements #895

Description

@ebhills

Current behavior of remove_words function needs changes:

Requirements:

  • tokenize_to_remove should default to true. change in the code as well as the schema doc string. Also more than one space should be reduced to a single space so that the tokens do not have spaces in them. If the inputs are already lists, then the tokenize step should be ignored
  • Add new parameter: characters_to_consider: all | letters_numbers_only (default). Default behavior is to remove anything [^a-z0-9] from tokens so that non alphanum characters are not included in the tokens and thus matches occur even when intial strings have miscellaneous punction, /s etc.
  • Regardless of characters_to_consider, any punctuation or spaces at the beginning or end of the input and to_remove values should be removed before tokenization.
  • If either of input or to_remove are lists and the other is just a str, should convert/tokenize the str and run the remove in the list mode.
  • Add defults for ignore_case at True, and note this in the schema
  • Add tests for all combinations. one example:
    input: Any, Words, Overlap?
    to_remove: Any Words Overlap
    output: '' (empty string)

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions