(packed, s, size, node_offset, stringpos)
| 437 | return child_offset, last_edge, size, offset |
| 438 | |
| 439 | def _match_edge(packed, s, size, node_offset, stringpos): |
| 440 | if size > 1 and stringpos + size > len(s): |
| 441 | # past the end of the string, can't match |
| 442 | return False |
| 443 | for i in range(size): |
| 444 | if packed[node_offset + i] != s[stringpos + i]: |
| 445 | # if a subsequent char of an edge doesn't match, the word isn't in |
| 446 | # the dawg |
| 447 | if i > 0: |
| 448 | raise KeyError |
| 449 | return False |
| 450 | return True |
| 451 | |
| 452 | def lookup(packed, data, s): |
| 453 | return data[_lookup(packed, s)] |
no outgoing calls
no test coverage detected
searching dependent graphs…