(self, keywords: list[str])
| 5 | |
| 6 | class Automaton: |
| 7 | def __init__(self, keywords: list[str]): |
| 8 | self.adlist: list[dict] = [] |
| 9 | self.adlist.append( |
| 10 | {"value": "", "next_states": [], "fail_state": 0, "output": []} |
| 11 | ) |
| 12 | |
| 13 | for keyword in keywords: |
| 14 | self.add_keyword(keyword) |
| 15 | self.set_fail_transitions() |
| 16 | |
| 17 | def find_next_state(self, current_state: int, char: str) -> int | None: |
| 18 | for state in self.adlist[current_state]["next_states"]: |
nothing calls this directly
no test coverage detected