Skip to content

Commit 3347e30

Browse files
aho-corasick: add is_terminal
1 parent 877bfed commit 3347e30

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/aho-corasick.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,18 @@ node; either active or inactive.
270270
:complexity: Constant
271271
)pbdoc");
272272

273+
thing.def(
274+
"is_terminal",
275+
[](AhoCorasick const& ac, size_t i) {
276+
ac.throw_if_node_index_out_of_range(i);
277+
ac.throw_if_node_index_not_active(i);
278+
return ac.node_no_checks(i).is_terminal();
279+
},
280+
py::arg("i"),
281+
R"pbdoc(
282+
TODO
283+
)pbdoc");
284+
273285
// Helpers
274286
m.def("aho_corasick_add_word",
275287
&aho_corasick::add_word<word_type>,

0 commit comments

Comments
 (0)