FoundationalNode¶
-
class
ucca.layer1.
FoundationalNode
(ID, root, tag, attrib=None, *, orderkey=<function edge_id_orderkey>)[source]¶ Bases:
ucca.core.Node
The basic building block of UCCA annotation, represents semantic units.
Each FoundationalNode (FNode for short) represents a semantic unit in the text, with relations to other semantic units. In essence, the FNodes form a tree of annotation, when remote units are ignored. This means that each FNode has exactly one FNode parent, and for completeness, there is also a “Passage Head” FNode which is the FNode parent of all parallel scenes and linkers in the top-level of the annotation.
Remote units are FNodes which are shared between two or more different FNodes, and hence have two FNode parents (participate in two relations). In such cases there is only one FNode parent, as the other Edges to parents are marked with the ‘remote’ attribute (set to True).
Implicit Nodes are ones which aren’t mentioned in the text, and hence doesn’t have any Terminal units in their span. In such cases, they will have an ‘implicit’ attribute set to True, and will take the position -1 (both start and end positions).
- Attributes:
participants: adverbials: connector: grounds: elaborators: centers: linkers: parallel_scenes: functions: punctuation: terminals:
a list of all FNodes under self whose edge tag is one of these types.process: state: time: relator:
Returns the FNode under self whose edge tag is one of these types, or None in case it isn’t found.start_position: end_position:
start/end position of the first/last terminal in the span of the FNode, without counting in remote FNodes. If the FNode is implicit or have no Terminals for some reason, returns -1 (both).- fparent: the FNode parent (FNode with incoming Edge, not remote) of
- this FNode. There is exactly one for each FNode except the Passage head, which returns None.
- ftag: the tag of the Edge connecting the fparent (as described above)
- with this FNode
discontiguous: whether this FNode has continuous Terminals or not
Attributes Summary
Methods Summary
get_sequences
()get_terminals
([punct, remotes, visited])Returns a list of all terminals under the span of this FoundationalNode. get_top_scene
()Returns the top-level scene this FNode is within, or None is_scene
()to_text
()Returns the text in the span of self, separated by spaces. Attributes Documentation
-
adverbials
¶
-
centers
¶
-
connector
¶
-
discontiguous
¶
-
elaborators
¶
-
end_position
¶
-
fparent
¶
-
ftag
¶
-
functions
¶
-
grounds
¶
-
linkers
¶
-
parallel_scenes
¶
-
participants
¶
-
process
¶
-
punctuation
¶
-
quantifiers
¶
-
relator
¶
-
start_position
¶
-
state
¶
-
terminals
¶
-
times
¶
Methods Documentation
-
get_terminals
(punct=True, remotes=False, visited=None)[source]¶ Returns a list of all terminals under the span of this FoundationalNode. :param punct: whether to include punctuation Terminals, defaults to True :param remotes: whether to include Terminals from remote FoundationalNodes, defaults to false :param visited: used to detect cycles :return: a list of
layer0
.Terminal objects