MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / find_next_state

Method find_next_state

strings/aho_corasick.py:17–21  ·  view source on GitHub ↗
(self, current_state: int, char: str)

Source from the content-addressed store, hash-verified

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"]:
19 if char == self.adlist[state]["value"]:
20 return state
21 return None
22
23 def add_keyword(self, keyword: str) -> None:
24 current_state = 0

Callers 3

add_keywordMethod · 0.95
set_fail_transitionsMethod · 0.95
search_inMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected