NAME
Treex::Block::Util::Find - Finding nodes based on criteria specified by parameters
VERSION
version 2.20210102
SYNOPSIS
# 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-
DESCRIPTION
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
).
You can use "$." instead of "$this->" where $this is the current tree/node.
AUTHOR
Martin Popel <popel@ufal.mff.cuni.cz>
COPYRIGHT AND LICENSE
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.