Difference between revisions of "SCI Parser Programmer's Reference/Said Syntax"

From SCI Wiki
Jump to navigationJump to search
 
(One intermediate revision by the same user not shown)
Line 19: Line 19:
 
 
 
 
  
-- content here --
+
==<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 "+"
  
 
&nbsp;
 
&nbsp;

Latest revision as of 02:27, 22 December 2015

Official SCI Documentation

Chapter: 1 | 2 | 3 | 4 | 5 | 6 | 7 | Index


Said Syntax

Author: Pablo Ghenis

Date: 21 July 1988 9:56:56 am

 


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


 

Table of Contents

 

< Previous: Said Specs Next: Said Spec Trees >