Grammar

From UNL Wiki
Revision as of 11:40, 22 March 2010 by Martins (Talk | contribs)
Jump to: navigation, search

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 spelling changes (such as contraction 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 ("I")(BLK)("am"):=("I'm"); In case of "I" before a blank space and "am", replace "I" by "I'm" I am > I'm
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 "I", "am", "s", "into account");
  • by a lemma, between [brackets]; (such as [be], [have]);
  • by a feature, extracted from the UNDL Foundation tagset; (such as BLK, PLR, MTW, VA).

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;

Special symbols and notation apply in each case. For further information, see Ph-rules, A-rules or S-rules.

When to use Ph-rules, A-rules or S-rules

  • Ph-rules must be used when the transformations affect isolated characters or isolated strings of characters. The transformations are rather at the surface level and do not affect the structure of the word or of the phrase.
  • A-rules must be used when the transformations generate inflections of the base form. They should be used only when the transformations may be expressed by prefixation, infixation or suffixation. In any case, the transformation must affect only the structure of the word, but the structure of the phrase is to be preserved. In that sense, a-rules must never be used when a new word is introduced in the syntactic structure (as in the formation of compounds).
  • S-rules must be used when the transformations affect the structure of the phrase, as in the generation of compounds (including compound tenses and periphrastic constructions). They are also used to describe syntactic behaviour such as word order, agreement and government.

Observations

Ph-rules and A-rules do not generate new words but only modify the existing ones.
The A-rule "FUT:="will"<<0;" (i.e, generate "will" as a prefix to the base form in case of future) will transform "love" into "will love", which will be considered, however, as a single word and not as a compound. Notice that this is the reason why compound tenses must never be generated through A-rules; otherwise, it would never be possible to generate other words (such as "not", "always", etc) between "will" and "love".
Software