Grammar

From UNL Wiki
(Difference between revisions)
Jump to: navigation, search
m
Line 29: Line 29:
 
Rules are always composed of two fields: a condition and an action, which are separated by ":=". Rules must always be ended by a ";".
 
Rules are always composed of two fields: a condition and an action, which are separated by ":=". Rules must always be ended by a ";".
 
  CONDITION := ACTION;
 
  CONDITION := ACTION;
 +
The CONDITION and the ACTION fields may be expressed as follows:
 +
*by a constant, between "quotes"; (such as "a", "s", "into account", above);
 +
*by a lemma, between [brackets]; (such as [be], [have]);
 +
*by a feature, extracted from the [[tagset|UNDL Foundation tagset]]; (such as "VOW", "PLR", "MTW", "VA" above)
 
The CONDITION and the ACTION fields may be either simple or complex. Complex actions and conditions must be separated by ",".
 
The CONDITION and the ACTION fields may be either simple or complex. Complex actions and conditions must be separated by ",".
 
  SINGLE CONDITION := SINGLE ACTION;
 
  SINGLE CONDITION := SINGLE ACTION;
  CONDITION#1,CONDITION#2, ..., CONDITION#N := SINGLE ACTION;
+
  CONDITION#1,CONDITION#2, ..., CONDITION#n := SINGLE ACTION;
  CONDITION := ACTION#1, ACTION#2, ..., ACTION#N;
+
  CONDITION := ACTION#1, ACTION#2, ..., ACTION#n;
  CONDITION#1,CONDITION#2, ..., CONDITION#N := ACTION#1, ACTION#2, ..., ACTION#N;
+
  CONDITION#1,CONDITION#2, ..., CONDITION#n := ACTION#1, ACTION#2, ..., ACTION#n;
  
 
==
 
==

Revision as of 11:02, 21 March 2010

Grammar is the set of logical and structural rules that govern the composition of sentences, phrases and words in any given natural language. In the UNLarium framework, we distinguish three different types of rules according to the scope of their action:

  • Ph-rules (phonetic rules) apply over a form to provide alternations and sound changes (such as as assimilation and elision);
  • A-rules (affixation rules) apply over a form to generate its possible inflections by prefixation, infixation or suffixation; and
  • S-rules (syntactic rules) apply over a form to project or modify its syntactic structure by specification, complementation or adjunction.

Examples:

Type Rule Description Example
Ph-rule "a",>>VOW:="a">"an"; In case of "a" and before a blank space and a vowel, replace "a" by "an" a adjective > an adjective
A-rule PLR:=0>"s"; In case of plural (PLR), add "s" to the end of the word table > tables, boy > boys
S-rule MTW:=VA("into account"); In order to form the multiword expression, add "into account" as an adjunct to the verb (VA). take > take into account

Syntax

Rules are always composed of two fields: a condition and an action, which are separated by ":=". Rules must always be ended by a ";".

CONDITION := ACTION;

The CONDITION and the ACTION fields may be expressed as follows:

  • by a constant, between "quotes"; (such as "a", "s", "into account", above);
  • by a lemma, between [brackets]; (such as [be], [have]);
  • by a feature, extracted from the UNDL Foundation tagset; (such as "VOW", "PLR", "MTW", "VA" above)

The CONDITION and the ACTION fields may be either simple or complex. Complex actions and conditions must be separated by ",".

SINGLE CONDITION := SINGLE ACTION;
CONDITION#1,CONDITION#2, ..., CONDITION#n := SINGLE ACTION;
CONDITION := ACTION#1, ACTION#2, ..., ACTION#n;
CONDITION#1,CONDITION#2, ..., CONDITION#n := ACTION#1, ACTION#2, ..., ACTION#n;

==

Software