Grammar

From UNL Wiki
Revision as of 18:23, 26 March 2010 by Martins (Talk | contribs)
Jump to: navigation, search

Grammar is the set of logical or structural rules that govern the composition of sentences, phrases and words in any given natural language. In the UNLarium framework, we distinguish two main types of rules:

  • D-rules, or declaration rules, are used to make statements
  • T-rules, or transformation rules, are used to modify structures. They are further divided in:
    • A-rules (affixation rules) apply over isolated word forms (as to generate its possible inflections);
    • L-rules (linear rules) apply over lists of word forms (as to provide transformations in the surface structure such as contraction and elision);
    • S-rules (syntactic rules) apply over trees (as to modify the syntactic structure by specification, complementation or adjunction).

Examples:

Type Rule Description Example
D-rule @pl=PLR; The attribute @pl is equivalent to the dictionary feature PLR; (A,@pl) > (A,PLR)
A-rule PLR:=0>"s"; In case of plural (PLR), add "s" to the end of the word table > tables, boy > boys
L-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
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

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

  • A-rules must be used when the transformations apply over isolated forms to 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).
  • L-rules must be used when the transformations affect a linear sequence of isolated forms. The transformations are rather at the surface level and do not affect the structure of the phrase.
  • 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

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