Grammar

From UNL Wiki
(Difference between revisions)
Jump to: navigation, search
Line 25: Line 25:
 
|take > take into account
 
|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 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;
 +
 +
==

Revision as of 11:56, 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 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