Generated documentation for pml/PML_A.inc

PML_A

back

PML_A.mak - Miscellaneous macros for the analytic layer of Prague Dependency Treebank (PDT) 2.0.

TectogrammaticalTree()

This function is only available in TrEd (i.e. in GUI). After a previous call to AnalyticalTree, it switches current view back to a tectogrammatical tree which refers to the current analytical tree.

GetCoordMembers($node,$no_recurse)

If the given node is coordination or apposition (i.e. its afun is Coord or Apos) return a list of the corresponding coordination members (nodes with is_member flag set). Otherwise return the node itself.

Unless $no_recurse is true, the function is recursively applied to those members that are themselves Coord or Apos.

This function differs from ExpandCoord in handling coordination members below AuxP and AuxC. While this function returns the nodes with the is_member flag (i.e. the nodes below AuxP and AuxC), ExpandCoord returns the AuxP and AuxC nodes above them.

GetMember($node)

This is a helper function used to identify and reach the actual coordination or apposition members (carrying is_member flag) from child nodes of a Coord or Apos.

Given a node, return it if its is_member attribute is 1. If its afun is AuxC or AuxP, recurse to the child nodes. In all other cases return an empty list.

ExpandCoord($node,$keep?)

If the given node is coordination or apposition (according to its Analytical function - attribute afun) expand it to a list of coordinated nodes. Otherwise return the node itself. If the argument keep is true, include the coordination/apposition node in the list as well.

This function differs from GetCoordMembers in handling coordination members below AuxP and AuxC. Unlike the latter, it returns the AuxP and AuxC nodes above the actual coordination members.

IsMember($node)

This is a helper function used to identify coordination or apposition members among child nodes of a Coord or Apos. It returns 1 if the given node has is_member=1 or if it has afun=AuxC or AuxP and a child node for which IsMember (recursively called) returns 1. If neither of these two conditions is met, the function returns 0.

GetSentenceString($tree?)

Return string representation of the given tree (suitable for Analytical trees).

DiveAuxCP($node)

You can use this function as a through argument to GetEParents and GetEChildren. It skips all the prepositions and conjunctions when looking for nodes which is what you usually want.

GetEParents($node,$through)

Return linguistic parent of a given node as appears in an analytic tree. The argument $through should supply a function accepting one node as an argument and returning true if the node should be skipped on the way to parent or 0 otherwise. The most common DiveAuxCP is provided in this package.

GetEChildren($node,$dive)

Return a list of nodes linguistically dependant on a given node. $dive is a function which is called to test whether a given node should be used as a terminal node (in which case it should return false) or whether it should be skipped and its children processed instead (in which case it should return true). Most usual treatment is provided in DiveAuxCP. If $dive is skipped, a function returning 0 for all arguments is used.

ANodeToALexRf(a_node,t_node,t_file)

Adds given a-node's id to a/lex.rf of the given t-node and adjusts t_lemma of the t-node accordingly. The third argument t_file specifies the Treex::PML::Document object to which the given t-node belongs.

ANodeToAAuxRf(a_node,t_node,t_file)

Appends given a-node's id to a/aux.rf of the given t-node. The third argument t_file specifies the Treex::PML::Document object to which the given t-node belongs.

CreateStylesheets()

Creates default stylesheet for PML analytical files unless already defined. Most of the colors it uses can be redefined in the tred config file .tredrc by adding a line of the form

  CustomColorsomething = ...

The stylesheet is named PML_A and it has the following display features:

1.

sentence is displayed in CustomColorsentence. If the form was changed (e.g. because of a typo), the original form is displayed in CustomColorspell with overstrike.

2.

analytical function is displayed in CustomColorafun. If the node's is_member is set to 1, the type of the structure is indicated by Co (coordination) or Ap (apposition) in CustomColorcoappa. For is_parenthesis_root, Pa is displayed in the same color.