strings.aho_corasick ==================== .. py:module:: strings.aho_corasick Classes ------- .. autoapisummary:: strings.aho_corasick.Automaton Module Contents --------------- .. py:class:: Automaton(keywords: list[str]) .. py:method:: add_keyword(keyword: str) -> None .. py:method:: find_next_state(current_state: int, char: str) -> int | None .. py:method:: search_in(string: str) -> dict[str, list[int]] >>> A = Automaton(["what", "hat", "ver", "er"]) >>> A.search_in("whatever, err ... , wherever") {'what': [0], 'hat': [1], 'ver': [5, 25], 'er': [6, 10, 22, 26]} .. py:method:: set_fail_transitions() -> None .. py:attribute:: adlist :type: list[dict] :value: []