D-rule

From UNL Wiki
(Difference between revisions)
Jump to: navigation, search
(New page: == D-rules == D-rules are always composed of two fields, which are separated by "=". They are always ended by a ";". <DEFINIENDUM> = <DEFINIENS>; Where:<br /> *<DEFINIENDUM>, the term to ...)
 
Line 1: Line 1:
== D-rules ==
+
'''D-rules''' (declaration rules) are used to make statements inside the UNL<sup>arium</sup> framework. They are used to assign priorities (disambiguation rules), to map attributes and relations (mapping rules) and to state identities (replacement rules).
 +
 
 +
== Syntax ==
 
D-rules are always composed of two fields, which are separated by "=". They are always ended by a ";".
 
D-rules are always composed of two fields, which are separated by "=". They are always ended by a ";".
 
  <DEFINIENDUM> = <DEFINIENS>;
 
  <DEFINIENDUM> = <DEFINIENS>;
Line 15: Line 17:
 
**a numeric value indicating the degree of certainty, ranging from 0 (=impossible) to 255 (=necessary).
 
**a numeric value indicating the degree of certainty, ranging from 0 (=impossible) to 255 (=necessary).
  
== Syntax ==
+
== Types of D-rule ==
Rules are always composed of two fields: a condition and an action, which are separated by ":=". Rules must always be ended by a ";".
+
There are three main types of D-rule:
  CONDITION := ACTION;
+
*'''Disambiguation rules''' are used to state priorities.
The CONDITION and the ACTION fields may be expressed as follows:
+
*'''Mapping rules''' are used to state correspondences between UNL and NL.
*by a constant, between "quotes"; (such as "I", "am", "s", "into account");
+
*'''Replacement rules''' are used to state correspondences inside UNL or NL.
*by a lemma, between [brackets]; (such as [be], [have]);
+
 
*by a feature, extracted from the [[tagset|UNDL Foundation tagset]]; (such as BLK, PLR, MTW, VA).
+
=== Disambiguation rules ===
The CONDITION and the ACTION fields may be either simple or complex. Complex actions and conditions must be separated by ",":
+
Disambiguation rules are used to state priorities. They follow the general syntax:
  SINGLE CONDITION := SINGLE ACTION;
+
  <DEFINIENDUM> = VALUE;
CONDITION#1,CONDITION#2, ..., CONDITION#n := SINGLE ACTION;
+
Where <VALUE> is a numeric value that may range from 0 (impossible, or FALSE) to 255 (necessary).
CONDITION := ACTION#1, ACTION#2, ..., ACTION#n;
+
Disambiguation rules normally apply over the left side of [[L-rule]]s and [[S-rule]]s.
CONDITION#1,CONDITION#2, ..., CONDITION#n := ACTION#1, ACTION#2, ..., ACTION#n;
+
 
Special symbols and notation apply in each case. For further information, see [[Ph-rule]]s, [[A-rule]]s or [[S-rule]]s.
+
==== 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)

Revision as of 18:11, 26 March 2010

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)

Software