infineac.process_text.keyword_threshold_search_exclude_mod#
- infineac.process_text.keyword_threshold_search_exclude_mod(string: str, keywords: dict[str, int] | list[str] = {}, modifier_words: list[str] = ['disregarding', 'except', 'excluding', 'ignoring', 'leaving out', 'not including', 'omitting']) bool[source]#
Checks if a string contains one of the keywords and does not contain a modifier_word preceding the keyword.
- Parameters:
string (str) – The string to be searched.
keywords (dict[str, int] | list[str], default: {}) – Dictionary or list of keywords. If keywords is a dictionary, the key is the keyword and the value is the minimum number of occurrences of the keyword in the text.
modifier_words (list[str], default: MODIFIER_WORDS) – List of modifier_words, which must not precede the keyword.
- Returns:
True if the text contains a keyword and does not contain a modifier word preceding it. False otherwise.
- Return type:
bool