Treex::Block::Util::Find - Finding nodes based on criteria specified by parameters
version 2.20150928
# on the command line treex Util::Find anode='$anode->lemma eq "dog"' -- *.treex.gz treex Util::Find language=en tnode='$tnode->gram_gender eq "fem"' -- *.treex.gz # The same two commands even shorter treex Util::Find anode='$.lemma eq "dog"' -- *.treex.gz treex -Len Util::Find tnode='$.gram_gender eq "fem"' -- *.treex.gz # View a-trees with at least one coordination in ttred treex Util::Find anode='$.is_member' max_nodes_per_tree=1 -- *.treex.gz | ttred -l-
The criteria specified in [atnp](node|tree) is an arbitrary Perl code. If the code evaluates to a true value, the address of the node is printed (in a format suitable for piping into ttred).
ttred
You can use "$." instead of "$this->" where $this is the current tree/node.
Martin Popel <popel@ufal.mff.cuni.cz>
Copyright © 2012 by Institute of Formal and Applied Linguistics, Charles University in Prague
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Treex::Core, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Treex::Core
CPAN shell
perl -MCPAN -e shell install Treex::Core
For more information on module installation, please visit the detailed CPAN module installation guide.