| 10 | |
| 11 | |
| 12 | class SuffixTreeNode: |
| 13 | def __init__( |
| 14 | self, |
| 15 | children: dict[str, SuffixTreeNode] | None = None, |
| 16 | is_end_of_string: bool = False, |
| 17 | start: int | None = None, |
| 18 | end: int | None = None, |
| 19 | suffix_link: SuffixTreeNode | None = None, |
| 20 | ) -> None: |
| 21 | """ |
| 22 | Initializes a suffix tree node. |
| 23 | |
| 24 | Parameters: |
| 25 | children (dict[str, SuffixTreeNode] | None): The children of this node. |
| 26 | is_end_of_string (bool): Indicates if this node represents |
| 27 | the end of a string. |
| 28 | start (int | None): The start index of the suffix in the text. |
| 29 | end (int | None): The end index of the suffix in the text. |
| 30 | suffix_link (SuffixTreeNode | None): Link to another suffix tree node. |
| 31 | """ |
| 32 | self.children = children or {} |
| 33 | self.is_end_of_string = is_end_of_string |
| 34 | self.start = start |
| 35 | self.end = end |
| 36 | self.suffix_link = suffix_link |
no outgoing calls
no test coverage detected