PML.mak - Miscelaneous macros of general use in Prague Dependency Treebank (PDT) 2.0
SchemaName()
adata
for analytical layer annotation
and tdata
for tectogrammatical layer annotation.SchemaDescription()
description
of
the PML schema associated with the current file.Schema($object?)
The PML schema is returned in form of a Fslib::Schema object.
GetNodeByID($id_or_ref,$fsfile?)
xy#
).SearchForNodeById()
GetNodeHash($fsfile?)
GetNodeByID
. Use
clearNodeHash
to clear the hash.ClearNodesHash($fsfile?)
GotoTree()
PML_T.mak - Miscellaneous macros for the tectogrammatic layer of Prague Dependency Treebank (PDT) 2.0.
AFile($fsfile?)
GetANodeIDs($node?)
$this
.GetANodeREFs($node?)
$this
. This function is similar to GetANodeIDs()
but it doesn't
strip the file-ref part of the reference.GetANodes($node?)
$this
.GetANodeByID($id_or_ref)
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()
GetANodes
or GetANodeByID
.ClearANodesHash()
AnalyticalTree()
DrawCorefArrows()
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?)
functor
)ExpandCoord($node,$keep?)
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?)
GetEParents($node)
GetEChildren($node?)
GetEDescendants($node?)
GetEAncestors($node?)
GetESiblings($node?)
GetNearestNonMember($node?)
IsFiniteVerb($node?)
m/tag
of the referenced analytical nodes), return 1,
else return 0.IsPassive($node?)
m/tag
of the referenced analytical nodes), return 1,
else return 0.IsInfinitive($node?)
m/tag
of the referenced analytical nodes),
return 1, else return 0.ModalVerbLemma($lemma)
CreateStylesheets()
.tredrc
by adding a line of the
formCustomColorsomething = ...
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?)
DeleteSubtree(node?)
NewNode(node?,id?)
InitNode(node,obj?)
NewID(node?)
OpenValFrameList(node?,options...)
-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...)
-lemma
and -pos
to override t_lemma
and sempos of the node and -frameid
to frames
currently assigned to the node.PML_T_Edit.mak - Miscellaneous macros for editing the tectogrammatic layer of Prague Dependency Treebank (PDT) 2.0.
AddCoref(node,target,coref)
$coref
, make the reference, else delete the
reference.RememberNode()
text_arrow_to_remembered
.MarkForARf()
PML_A_Edit::AddThisToA...
you can make links between
the layers.PML_T_View.mak - Miscellaneous macros for the viewing tectogrammatic layer of Prague Dependency Treebank (PDT) 2.0.
PML_A.mak - Miscellaneous macros for the analytic layer of Prague Dependency Treebank (PDT) 2.0.
TectogrammaticalTree()
AnalyticalTree
, it switches
current view back to a tectogrammatical tree which refers to the
current analytical tree.ExpandCoord($node,$keep?)
afun
) 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?)
DiveAuxCP($node)
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)
$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)
$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)
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
FSFile
object to which the given t-node belongs.ANodeToAAuxRf(a_node,t_node,t_file)
id
to a/aux.rf
of the given t-node. The third argument t_file specifies the
FSFile
object to which the given t-node belongs.CreateStylesheets()
.tredrc
by adding a line of the
formCustomColorsomething = ...
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.
PML_A_Edit.mak - Miscellaneous macros for editing the analytic layer of Prague Dependency Treebank (PDT) 2.0.
AddThisToALexRf()
PML_T_Edit::MarkForARf
, adds this node's
id
to a/lex.rf
list of the marked
tectogrammatical node.AddThisToAAuxRf()
PML_T_Edit::MarkForARf
, adds this node's
id
to a/aux.rf
list of the marked
tectogrammatical node.RemoveThisFromARf()
PML_T_Edit::MarkForARf
, remove this node's
id
from a/lex.rf
and
a/aux.rf
of the marked tectogrammatical node.PML_A_View.mak - Miscellaneous macros for viewing the analytic layer of Prague Dependency Treebank (PDT) 2.0.