Difference between revisions of "SCI/Specifications/SCI in action/Parser"

Jump to navigation Jump to search
(→‎Matching the trees: Changed to use <math>, made SCI-AUGMENT algorithm readable.)
Line 332: Line 332:
====Example: Parser example====
====Example: Parser example====
Parse is called with <i>"open door"</i>.
Parse is called with <i>"open door"</i>.
* <i>"open" &isin; &lang;842,{C<sub>80</sub>}&rang;</i> (an imperative word of the word group 0x842)
* <math>\textrm{"open"} \in \langle 842, \{ C_{80} \} \rangle</math> (an imperative word of the word group 0x842)
* <i>"door" &isin; &lang;917,{C<sub>10</sub>}&rang; (a substantive of the word group 0x917)</i>
* <math>\textrm{"door"} \in \langle 917, \{ C_{10} \} \rangle</math> (a substantive of the word group 0x917)
* <i>I = &lang;842,{C<sub>80</sub>}&rang;,&lang;917,{C<sub>10</sub>}&rang;</i>
* <math>I = \langle 842, \{C_{80} \} \rangle, \langle 917, \{C_{10} \} \rangle</math>


<i>I</i> is clearly accepted by automatons based on the grammar described above, There are two possible derivations:
<math>I</math> is clearly accepted by automatons based on the grammar described above, There are two possible derivations:


{|
{|
|D<sub>0</sub> = 13c
|colspan="2" align="center"| D<sub>0</sub> = 13c
|width="50em"|&nbsp;
|colspan="2" align="center"| D<sub>1</sub> = 13c
|----
|----
|(13c &#8614; 13b134)
|(13c &#8614; 13b 134)
|&#8866; 13b 134
|&#8866; 13b 134
|
|(13c &#8614; 13b)
|&#8866; 13b
|----
|----
|(13b &#8614; 131)
|(13b &#8614; 131)
|&#8866; 131 134
|
|(13b &#8614; 131 134)
|&#8866; 131 134
|&#8866; 131 134
|----
|----
|(131 &#8614; C<sub>80</sub>
|&#8866; C<sub>80</sub> 134
|
|(131 &#8614; C<sub>80</sub>
|(131 &#8614; C<sub>80</sub>
|&#8866; C<sub>80</sub> 134
|&#8866; C<sub>80</sub> 134
Line 352: Line 363:
|(134 &#8614; C<sub>10</sub>
|(134 &#8614; C<sub>10</sub>
|&#8866; C<sub>80</sub> C<sub>10</sub>
|&#8866; C<sub>80</sub> C<sub>10</sub>
|----
|
|}
 
<br>
 
{|
|D<sub>1</sub> = 13c
|----
|(13c &#8614; 13b)
|&#8866; 13b
|----
|(13b &#8614; 131134)
|&#8866; 131 134
|----
|(131 &#8614; C<sub>80</sub>
|&#8866; C<sub>80</sub> 134
|----
|(134 &#8614; C<sub>10</sub>
|(134 &#8614; C<sub>10</sub>
|&#8866; C<sub>80</sub> C<sub>10</sub>
|&#8866; C<sub>80</sub> C<sub>10</sub>
|----
|----
|}
|}


====Example: Semantic tree example====
====Example: Semantic tree example====
1,079

edits

Navigation menu