# Generated documentation for pml/PML_T.inc

# PML_T

back

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

AFile($fsfile?)

  Return analytical file associated with a given (tectogrammatical) file. If no file is given, the current file is assumed.

GetANodeIDs($node?)

  Returns a list of IDs of analytical nodes referenced from a given tectogrammatical node. If no node is given, the function applies to `$this`.

GetANodeREFs($node?)

  Returns a list of PMLREFs of analytical nodes referenced from a given tectogrammatical node. If no node is given, the function applies to `$this`. This function is similar to `GetANodeIDs()` but it doesn't strip the file-ref part of the reference.

GetANodes($node?,$fsfile?)

  Returns a list of analytical nodes referenced from a given tectogrammatical node. This combines references from a/tree.rf (root-node), a/aux.rf and a/lex.rf (non-root nodes). If no node is given, the function applies to `$this`. If the node belongs to other file than the current file, the optional second argument must specify the corresponding FSFile object.

GetALexNode($node?)

  Returns an analytical node referenced from a/lex.rf attribute of a given tectogrammatical node. If no node is given, the function applies to `$this`.

GetAAuxNodes($node?)

  Returns a list of analytical nodes referenced from a/aux.rf attribute of a given tectogrammatical node. If no node is given, the function applies to `$this`.

GetANodeByID($id_or_ref,$fsfile?)

  Looks up an analytical node by its ID (or PMLREF - i.e. the ID preceded by a file prefix of the form `a#`). This function only works if the current file is a tectogrammatical file and the requested node belongs to an analytical file associated with it.

GetANodesHash()

  Return a reference to a hash indexing analytical nodes of the analytical file associated with the current tectogrammatical file. If such a hash was not yet created, it is created upon the first call to this function (or other functions calling it, such as `GetANodes` or `GetANodeByID`.

ClearANodesHash()

  Clear the internal hash indexing analytical nodes of the analytical file associated with the current tectogrammatical file.

AnalyticalTree()

  This function is only available in TrEd (i.e. in GUI). It switches current view to an analytical tree associated with a currently displayed tectogrammatical tree.

DrawCorefArrows()

  Called from `node_style_hook`. Draws coreference arrows using following properties: textual arrows in CustomColor `arrow_textual`, grammatical in <arrow_grammatical> (and dashed in Full stylesheet), complement arrow in `arrow_compl` (and dot-dashed in Full stylesheet), segment arrow in `arrow_segm` and exophora arrow in `arrow_exoph`.

IsCoord($node?)

  Check if the given node is a coordination according to its TGTS functor (attribute `functor`)

ExpandCoord($node,$keep?)

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

GetSentenceString($tree?)

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

GetEParents($node)

  Return linguistic parents of a given node as appear in a TG tree.

GetEChildren($node?)

  Return a list of nodes linguistically dependant on a given node.

GetEDescendants($node?)

  Return a list of all nodes linguistically subordinated to a given node (not including the node itself).

GetEAncestors($node?)

  Return a list of all nodes linguistically superordinated to (ie governing) a given node (not including the node itself).

GetESiblings($node?)

  Return linguistic siblings of a given node as appears in a tectogrammatic tree. This doesn't include the node itself, neither those children of the node's linguistic parent that are in coordination with the node.

GetNearestNonMember($node?)

  If the node is not a member of a coordination, return the node. If it is a member of a coordination, return the node representing the highest coordination $node is a member of.

IsFiniteVerb($node?)

  If the node is the head of a finite complex verb form (based on `m/tag` of the referenced analytical nodes), return 1, else return 0.

IsPassive($node?)

  If the node is the head of a passive-only verb form, (based on `m/tag` of the referenced analytical nodes), return 1, else return 0.

IsInfinitive($node?)

  If the node is the head of an infinitive complex verb form, (based on `m/tag` of the referenced analytical nodes), return 1, else return 0.

IsModalVerbLemma($lemma)

  Return 1 if trlemma is a member of the list of all possible modal verb lemmas (morfological lemma suffixes (/[-`_].*/) are ignored).

ModalVerbLemma($lemma)

  Deprecated alias for IsModalVerbLemma

CreateStylesheets()

  Creates default stylesheets for PML tectogrammatic files unless already defined. Most of the colors they use can be redefined in the tred config file `.tredrc` by adding a line of the form

        CustomColorsomething = ...

  Default values can be found in `PML.mak`. The stylesheets are named `PML_T_Compact` and `PML_T_Full`. Compact stylesheet is suitable to be used on screen because it pictures many features by means of colours whilst the Full stylesheet is better for printing because it lists the values of almost all the attributes.

  The stylesheets have the following features (if the stylesheet is not mentioned, the description talks about the Compact one):

  1.

    `t_lemma` is displayed on the first line. If the node's `is_parenthesis` is set to 1, the `t_lemma` is displayed in CustomColor `parenthesis` in the Compact stylesheet. If the node's `sentmod` is non-empty, its value is displayed in CustomColor `detail` after a dot. If there is a coreference leading to a different sentence, the `t_lemma` of the refered node is displayed in CustomColor `coref`, too.

  2.

    Node's functor is displayed in CustomColor `func`. If the node's `subfunctor` or `is_state` are defined, they are indicated in CustomColor `subfunc`. In the Full stylesheet, `is_member` is also displayed as "M" in CustomColor `coappa` and `is_parenthesis` as "P" in CustomColor `parenthesis`.

  3.

    For nodes of all types other than complex, `nodetype` is displayed in CustomColor `nodetype`. For complex nodes, their `gram/sempos` is displayed in CustomColor `complex`. In the Full stylesheet, all the non-empty values of grammatemes are listed in CustomColor `detail`, and for ambiguous values the names of the attributes are displayed in CustomColor `detailheader`.

  4.

    Generated nodes are displayed as squares, non-generated ones as ovals.

  5.

    Current node is displayed as bigger and with outline in CustomColor `current`.

  6.

    Edges from nodes to roots or from nodes with `functor` `PAR, PARTL, VOCAT, RHEM, CM, FPHR,` and `PREC` to their parents are thin, dashed and have the CustomColor `line_normal`. Edges from coordination heads with `is_member` are thin and displayed in CustomColor `line_member`. Edges from other nodes with `is_member` to their coordination parents are displayed with the lower half thick in CustomColor `line_normal` and upper half thin in CustomColor `line_member`. Edges from nodes without `is_member` to their coordination parents are displayed thin in CustomColor `line_comm`. Edges from coordination nodes without `is_member` to their parents are displayed with the lower half thin in CustomColor `line_member` and upper half thick in CustomColor `line_normal`. All other edges are displayed half-thick in CustomColor `line_normal`.

  7.

    The attribute `tfa` is reflected by the colour of the node. CustomColors `tfa_c, tfa_f, tfa_c`, and `tfa_no` are used. In the Full stylesheet, the value is also displayed before the functor in `tfa_text`.

  8.

    Attributes `gram, is_dsp_root, is_name_of_person,` and `quot` are listed in the hint box when the mouse cursor is over the node. In the Full stylesheet, they are diplayed at the last line in CustomColor `detail` (see 3).

DeleteNode(node?)

  Deletes $node or $this, attaches all its children to its parent and recounts deepord. Cannot be used for the root.

DeleteSubtree(node?)

  Deletes $node or $this and its whole subtree and recounts deepord. Cannot be used for the root.

NewNode(node?,id?)

  Add new node as a son of the given node or current node, initializes the new node using InitNode. If id is specified, it is assigned to the new node. Otherwise, a unique ID is computed and assigned to the node using NewID. Not all the required attributes are being set!

InitNode(node,obj?)

  Initialize already existing FSNode object as a t-node by associating it with t-node PML schema type. If the node belongs to a different file than the current one, the FSFile or some already initialized node of that file must be specified as the second argument. Returns the initialized node.

NewID(node?)

  Tries to compute a new unique ID based on the ID's in the tree to which the given node belongs. If no node is specified, the global variable $root is used. Returns the computed ID.

OpenValFrameList(node?,options...)

  Open a window with a list of possible valency frames for a given node, highlighting frames currently assigned to the node. All given options are passed to the approporiate ValLex::GUI method. Most commonly used are `-no_assign => 1` to suppress the Assign button, `-assign_func => sub { my ($node,$frame_ids,$frame_text)=@_; ... }` to specify a custom code for assigning the selected frame_ids to a node, `-lemma` and `-pos` to override t_lemma and sempos of the node, `-frameid` to frames currently assigned to the node, `-noadd =` 1> to forbid adding new words to the lexicon (also implied by `-no-assign`.

OpenValLexicon(options...)

  Open valency lexicon editor/browser GUI. All given options are passed to the approporiate ValLex::GUI method. Most commonly used are `-lemma` and `-pos` to override t_lemma and sempos of the node and `-frameid` to frames currently assigned to the node.