Closed PROrock closed 4 months ago
Hi, sorry for the very late reply here :)
Thanks for sharing your code snippets for traversing the trees. This is the first time I hear demands about adding these kinds of helpers, so I'm a bit hesitant to add them. I think I'll keep this issue open, and if there are more people suggesting this is a good idea, they should make themselves heard in this thread! :)
+1 on having a use-case for/having reimplemented a to_list()
in my current project. I can see the utility for get_word_subtree()
in the abstract as well.
Hi, first of all, thanks for this awesome library, it is really helpful for my current project :-)
Second, for my current project I had to implement some helper methods regarding searching and collecting subtree tokens I want to share with you. You can decide if you want to incorporate some of them into the library (probably as instance methods on TokenTree). It might help others too.
Code: