Basic classes and functions for semantic representations.
Return a representation of role priority for ordering.
Return a representation of property priority for ordering.
The ordering provided by this function was modeled on the ERG and Jacy grammars and may be inaccurate for others. Properties not known to this function will be sorted alphabetically.
Predication(id, predicate, type, lnk, surface, base)¶
An instance of a predicate in a semantic structure.
While a predicate (see
delphin.predicate) is a description of a possible semantic entity, a predication is the instantiation of a predicate in a semantic structure. Thus, multiple predicates with the same form are considered the same thing, but multiple predications with the same predicate will have different identifiers and, if specified, different surface alignments.
SemanticStructure(top, predications, lnk, surface, identifier)¶
A basic semantic structure.
DELPH-IN-style semantic structures are rooted DAGs with flat lists of predications.
top – identifier for the top of the structure
predications – list of predications in the structure
identifier – a discourse-utterance identifier
identifier for the top of the structure
list of predications in the structure
a discourse-utterance identifier
Return a mapping of the argument structure.
types – an iterable of predication types to include
expressed – if
True, only include arguments to expressed predications; if
False, only include those unexpressed; if
None, include both
A mapping of predication ids to lists of (role, target) pairs for outgoing arguments for the predication.
Trueif id represents a quantifier.
Return the morphosemantic properties for id.
Return a list of (Quantifiee, Quantifier) pairs.
Both the Quantifier and Quantifiee are
Predicationobjects, unless they do not quantify or are not quantified by anything, in which case they are
None. In well-formed and complete structures, the quantifiee will never be
>>> [(p.predicate, q.predicate) ... for p, q in m.quantification_pairs()] [('_dog_n_1', '_the_q'), ('_bark_v_1', None)]