Difference between revisions of "SCI Parser Programmer's Reference/Said Syntax"
m (Collector moved page SCI Parser Programmer's Reference/Syntax to SCI Parser Programmer's Reference/Said Syntax without leaving a redirect) |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
[[SCI Parser Programmer's Reference/User Parse Trees|2]] | | [[SCI Parser Programmer's Reference/User Parse Trees|2]] | | ||
[[SCI Parser Programmer's Reference/Said Specs|3]] | | [[SCI Parser Programmer's Reference/Said Specs|3]] | | ||
− | [[SCI Parser Programmer's Reference/Syntax|4]] | | + | [[SCI Parser Programmer's Reference/Said Syntax|4]] | |
− | [[SCI Parser Programmer's Reference/Spec Trees|5]] | | + | [[SCI Parser Programmer's Reference/Said Spec Trees|5]] | |
[[SCI Parser Programmer's Reference/Tree Matching|6]] | | [[SCI Parser Programmer's Reference/Tree Matching|6]] | | ||
[[SCI Parser Programmer's Reference/Examples|7]] | | [[SCI Parser Programmer's Reference/Examples|7]] | | ||
Line 19: | Line 19: | ||
| | ||
− | -- | + | ==<br /> Said syntax == |
+ | |||
+ | Said-specs are written in a sub-language with its own syntax and operators to produce expressions not unlike those we use for arithmetic. | ||
+ | |||
+ | The main concept implemented by the "Said-er" is: | ||
+ | |||
+ | ===<br /> VERB/DIRECT OBJECT/INDIRECT OBJECT === | ||
+ | |||
+ | Note that the slash is a part of the description of a dobj or iobj, not a detached separator. | ||
+ | |||
+ | Each part can be made OPTIONAL by enclosing it in brackets. This is also true for any subpart. Thus 'look [ /rock ]' means a phrase with verb 'look' and an optional direct object that should be 'rock' if present. Note that the slash is INSIDE the brackets. | ||
+ | |||
+ | ===<br /> MODIFIERS: === | ||
+ | |||
+ | Signaled using "<", a given root can have multiple modifiers as in "sit down on bed" which can be specified by 'sit<down<on/bed' since the two prepositions are modifiers to the verb. | ||
+ | |||
+ | In general, adverbs and prepositions modify verbs, adjectives modify nouns or other adjectives and nouns modify other nouns. | ||
+ | |||
+ | ===<br /> ALTERNATIVES: === | ||
+ | |||
+ | Let's say we want to respond the same way to either | ||
+ | "start the car" and | ||
+ | "turn on the car" | ||
+ | this can be done with OR alternatives: | ||
+ | 'start,(turn<on)/car' | ||
+ | |||
+ | The comma means "OR". Notice the parenthesis surrounding turn<on; they are required because "," has higher PRECEDENCE than "<". This is just like common arithmetic expressions, as in 2*3+4 versus 2*(3+4) where the parenthesis make the difference between getting 10 or 14 because "*" has higher precedence than "+" | ||
| | ||
Line 33: | Line 59: | ||
<span style="float: left">[[SCI Parser Programmer's Reference/Said Specs|< Previous: Said Specs]]</span> | <span style="float: left">[[SCI Parser Programmer's Reference/Said Specs|< Previous: Said Specs]]</span> | ||
− | <span style="float: right">[[SCI Parser Programmer's Reference/Spec Trees|Next: Spec Trees >]]</span> | + | <span style="float: right">[[SCI Parser Programmer's Reference/Said Spec Trees|Next: Said Spec Trees >]]</span> |
| |
Latest revision as of 02:27, 22 December 2015
Said syntax
Said-specs are written in a sub-language with its own syntax and operators to produce expressions not unlike those we use for arithmetic.
The main concept implemented by the "Said-er" is:
VERB/DIRECT OBJECT/INDIRECT OBJECT
Note that the slash is a part of the description of a dobj or iobj, not a detached separator.
Each part can be made OPTIONAL by enclosing it in brackets. This is also true for any subpart. Thus 'look [ /rock ]' means a phrase with verb 'look' and an optional direct object that should be 'rock' if present. Note that the slash is INSIDE the brackets.
MODIFIERS:
Signaled using "<", a given root can have multiple modifiers as in "sit down on bed" which can be specified by 'sit<down<on/bed' since the two prepositions are modifiers to the verb.
In general, adverbs and prepositions modify verbs, adjectives modify nouns or other adjectives and nouns modify other nouns.
ALTERNATIVES:
Let's say we want to respond the same way to either "start the car" and "turn on the car" this can be done with OR alternatives: 'start,(turn<on)/car'
The comma means "OR". Notice the parenthesis surrounding turn<on; they are required because "," has higher PRECEDENCE than "<". This is just like common arithmetic expressions, as in 2*3+4 versus 2*(3+4) where the parenthesis make the difference between getting 10 or 14 because "*" has higher precedence than "+"
- Notes
< Previous: Said Specs Next: Said Spec Trees >