D-rule
D-rules (declaration rules) are used to make statements inside the UNLarium framework. They are used to assign priorities (disambiguation rules), to map attributes and relations (mapping rules) and to state identities (replacement rules).
Contents |
Syntax
D-rules are always composed of two fields, which are separated by "=". They are always ended by a ";".
<DEFINIENDUM> = <DEFINIENS>;
Where:
- <DEFINIENDUM>, the term to be defined, may be:
- an attribute or a value of an attribute, of UNL (@pl, @male, @future) or of NL (POS, NOU, GEN, MCL, etc);
- a node, to be represented as a "string" (between parentheses) or as a [lemma] (between square brackets);
- a relation, either syntactic or semantic (such as "agt", "obj", "VS", "XP"), with the corresponding constituents; or
- a sequence of attributes, nodes and relations.
- <DEFINIENS>, the definition, may be:
- an attribute or a value of an attribute, of UNL (@pl, @male, @future) or of NL (POS, NOU, GEN, MCL, etc);
- a node, to be represented as a "string" (between parentheses) or as a [lemma] (between square brackets);
- a relation, either syntactic or semantic (such as "agt", "obj", "VS", "XP"), with the corresponding constituents;
- a sequence of attributes, nodes and relations; or
- a numeric value indicating the degree of certainty, ranging from 0 (=impossible) to 255 (=necessary).
Types of D-rule
There are three main types of D-rule:
- Disambiguation rules are used to state priorities.
- Mapping rules are used to state correspondences between UNL and NL.
- Replacement rules are used to state correspondences inside UNL or NL.
Disambiguation rules
Disambiguation rules are used to state priorities. They follow the general syntax:
<DEFINIENDUM> = VALUE;
Where <VALUE> is a numeric value that may range from 0 (impossible, or FALSE) to 255 (necessary). Disambiguation rules normally apply over the left side of L-rules and S-rules.
Examples of disambiguation rules
- ("the",ART)("a",ART)=0; (It's not possible that the article "a" follows the article "the")
- ("afraid",ADJ)(BLK)("of",PRE)=255; (It's absolutely necessary that the preposition "of" follows the adjective "afraid" after a blank space).
- VH(NOU)=0; (It's not possible that the head of a verbal phrase be a noun)
- VH(VER)=255; (It's absolutely necessary that the head of a verbal phrase be a verb)
Mapping rules
Mapping rules are used to state correspondences between UNL and NL. They follow the general syntax:
<DEFINIENDUM> = <DEFINIENS>;
Where <DEFINIENDUM> is an element of UNL and <DEFINIENS> is an element of NL, or vice-versa.
Examples of mapping rules
- From UNL to NL
- @pl = PLR;
- @past = PAS;
- @passive = PSV;
- @male = MCL;
- @past,@progressive = PAS,PGS;
- From NL to UNL
- PLR = @pl;
- PAS = @past
- MCL = @male
- PAS,PGS = @past.@progressive
Replacement rules
Replacement rules are used to state correspondences inside UNL or NL. They follow the general syntax:
<DEFINIENDUM> = <DEFINIENS>;
Where <DEFINIENDUM> and <DEFINIENS> are both elements of UNL, or are both elements of NL. Replacement rules are mainly used to avoid redundancy and unnecessary proliferation of rules.
Examples of replacement rules
- Inside UNL
@dual = @pl; (replace the attribute @dual by the attribute @pl)
- Inside NL
DUA = PLR; (replace the attribute DUA by the attribute PLR)