Grammar
Line 7: | Line 7: | ||
**'''[[S-rule]]s''' (syntactic rules) apply over trees (as to modify the syntactic structure by specification, complementation or adjunction). | **'''[[S-rule]]s''' (syntactic rules) apply over trees (as to modify the syntactic structure by specification, complementation or adjunction). | ||
− | |||
{|border=1 cellpadding=2 align=center | {|border=1 cellpadding=2 align=center | ||
+ | |+Examples of Grammar Rules | ||
!Type | !Type | ||
!Rule | !Rule | ||
Line 48: | Line 48: | ||
== When to use T-rules == | == When to use T-rules == | ||
T-rules are used for changes, and vary according to the scope of the changes: | T-rules are used for changes, and vary according to the scope of the changes: | ||
− | *'''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). | + | *'''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. | + | *'''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. | + | *'''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. |
Revision as of 17:33, 26 March 2010
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).
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 |
Syntax
D-rules are defined by the general syntax:
<DEFINIENDUM> = <DEFINIENS>;
While T-rules are defined as:
<CONDITION> := <ACTION>;
Both rules always end in a semicolon (";"). Special symbols and notation apply in each case. For further information, see D-rules, A-rules, L-rules or S-rules.
When to use D-rules
D-rules must be used to make statements (and not changes). They do not provoke any transformation. They are used mainly to assign priorities, to map attributes and relations from UNL into NL, and from NL into UNL, and to avoid redundancy in grammar writing.
When to use T-rules
T-rules are used for changes, and vary according to the scope of the changes:
- 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.