11from typing import Callable , Mapping , Optional , Sequence , Union
22
3+ ByteOrChar = Union [str , int ]
4+
35class TrieNode :
46 def is_in_chars (self ) -> bool : ...
57 def is_in_bytes (self ) -> bool : ...
68 def get_node_id (self ) -> int : ...
79 def is_accepting (self ) -> bool : ...
8- def get_trans (self ) -> Mapping [Union [ str , int ] , int ]: ...
10+ def get_trans (self ) -> Mapping [ByteOrChar , int ]: ...
911 def get_parent (self ) -> int : ...
1012
1113class Trie :
@@ -23,13 +25,13 @@ class Trie:
2325 def get_node (self , node_id : int ) -> Optional [TrieNode ]: ...
2426 def dfs_travel (
2527 self ,
26- in_stack_callback : Callable [[int , Optional [str ]], None ],
28+ in_stack_callback : Callable [[int , Optional [ByteOrChar ]], None ],
2729 out_stack_callback : Callable [[int ], None ],
2830 root_node_id : Optional [int ] = None ,
2931 ) -> TrieNode : ...
3032 def bfs_travel (
3133 self ,
32- in_queue_callback : Callable [[int , Optional [str ]], None ],
34+ in_queue_callback : Callable [[int , Optional [ByteOrChar ]], None ],
3335 out_queue_callback : Callable [[int ], None ],
3436 root_node_id : Optional [int ] = None ,
3537 ) -> TrieNode : ...
@@ -41,7 +43,7 @@ class GeneralSAMState:
4143 def is_nil (self ) -> bool : ...
4244 def is_root (self ) -> bool : ...
4345 def is_accepting (self ) -> bool : ...
44- def get_trans (self ) -> Mapping [Union [ str , int ] , int ]: ...
46+ def get_trans (self ) -> Mapping [ByteOrChar , int ]: ...
4547 def get_suffix_parent_id (self ) -> int : ...
4648 def copy (self ) -> 'GeneralSAMState' : ...
4749 def goto_suffix_parent (self ): ...
@@ -52,14 +54,18 @@ class GeneralSAMState:
5254 def dfs_along (
5355 self ,
5456 trie : Trie ,
55- in_stack_callback : Callable [['GeneralSAMState' , int , Optional [str ]], None ],
57+ in_stack_callback : Callable [
58+ ['GeneralSAMState' , int , Optional [ByteOrChar ]], None
59+ ],
5660 out_stack_callback : Callable [['GeneralSAMState' , int ], None ],
5761 trie_node_id : Optional [int ] = None ,
5862 ) -> TrieNode : ...
5963 def bfs_along (
6064 self ,
6165 trie : Trie ,
62- in_queue_callback : Callable [['GeneralSAMState' , int , Optional [str ]], None ],
66+ in_queue_callback : Callable [
67+ ['GeneralSAMState' , int , Optional [ByteOrChar ]], None
68+ ],
6369 out_queue_callback : Callable [['GeneralSAMState' , int ], None ],
6470 trie_node_id : Optional [int ] = None ,
6571 ) -> TrieNode : ...
0 commit comments