1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-01 06:24:58 +03:00

Documenting the linguistics module

This commit is contained in:
Graham Nelson 2020-07-20 11:30:03 +01:00
parent d39ba63b33
commit e612cbd789
58 changed files with 2270 additions and 1426 deletions

View file

@ -83,7 +83,6 @@ some new node types:
<pre class="definitions code-font"><span class="definition-keyword">enum</span> <span class="constant-syntax">verbal_certainty_ANNOT</span><span class="plain-syntax"> </span><span class="comment-syntax"> </span><span class="extract"><span class="extract-syntax">int</span></span><span class="comment-syntax">: certainty level if known</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">sentence_is_existential_ANNOT</span><span class="plain-syntax"> </span><span class="comment-syntax"> </span><span class="extract"><span class="extract-syntax">int</span></span><span class="comment-syntax">: such as "there is a man"</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">linguistic_error_here_ANNOT</span><span class="plain-syntax"> </span><span class="comment-syntax"> </span><span class="extract"><span class="extract-syntax">int</span></span><span class="comment-syntax">: one of the errors occurred here</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">inverted_verb_ANNOT</span><span class="plain-syntax"> </span><span class="comment-syntax"> </span><span class="extract"><span class="extract-syntax">int</span></span><span class="comment-syntax">: an inversion of subject and object has occurred</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">possessive_verb_ANNOT</span><span class="plain-syntax"> </span><span class="comment-syntax"> </span><span class="extract"><span class="extract-syntax">int</span></span><span class="comment-syntax">: this is a non-relative use of "to have"</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">verb_ANNOT</span><span class="plain-syntax"> </span><span class="comment-syntax"> </span><span class="extract"><span class="extract-syntax">verb_usage</span></span><span class="comment-syntax">: what's being done here</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">noun_ANNOT</span><span class="plain-syntax"> </span><span class="comment-syntax"> </span><span class="extract"><span class="extract-syntax">noun_usage</span></span><span class="comment-syntax">: what's being done here</span>
@ -150,7 +149,6 @@ nodes and annotations correctly:
<span class="plain-syntax"> </span><span class="identifier-syntax">Annotations::allow</span><span class="plain-syntax">(</span><span class="constant-syntax">VERB_NT</span><span class="plain-syntax">, </span><span class="constant-syntax">verbal_certainty_ANNOT</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">Annotations::allow</span><span class="plain-syntax">(</span><span class="constant-syntax">VERB_NT</span><span class="plain-syntax">, </span><span class="constant-syntax">sentence_is_existential_ANNOT</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">Annotations::allow</span><span class="plain-syntax">(</span><span class="constant-syntax">VERB_NT</span><span class="plain-syntax">, </span><span class="constant-syntax">possessive_verb_ANNOT</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">Annotations::allow</span><span class="plain-syntax">(</span><span class="constant-syntax">VERB_NT</span><span class="plain-syntax">, </span><span class="constant-syntax">inverted_verb_ANNOT</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">Annotations::allow</span><span class="plain-syntax">(</span><span class="constant-syntax">VERB_NT</span><span class="plain-syntax">, </span><span class="constant-syntax">verb_ANNOT</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">Annotations::allow</span><span class="plain-syntax">(</span><span class="constant-syntax">VERB_NT</span><span class="plain-syntax">, </span><span class="constant-syntax">preposition_ANNOT</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">Annotations::allow</span><span class="plain-syntax">(</span><span class="constant-syntax">VERB_NT</span><span class="plain-syntax">, </span><span class="constant-syntax">second_preposition_ANNOT</span><span class="plain-syntax">);</span>
@ -184,20 +182,21 @@ is used by <a href="../linguistics-test/index.html" class="internal">linguistics
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Node::get_verb</span><span class="plain-syntax">(</span><span class="identifier-syntax">pn</span><span class="plain-syntax">))</span>
<span class="plain-syntax"> </span><a href="3-vu.html#SP2" class="function-link"><span class="function-syntax">VerbUsages::write_usage</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">Node::get_verb</span><span class="plain-syntax">(</span><span class="identifier-syntax">pn</span><span class="plain-syntax">));</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Annotations::read_int</span><span class="plain-syntax">(</span><span class="identifier-syntax">pn</span><span class="plain-syntax">, </span><span class="constant-syntax">sentence_is_existential_ANNOT</span><span class="plain-syntax">))</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" (existential)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" {existential}"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Annotations::read_int</span><span class="plain-syntax">(</span><span class="identifier-syntax">pn</span><span class="plain-syntax">, </span><span class="constant-syntax">possessive_verb_ANNOT</span><span class="plain-syntax">))</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" (possessive)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Annotations::read_int</span><span class="plain-syntax">(</span><span class="identifier-syntax">pn</span><span class="plain-syntax">, </span><span class="constant-syntax">inverted_verb_ANNOT</span><span class="plain-syntax">))</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" (inverted)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" {possessive}"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Node::get_verb_meaning</span><span class="plain-syntax">(</span><span class="identifier-syntax">pn</span><span class="plain-syntax">))</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" rel:%S"</span><span class="plain-syntax">, </span><a href="3-vm.html#SP11" class="function-link"><span class="function-syntax">VerbMeanings::get_regular_meaning</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">Node::get_verb_meaning</span><span class="plain-syntax">(</span><span class="identifier-syntax">pn</span><span class="plain-syntax">))-&gt;</span><span class="identifier-syntax">debugging_log_name</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" {meaning: %S}"</span><span class="plain-syntax">,</span>
<span class="plain-syntax"> </span><a href="3-vm.html#SP11" class="function-link"><span class="function-syntax">VerbMeanings::get_regular_meaning</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">Node::get_verb_meaning</span><span class="plain-syntax">(</span><span class="identifier-syntax">pn</span><span class="plain-syntax">))-&gt;</span><span class="identifier-syntax">debugging_log_name</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Annotations::read_int</span><span class="plain-syntax">(</span><span class="identifier-syntax">pn</span><span class="plain-syntax">, </span><span class="constant-syntax">verbal_certainty_ANNOT</span><span class="plain-syntax">) != </span><span class="constant-syntax">UNKNOWN_CE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" certainty:"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" {certainty:"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><a href="3-aoc.html#SP3" class="function-link"><span class="function-syntax">Certainty::write</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">Annotations::read_int</span><span class="plain-syntax">(</span><span class="identifier-syntax">pn</span><span class="plain-syntax">, </span><span class="constant-syntax">verbal_certainty_ANNOT</span><span class="plain-syntax">));</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"}"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> }</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Node::get_occurrence</span><span class="plain-syntax">(</span><span class="identifier-syntax">pn</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" occurrence:"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" {occurrence: "</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><a href="3-apoo.html#SP4" class="function-link"><span class="function-syntax">Occurrence::log</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">Node::get_occurrence</span><span class="plain-syntax">(</span><span class="identifier-syntax">pn</span><span class="plain-syntax">));</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"}"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> }</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">UNPARSED_NOUN_NT:</span>
@ -213,7 +212,7 @@ is used by <a href="../linguistics-test/index.html" class="internal">linguistics
<span class="plain-syntax"> </span><a href="2-art.html#SP3" class="function-link"><span class="function-syntax">Articles::write_usage</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">Node::get_article</span><span class="plain-syntax">(</span><span class="identifier-syntax">pn</span><span class="plain-syntax">));</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">RELATIONSHIP_NT:</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" rel:"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" {meaning: "</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Annotations::read_int</span><span class="plain-syntax">(</span><span class="identifier-syntax">pn</span><span class="plain-syntax">, </span><span class="constant-syntax">relationship_node_type_ANNOT</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">STANDARD_RELN:</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Node::get_relationship</span><span class="plain-syntax">(</span><span class="identifier-syntax">pn</span><span class="plain-syntax">))</span>
@ -222,6 +221,7 @@ is used by <a href="../linguistics-test/index.html" class="internal">linguistics
<span class="plain-syntax"> </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">PARENTAGE_HERE_RELN:</span><span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"(here)"</span><span class="plain-syntax">); </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">DIRECTION_RELN:</span><span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"(direction)"</span><span class="plain-syntax">); </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> }</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"}"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> }</span>
<span class="plain-syntax">}</span>

View file

@ -89,6 +89,7 @@ matched against some form of a pronoun.
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">article_usage</span><span class="plain-syntax"> {</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">article</span><span class="plain-syntax"> *</span><span class="identifier-syntax">article_used</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">vocabulary_entry</span><span class="plain-syntax"> *</span><span class="identifier-syntax">word_used</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">grammatical_usage</span><span class="plain-syntax"> *</span><span class="identifier-syntax">usage</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">CLASS_DEFINITION</span>
<span class="plain-syntax">} </span><span class="reserved-syntax">article_usage</span><span class="plain-syntax">;</span>
@ -98,8 +99,9 @@ matched against some form of a pronoun.
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Articles::write_usage</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">Articles::write_usage</span></span>:<br/><a href="2-art.html#SP14">&#167;14</a><br/>Diagrams - <a href="1-dgr.html#SP5">&#167;5</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">article_usage</span><span class="plain-syntax"> *</span><span class="identifier-syntax">au</span><span class="plain-syntax">) {</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" %S"</span><span class="plain-syntax">, </span><span class="identifier-syntax">au</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">article_used</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">name</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" {%S '%V'"</span><span class="plain-syntax">, </span><span class="identifier-syntax">au</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">article_used</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">name</span><span class="plain-syntax">, </span><span class="identifier-syntax">au</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">word_used</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><a href="1-sc.html#SP9" class="function-link"><span class="function-syntax">Stock::write_usage</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">au</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">usage</span><span class="plain-syntax">, </span><span class="identifier-syntax">GENDER_LCW</span><span class="plain-syntax"> + </span><span class="identifier-syntax">NUMBER_LCW</span><span class="plain-syntax"> + </span><span class="identifier-syntax">CASE_LCW</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"}"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP4"></a><b>&#167;4. </b>The stock of articles is fixed at two:
@ -113,8 +115,8 @@ matched against some form of a pronoun.
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Articles::create_category</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">Articles::create_category</span></span>:<br/>Stock Control - <a href="1-sc.html#SP2">&#167;2</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">void</span><span class="plain-syntax">) {</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">articles_category</span><span class="plain-syntax"> = </span><a href="1-sc.html#SP3" class="function-link"><span class="function-syntax">Stock::new_category</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"article"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">METHOD_ADD</span><span class="plain-syntax">(</span><span class="identifier-syntax">articles_category</span><span class="plain-syntax">, </span><span class="constant-syntax">LOG_GRAMMATICAL_CATEGORY_MTID</span><span class="plain-syntax">, </span><a href="2-art.html#SP4" class="function-link"><span class="function-syntax">Articles::log_item</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">definite_article</span><span class="plain-syntax"> = </span><a href="2-art.html#SP4" class="function-link"><span class="function-syntax">Articles::new</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"definite article"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">indefinite_article</span><span class="plain-syntax"> = </span><a href="2-art.html#SP4" class="function-link"><span class="function-syntax">Articles::new</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"indefinite article"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">definite_article</span><span class="plain-syntax"> = </span><a href="2-art.html#SP4" class="function-link"><span class="function-syntax">Articles::new</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"definite"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">indefinite_article</span><span class="plain-syntax"> = </span><a href="2-art.html#SP4" class="function-link"><span class="function-syntax">Articles::new</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"indefinite"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
<span class="reserved-syntax">article</span><span class="plain-syntax"> *</span><span class="function-syntax">Articles::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">name</span><span class="plain-syntax">) {</span>
@ -251,6 +253,7 @@ nonterminal tables (see below for their English versions and layout).
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">au</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) {</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">au</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">article_usage</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">au</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">article_used</span><span class="plain-syntax"> = </span><span class="identifier-syntax">a</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">au</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">word_used</span><span class="plain-syntax"> = </span><span class="identifier-syntax">alt</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ve_pt</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">au</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">usage</span><span class="plain-syntax"> = </span><a href="1-sc.html#SP9" class="function-link"><span class="function-syntax">Stock::new_usage</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">a</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">in_stock</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><a href="1-sc.html#SP12" class="function-link"><span class="function-syntax">Stock::add_to_sws</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">sws</span><span class="plain-syntax">, </span><span class="identifier-syntax">alt</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">ve_pt</span><span class="plain-syntax">, </span><span class="identifier-syntax">au</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> }</span>

View file

@ -160,9 +160,10 @@ against some form of a noun.
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Nouns::write_usage</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">Nouns::write_usage</span></span>:<br/>Diagrams - <a href="1-dgr.html#SP5">&#167;5</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">noun_usage</span><span class="plain-syntax"> *</span><span class="identifier-syntax">nu</span><span class="plain-syntax">) {</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">nu</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">noun_used</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">noun_subclass</span><span class="plain-syntax"> == </span><span class="constant-syntax">COMMON_NOUN</span><span class="plain-syntax">) </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" (common)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">nu</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">noun_used</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">noun_subclass</span><span class="plain-syntax"> == </span><span class="constant-syntax">PROPER_NOUN</span><span class="plain-syntax">) </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" (proper)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">nu</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">noun_used</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">noun_subclass</span><span class="plain-syntax"> == </span><span class="constant-syntax">COMMON_NOUN</span><span class="plain-syntax">) </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" {common"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">nu</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">noun_used</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">noun_subclass</span><span class="plain-syntax"> == </span><span class="constant-syntax">PROPER_NOUN</span><span class="plain-syntax">) </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" {proper"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><a href="1-sc.html#SP9" class="function-link"><span class="function-syntax">Stock::write_usage</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">nu</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">usage</span><span class="plain-syntax">, </span><span class="identifier-syntax">GENDER_LCW</span><span class="plain-syntax">+</span><span class="identifier-syntax">NUMBER_LCW</span><span class="plain-syntax">+</span><span class="identifier-syntax">CASE_LCW</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"}"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP6"></a><b>&#167;6. </b>Nouns are a grammatical category:
@ -352,7 +353,7 @@ heading the noun appears under.
</p>
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">noun_usage</span><span class="plain-syntax"> *</span><span class="function-syntax">Nouns::disambiguate</span><span class="plain-syntax">(</span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">common_only</span><span class="plain-syntax">) {</span>
<span class="reserved-syntax">noun_usage</span><span class="plain-syntax"> *</span><span class="function-syntax">Nouns::disambiguate</span><button class="popup" onclick="togglePopup('usagePopup8')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup8">Usage of <span class="code-font"><span class="function-syntax">Nouns::disambiguate</span></span>:<br/><a href="2-nns.html#SP16">&#167;16</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">common_only</span><span class="plain-syntax">) {</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">noun_usage</span><span class="plain-syntax"> *</span><span class="identifier-syntax">first_nt</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="2-nns.html#SP14_1" class="named-paragraph-link"><span class="named-paragraph">If only one of the possible matches is eligible, return that</span><span class="named-paragraph-number">14.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="2-nns.html#SP14_2" class="named-paragraph-link"><span class="named-paragraph">If the matches can be scored, return the highest-scoring one</span><span class="named-paragraph-number">14.2</span></a></span><span class="plain-syntax">;</span>
@ -387,7 +388,7 @@ heading the noun appears under.
<p class="commentary firstcommentary"><a id="SP15"></a><b>&#167;15. </b></p>
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">Nouns::is_eligible_match</span><button class="popup" onclick="togglePopup('usagePopup8')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup8">Usage of <span class="code-font"><span class="function-syntax">Nouns::is_eligible_match</span></span>:<br/><a href="2-nns.html#SP14_1">&#167;14.1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">noun</span><span class="plain-syntax"> *</span><span class="identifier-syntax">nt</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">common_only</span><span class="plain-syntax">) {</span>
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">Nouns::is_eligible_match</span><button class="popup" onclick="togglePopup('usagePopup9')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup9">Usage of <span class="code-font"><span class="function-syntax">Nouns::is_eligible_match</span></span>:<br/><a href="2-nns.html#SP14_1">&#167;14.1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">noun</span><span class="plain-syntax"> *</span><span class="identifier-syntax">nt</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">common_only</span><span class="plain-syntax">) {</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">common_only</span><span class="plain-syntax">) &amp;&amp; (</span><a href="2-nns.html#SP9" class="function-link"><span class="function-syntax">Nouns::is_common</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">nt</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
@ -395,11 +396,16 @@ heading the noun appears under.
<p class="commentary firstcommentary"><a id="SP16"></a><b>&#167;16. Actual usage. </b></p>
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Nouns::recognise</span><span class="plain-syntax">(</span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">p</span><span class="plain-syntax">) {</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">q</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Lexicon::retrieve</span><span class="plain-syntax">(</span><span class="identifier-syntax">NOUN_MC</span><span class="plain-syntax">, </span><span class="identifier-syntax">Node::get_text</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">));</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">q</span><span class="plain-syntax">) </span><a href="2-nns.html#SP16" class="function-link"><span class="function-syntax">Nouns::set_node_to_be_usage_of_noun</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><a href="2-nns.html#SP14" class="function-link"><span class="function-syntax">Nouns::disambiguate</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">q</span><span class="plain-syntax">, </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">));</span>
<span class="plain-syntax">}</span>
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Nouns::set_node_to_be_usage_of_noun</span><span class="plain-syntax">(</span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="reserved-syntax">noun_usage</span><span class="plain-syntax"> *</span><span class="identifier-syntax">nu</span><span class="plain-syntax">) {</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">nu</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">noun_used</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">noun_subclass</span><span class="plain-syntax"> == </span><span class="constant-syntax">COMMON_NOUN</span><span class="plain-syntax">)</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">Node::set_type_and_clear_annotations</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="constant-syntax">COMMON_NOUN_NT</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">Node::set_type</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="constant-syntax">COMMON_NOUN_NT</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">else</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">Node::set_type_and_clear_annotations</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="constant-syntax">PROPER_NOUN_NT</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">Node::set_type</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="constant-syntax">PROPER_NOUN_NT</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">Node::set_noun</span><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><span class="identifier-syntax">nu</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
@ -408,7 +414,7 @@ heading the noun appears under.
<span class="plain-syntax"> </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">nu</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">noun_used</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
<span class="reserved-syntax">noun_usage</span><span class="plain-syntax"> *</span><span class="function-syntax">Nouns::usage_from_excerpt_meaning</span><button class="popup" onclick="togglePopup('usagePopup9')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup9">Usage of <span class="code-font"><span class="function-syntax">Nouns::usage_from_excerpt_meaning</span></span>:<br/><a href="2-nns.html#SP14_1">&#167;14.1</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">excerpt_meaning</span><span class="plain-syntax"> *</span><span class="identifier-syntax">em</span><span class="plain-syntax">) {</span>
<span class="reserved-syntax">noun_usage</span><span class="plain-syntax"> *</span><span class="function-syntax">Nouns::usage_from_excerpt_meaning</span><button class="popup" onclick="togglePopup('usagePopup10')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup10">Usage of <span class="code-font"><span class="function-syntax">Nouns::usage_from_excerpt_meaning</span></span>:<br/><a href="2-nns.html#SP14_1">&#167;14.1</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">excerpt_meaning</span><span class="plain-syntax"> *</span><span class="identifier-syntax">em</span><span class="plain-syntax">) {</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">noun_usage</span><span class="plain-syntax"> *</span><span class="identifier-syntax">nu</span><span class="plain-syntax"> = </span><span class="identifier-syntax">RETRIEVE_POINTER_noun_usage</span><span class="plain-syntax">(</span><span class="identifier-syntax">Lexicon::get_data</span><span class="plain-syntax">(</span><span class="identifier-syntax">em</span><span class="plain-syntax">));</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">nu</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

View file

@ -104,8 +104,9 @@ matched against some form of a pronoun.
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Pronouns::write_usage</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">Pronouns::write_usage</span></span>:<br/><a href="2-prn.html#SP10">&#167;10</a><br/>Diagrams - <a href="1-dgr.html#SP5">&#167;5</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">pronoun_usage</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pu</span><span class="plain-syntax">) {</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" %S"</span><span class="plain-syntax">, </span><span class="identifier-syntax">pu</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">pronoun_used</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">name</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" {%S"</span><span class="plain-syntax">, </span><span class="identifier-syntax">pu</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">pronoun_used</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">name</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><a href="1-sc.html#SP9" class="function-link"><span class="function-syntax">Stock::write_usage</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">pu</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">usage</span><span class="plain-syntax">, </span><span class="identifier-syntax">PERSON_LCW</span><span class="plain-syntax"> + </span><span class="identifier-syntax">GENDER_LCW</span><span class="plain-syntax"> + </span><span class="identifier-syntax">NUMBER_LCW</span><span class="plain-syntax"> + </span><span class="identifier-syntax">CASE_LCW</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"}"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP4"></a><b>&#167;4. </b>The stock of pronouns is fixed at six. We are going to regard the three

View file

@ -117,8 +117,11 @@ be turned into one of the following structures:
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">VerbUsages::write_usage</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">VerbUsages::write_usage</span></span>:<br/>Diagrams - <a href="1-dgr.html#SP5">&#167;5</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">verb_usage</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vu</span><span class="plain-syntax">) {</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">vu</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) { </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"(null verb usage)"</span><span class="plain-syntax">); </span><span class="reserved-syntax">return</span><span class="plain-syntax">; }</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" verb '%A'"</span><span class="plain-syntax">, &amp;(</span><span class="identifier-syntax">vu</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">vu_text</span><span class="plain-syntax">));</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" {verb"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">verb</span><span class="plain-syntax"> *</span><span class="identifier-syntax">V</span><span class="plain-syntax"> = </span><a href="3-vu.html#SP12" class="function-link"><span class="function-syntax">VerbUsages::get_verb</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">vu</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">V</span><span class="plain-syntax">) </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" '%A'"</span><span class="plain-syntax">, &amp;(</span><span class="identifier-syntax">V</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">conjugation</span><span class="plain-syntax">-&gt;</span><span class="identifier-syntax">infinitive</span><span class="plain-syntax">));</span>
<span class="plain-syntax"> </span><a href="1-sc.html#SP9" class="function-link"><span class="function-syntax">Stock::write_usage</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">vu</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">usage</span><span class="plain-syntax">, </span><span class="identifier-syntax">SENSE_LCW</span><span class="plain-syntax">+</span><span class="identifier-syntax">MOOD_LCW</span><span class="plain-syntax">+</span><span class="identifier-syntax">TENSE_LCW</span><span class="plain-syntax">+</span><span class="identifier-syntax">PERSON_LCW</span><span class="plain-syntax">+</span><span class="identifier-syntax">NUMBER_LCW</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"}"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP3"></a><b>&#167;3. Search list and tiers. </b>A "search list" of verb usages indicates what order the possibilities should be
@ -526,7 +529,7 @@ list, with lower priority numbers before higher ones.
<span class="plain-syntax"> </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">root</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
<span class="reserved-syntax">verb</span><span class="plain-syntax"> *</span><span class="function-syntax">VerbUsages::get_verb</span><button class="popup" onclick="togglePopup('usagePopup8')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup8">Usage of <span class="code-font"><span class="function-syntax">VerbUsages::get_verb</span></span>:<br/><a href="3-vu.html#SP11">&#167;11</a>, <a href="3-vu.html#SP15">&#167;15</a>, <a href="3-vu.html#SP16">&#167;16</a>, <a href="3-vu.html#SP17">&#167;17</a><br/>Verb Phrases - <a href="4-vp.html#SP7_3_1">&#167;7.3.1</a>, <a href="4-vp.html#SP9">&#167;9</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">verb_usage</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vu</span><span class="plain-syntax">) {</span>
<span class="reserved-syntax">verb</span><span class="plain-syntax"> *</span><span class="function-syntax">VerbUsages::get_verb</span><button class="popup" onclick="togglePopup('usagePopup8')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup8">Usage of <span class="code-font"><span class="function-syntax">VerbUsages::get_verb</span></span>:<br/><a href="3-vu.html#SP2">&#167;2</a>, <a href="3-vu.html#SP11">&#167;11</a>, <a href="3-vu.html#SP15">&#167;15</a>, <a href="3-vu.html#SP16">&#167;16</a>, <a href="3-vu.html#SP17">&#167;17</a><br/>Verb Phrases - <a href="4-vp.html#SP7_3_1">&#167;7.3.1</a>, <a href="4-vp.html#SP9">&#167;9</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">verb_usage</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vu</span><span class="plain-syntax">) {</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">vu</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="3-vrb.html#SP2" class="function-link"><span class="function-syntax">Verbs::from_lcon</span></a><span class="plain-syntax">(</span><a href="1-sc.html#SP9" class="function-link"><span class="function-syntax">Stock::first_form_in_usage</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">vu</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">usage</span><span class="plain-syntax">));</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

View file

@ -0,0 +1,329 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>About Sentence Diagrams</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
<meta name="viewport" content="width=device-width initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="en-gb">
<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script src="http://code.jquery.com/jquery-1.12.4.min.js"
integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
<script src="../docs-assets/Bigfoot.js"></script>
<link href="../docs-assets/Bigfoot.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
</head>
<body class="commentary-font">
<nav role="navigation">
<h1><a href="../index.html">
<img src="../docs-assets/Inform.png" height=72">
</a></h1>
<ul><li><a href="../compiler.html">compiler tools</a></li>
<li><a href="../other.html">other tools</a></li>
<li><a href="../extensions.html">extensions and kits</a></li>
<li><a href="../units.html">unit test tools</a></li>
</ul><h2>Compiler Webs</h2><ul>
<li><a href="../inbuild/index.html">inbuild</a></li>
<li><a href="../inform7/index.html">inform7</a></li>
<li><a href="../inter/index.html">inter</a></li>
</ul><h2>Inbuild Modules</h2><ul>
<li><a href="../supervisor-module/index.html">supervisor</a></li>
</ul><h2>Inform7 Modules</h2><ul>
<li><a href="../core-module/index.html">core</a></li>
<li><a href="../kinds-module/index.html">kinds</a></li>
<li><a href="../if-module/index.html">if</a></li>
<li><a href="../multimedia-module/index.html">multimedia</a></li>
<li><a href="../index-module/index.html">index</a></li>
</ul><h2>Inter Modules</h2><ul>
<li><a href="../bytecode-module/index.html">bytecode</a></li>
<li><a href="../building-module/index.html">building</a></li>
<li><a href="../codegen-module/index.html">codegen</a></li>
</ul><h2>Services</h2><ul>
<li><a href="../arch-module/index.html">arch</a></li>
<li><a href="../syntax-module/index.html">syntax</a></li>
<li><a href="../words-module/index.html">words</a></li>
<li><a href="../html-module/index.html">html</a></li>
<li><a href="../inflections-module/index.html">inflections</a></li>
<li><a href="index.html"><span class="selectedlink">linguistics</span></a></li>
<li><a href="../problems-module/index.html">problems</a></li>
<li><a href="../../../inweb/docs/foundation-module/index.html">foundation</a></li>
</ul>
</nav>
<main role="main">
<!--Weave of 'About Sentence Diagrams' generated by Inweb-->
<div class="breadcrumbs">
<ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../compiler.html">Services</a></li><li><a href="index.html">linguistics</a></li><li><a href="index.html#P">Preliminaries</a></li><li><b>About Sentence Diagrams</b></li></ul></div>
<p class="purpose">Description and examples of the diagrams which this module turns sentences into.</p>
<p class="commentary firstcommentary"><a id="SP1"></a><b>&#167;1. </b>First, an acknowledgement: the sentence diagrams in this section are generated
automatically by <a href="../linguistics-test/index.html" class="internal">linguistics-test</a>. (This means they are always up to date.)
If you are interested in using <a href="index.html" class="internal">linguistics</a> in some context other than Inform,
<a href="../linguistics-test/index.html" class="internal">linguistics-test</a> may be a good starting point.
</p>
<p class="commentary firstcommentary"><a id="SP2"></a><b>&#167;2. </b>Every example sentence in this section was passed in turn to the &lt;sentence&gt;
nonterminal, and the trees displayed below were the result. For example:
</p>
<pre class="undisplayed-code all-displayed-code code-font">
<span class="plain-syntax">linguistics-test: sentence failed to parse</span>
<span class="plain-syntax">(1) arfle barfle gloop</span>
<span class="plain-syntax">SENTENCE_NT'arfle barfle gloop'</span>
<span class="plain-syntax">(2) beth is not a sailor</span>
<span class="plain-syntax">SENTENCE_NT'beth is not a sailor'</span>
<span class="plain-syntax"> VERB_NT'is not' {verb 'be' 3p s act IS_TENSE -ve} {meaning: is}</span>
<span class="plain-syntax"> UNPARSED_NOUN_NT'beth'</span>
<span class="plain-syntax"> UNPARSED_NOUN_NT'sailor' {indefinite 'a' n/m/f nom/acc s}</span>
</pre>
<p class="commentary">Sentence (1) here made no sense: there was no verb. It was therefore left as
a single <span class="extract"><span class="extract-syntax">SENTENCE_NT</span></span> node with no children. In all other cases, as in (2),
there are three children: verb, subject phrase, and object phrase.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup>
</p>
<p class="commentary">In this tree notation, indentation shows which nodes are children of which
others. The node types, such as <span class="extract"><span class="extract-syntax">SENTENCE_NT</span></span>, are in capitals and all end
in <span class="extract"><span class="extract-syntax">_NT</span></span>. The text leading to the creation of the node then appears in quotes.
After that are "annotations", written in braces.<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup> In sentence (2), we see:
</p>
<ul class="items"><li>(a) The <span class="extract"><span class="extract-syntax">VERB_NT</span></span> node is annotated with its grammatical form &mdash; it is "to be",
in third person singular, active mood, present tense, and a negative sense &mdash;
and also its semantic meaning &mdash; the equality relationship "is".
</li><li>(b) The second <span class="extract"><span class="extract-syntax">UNPARSED_NOUN_NT</span></span> node is annotated with the article used to
introduce it &mdash; the indefinite article, "a", which could be any of masculine,
feminine or neuter, could be either nominative or accusative, but is
certainly singular.
</li></ul>
<ul class="footnotetexts"><li class="footnote" id="fn:1"><p class="inwebfootnote"><sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> Since "to be" is a copular verb, in sentence (2) we really mean "the
phrase in the object position".
<a href="#fnref:1" title="return to text"> &#x21A9;</a></p></li><li class="footnote" id="fn:2"><p class="inwebfootnote"><sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup> Since the 1850s a variety of tree-diagram schemes for sentence structure
have been proposed: see <a href="https://en.wikipedia.org/wiki/Sentence_diagram" class="external">Wikipedia</a>.
These tend to be quite large, with many optional features &mdash; no bad thing when
the aim is to explain. But our aim is to process, not to illustrate, and
whereas a typical dependency tree would have nodes for both "not" and "a",
we use annotations instead. The aim is to have flattish sentence trees
with a simple, predictable shape.
<a href="#fnref:2" title="return to text"> &#x21A9;</a></p></li></ul>
<p class="commentary firstcommentary"><a id="SP3"></a><b>&#167;3. </b>Using &lt;sentence&gt; alone tends to result in a lot of <span class="extract"><span class="extract-syntax">UNPARSED_NOUN_NT</span></span> nodes.
This is unsatisfying, but useful, because sometimes the meaning of a verb
affects how those nodes should be parsed further. The idea is that the user
will traverse the tree and parse the <span class="extract"><span class="extract-syntax">UNPARSED_NOUN_NT</span></span> nodes as needed.
Calling the function <a href="2-nns.html#SP16" class="internal">Nouns::recognise</a> on such a node will test to see
if it's a known common or proper noun, and amend it accordingly.
</p>
<p class="commentary">The <a href="../linguistics-test/index.html" class="internal">linguistics-test</a> program does this automatically, so from here on,
all examples shown will have that operation done. For example:
</p>
<pre class="undisplayed-code all-displayed-code code-font">
<span class="plain-syntax">(1) beth is not a sailor</span>
<span class="plain-syntax">SENTENCE_NT'beth is not a sailor'</span>
<span class="plain-syntax"> VERB_NT'is not' {verb 'be' 3p s act IS_TENSE -ve} {meaning: is}</span>
<span class="plain-syntax"> PROPER_NOUN_NT'beth' {proper nom/acc f s}</span>
<span class="plain-syntax"> COMMON_NOUN_NT'sailor' {common nom/acc m s} {indefinite 'a' n/m/f nom/acc s}</span>
</pre>
<p class="commentary">Here the two <span class="extract"><span class="extract-syntax">UNPARSED_NOUN_NT</span></span> nodes have been recognised as usages of a
proper noun, Beth, and a common noun, sailor, respectively, and they are
annotated with their grammatical usages &mdash; in so far as we can tell. These
two nouns do not inflect with case in English, but they are both singular.
</p>
<p class="commentary firstcommentary"><a id="SP4"></a><b>&#167;4. </b>Clearly the <a href="index.html" class="internal">linguistics</a> module needs to know some vocabulary in order
to do this, and in the test runs displayed in this section, it is using a
very limited stock of nouns, verbs and prepositions as follows:
</p>
<pre class="undisplayed-code all-displayed-code code-font">
<span class="plain-syntax">IS = relationship.</span>
<span class="plain-syntax">HAS = relationship.</span>
<span class="plain-syntax">CARRIES = relationship.</span>
<span class="plain-syntax">KNOWS = relationship.</span>
<span class="plain-syntax">be = verb meaning IS with priority 2.</span>
<span class="plain-syntax">have = verb meaning HAS with priority 1.</span>
<span class="plain-syntax">carry = verb meaning CARRIES with priority 3.</span>
<span class="plain-syntax">know = verb meaning KNOWS with priority 3.</span>
<span class="plain-syntax">be + on = preposition meaning CARRIES.</span>
<span class="plain-syntax">be + under = preposition meaning CARRIES-reversed.</span>
<span class="plain-syntax">Anna = feminine proper noun.</span>
<span class="plain-syntax">Beth = feminine proper noun.</span>
<span class="plain-syntax">Charles = masculine proper noun.</span>
<span class="plain-syntax">man = masculine common noun.</span>
<span class="plain-syntax">woman = feminine common noun.</span>
<span class="plain-syntax">person = masculine common noun.</span>
<span class="plain-syntax">sailor = masculine common noun.</span>
<span class="plain-syntax">table = neuter common noun.</span>
<span class="plain-syntax">Ming vase = neuter common noun.</span>
</pre>
<p class="commentary">We only know that Beth is feminine-gendered and sailor masculine-gendered<sup id="fnref:3"><a href="#fn:3" rel="footnote">3</a></sup>
because the vocabulary being used by <a href="../linguistics-test/index.html" class="internal">linguistics-test</a> says so. It's
important to appreciate that although an English reader might twig that
Beth is a common girl's name, we can't do that.
</p>
<ul class="footnotetexts"><li class="footnote" id="fn:3"><p class="inwebfootnote"><sup id="fnref:3"><a href="#fn:3" rel="footnote">3</a></sup> In the grammatical sense that "she" can refer to Beth and "he" to a
generic identity-unknown sailor. Pronouns in English are a source of real
sensitivity and if <a href="index.html" class="internal">linguistics</a> were a module to generate text, rather
than recognise it, we would take much more care over this. Our interest
is in grammatical gender, not the assignment of sexes to people.
<a href="#fnref:3" title="return to text"> &#x21A9;</a></p></li></ul>
<p class="commentary firstcommentary"><a id="SP5"></a><b>&#167;5. </b>So, then, let us start with simple copular sentences &mdash; that is,
sentences involving the verb "to be", which equate two subjects rather
than having a subject act upon an object. This is why one "ought to" say
"The traitor is I" instead of "The traitor is me", although nobody does.
</p>
<pre class="undisplayed-code all-displayed-code code-font">
<span class="plain-syntax">(1) anna is a woman</span>
<span class="plain-syntax">SENTENCE_NT'anna is a woman'</span>
<span class="plain-syntax"> VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {meaning: is}</span>
<span class="plain-syntax"> PROPER_NOUN_NT'anna' {proper nom/acc f s}</span>
<span class="plain-syntax"> COMMON_NOUN_NT'woman' {common nom/acc f s} {indefinite 'a' n/m/f nom/acc s}</span>
<span class="plain-syntax">(2) anna is not charles</span>
<span class="plain-syntax">SENTENCE_NT'anna is not charles'</span>
<span class="plain-syntax"> VERB_NT'is not' {verb 'be' 3p s act IS_TENSE -ve} {meaning: is}</span>
<span class="plain-syntax"> PROPER_NOUN_NT'anna' {proper nom/acc f s}</span>
<span class="plain-syntax"> PROPER_NOUN_NT'charles' {proper nom/acc m s}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP6"></a><b>&#167;6. </b>Next, regular sentences, that is, those where the verb is not copular
but instead expresses some relationship between a subject and an object
which play different roles.
</p>
<pre class="undisplayed-code all-displayed-code code-font">
<span class="plain-syntax">(1) beth carries the ming vase</span>
<span class="plain-syntax">SENTENCE_NT'beth carries the ming vase'</span>
<span class="plain-syntax"> VERB_NT'carries' {verb 'carry' 3p s act IS_TENSE +ve} {meaning: carries}</span>
<span class="plain-syntax"> PROPER_NOUN_NT'beth' {proper nom/acc f s}</span>
<span class="plain-syntax"> RELATIONSHIP_NT'carries' {meaning: carries-reversed}</span>
<span class="plain-syntax"> COMMON_NOUN_NT'ming vase' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}</span>
<span class="plain-syntax">(2) the sailors carry the table</span>
<span class="plain-syntax">SENTENCE_NT'the sailors carry the table'</span>
<span class="plain-syntax"> VERB_NT'carry' {verb 'carry' 1p/2p s/p act IS_TENSE +ve + 3p p act IS_TENSE +ve} {meaning: carries}</span>
<span class="plain-syntax"> COMMON_NOUN_NT'sailors' {common nom/acc m p} {definite 'the' n/m/f s/p nom/acc}</span>
<span class="plain-syntax"> RELATIONSHIP_NT'carry' {meaning: carries-reversed}</span>
<span class="plain-syntax"> COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}</span>
<span class="plain-syntax">(3) the ming vase is carried by beth</span>
<span class="plain-syntax">SENTENCE_NT'the ming vase is carried by beth'</span>
<span class="plain-syntax"> VERB_NT'is carried by' {verb 'be' 3p s act IS_TENSE +ve} {meaning: carries-reversed}</span>
<span class="plain-syntax"> COMMON_NOUN_NT'ming vase' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}</span>
<span class="plain-syntax"> RELATIONSHIP_NT'is carried by' {meaning: carries}</span>
<span class="plain-syntax"> PROPER_NOUN_NT'beth' {proper nom/acc f s}</span>
<span class="plain-syntax">(4) a woman is on the table</span>
<span class="plain-syntax">SENTENCE_NT'a woman is on the table'</span>
<span class="plain-syntax"> VERB_NT'is on' {verb 'be' 3p s act IS_TENSE +ve} {meaning: carries}</span>
<span class="plain-syntax"> COMMON_NOUN_NT'woman' {common nom/acc f s} {indefinite 'a' n/m/f nom/acc s}</span>
<span class="plain-syntax"> RELATIONSHIP_NT'is on' {meaning: carries-reversed}</span>
<span class="plain-syntax"> COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP7"></a><b>&#167;7. </b>An unusual feature of English is its use of subject-verb inversion:
</p>
<pre class="undisplayed-code all-displayed-code code-font">
<span class="plain-syntax">(1) on the table is the ming vase</span>
<span class="plain-syntax">SENTENCE_NT'on the table is the ming vase'</span>
<span class="plain-syntax"> VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {meaning: is}</span>
<span class="plain-syntax"> RELATIONSHIP_NT'on the table' {meaning: carries-reversed}</span>
<span class="plain-syntax"> COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}</span>
<span class="plain-syntax"> COMMON_NOUN_NT'ming vase' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}</span>
<span class="plain-syntax">(2) on the table is under the ming vase</span>
<span class="plain-syntax">SENTENCE_NT'on the table is under the ming vase'</span>
<span class="plain-syntax"> VERB_NT'is under' {verb 'be' 3p s act IS_TENSE +ve} {meaning: carries-reversed}</span>
<span class="plain-syntax"> RELATIONSHIP_NT'on the table' {meaning: carries-reversed}</span>
<span class="plain-syntax"> COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}</span>
<span class="plain-syntax"> RELATIONSHIP_NT'is under' {meaning: carries}</span>
<span class="plain-syntax"> COMMON_NOUN_NT'ming vase' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}</span>
</pre>
<p class="commentary">It would be easy to auto-fix the inversion in sentence (1), by simply
swapping the "on the table" and "Ming vase" subtrees over, but we want
to preserve the distinction because Inform will make some use of it.
</p>
<p class="commentary">Sentence (2) here is arguably just plain wrong, but we do very occasionally
allow that sort of thing in Inform (for e.g. "east of X is south of Y").
</p>
<p class="commentary firstcommentary"><a id="SP8"></a><b>&#167;8. </b>Now we introduce pronouns to the mix. These are detected automatically
by <a href="index.html" class="internal">linguistics</a>, and exist in nominative and accusative cases in
English. Note the difference in annotations between "them" and "you",
for example.
</p>
<pre class="undisplayed-code all-displayed-code code-font">
<span class="plain-syntax">(1) he knows her</span>
<span class="plain-syntax">SENTENCE_NT'he knows her'</span>
<span class="plain-syntax"> VERB_NT'knows' {verb 'know' 3p s act IS_TENSE +ve} {meaning: knows}</span>
<span class="plain-syntax"> PRONOUN_NT'he' {third person pronoun m 3p s nom}</span>
<span class="plain-syntax"> RELATIONSHIP_NT'knows' {meaning: knows-reversed}</span>
<span class="plain-syntax"> PRONOUN_NT'her' {third person pronoun f 3p s acc}</span>
<span class="plain-syntax">(2) she knows him</span>
<span class="plain-syntax">SENTENCE_NT'she knows him'</span>
<span class="plain-syntax"> VERB_NT'knows' {verb 'know' 3p s act IS_TENSE +ve} {meaning: knows}</span>
<span class="plain-syntax"> PRONOUN_NT'she' {third person pronoun f 3p s nom}</span>
<span class="plain-syntax"> RELATIONSHIP_NT'knows' {meaning: knows-reversed}</span>
<span class="plain-syntax"> PRONOUN_NT'him' {third person pronoun m 3p s acc}</span>
<span class="plain-syntax">(3) i carry the ming vase</span>
<span class="plain-syntax">SENTENCE_NT'i carry the ming vase'</span>
<span class="plain-syntax"> VERB_NT'carry' {verb 'carry' 1p/2p s/p act IS_TENSE +ve + 3p p act IS_TENSE +ve} {meaning: carries}</span>
<span class="plain-syntax"> PRONOUN_NT'i' {first person pronoun n/m/f 1p s nom}</span>
<span class="plain-syntax"> RELATIONSHIP_NT'carry' {meaning: carries-reversed}</span>
<span class="plain-syntax"> COMMON_NOUN_NT'ming vase' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}</span>
<span class="plain-syntax">(4) the sailors know them</span>
<span class="plain-syntax">SENTENCE_NT'the sailors know them'</span>
<span class="plain-syntax"> VERB_NT'know' {verb 'know' 1p/2p s/p act IS_TENSE +ve + 3p p act IS_TENSE +ve} {meaning: knows}</span>
<span class="plain-syntax"> COMMON_NOUN_NT'sailors' {common nom/acc m p} {definite 'the' n/m/f s/p nom/acc}</span>
<span class="plain-syntax"> RELATIONSHIP_NT'know' {meaning: knows-reversed}</span>
<span class="plain-syntax"> PRONOUN_NT'them' {third person pronoun n/m/f 3p p acc}</span>
<span class="plain-syntax">(5) you know us</span>
<span class="plain-syntax">SENTENCE_NT'you know us'</span>
<span class="plain-syntax"> VERB_NT'know' {verb 'know' 1p/2p s/p act IS_TENSE +ve + 3p p act IS_TENSE +ve} {meaning: knows}</span>
<span class="plain-syntax"> PRONOUN_NT'you' {second person pronoun n/m/f s/p nom/acc 2p}</span>
<span class="plain-syntax"> RELATIONSHIP_NT'know' {meaning: knows-reversed}</span>
<span class="plain-syntax"> PRONOUN_NT'us' {first person pronoun n/m/f 1p p acc}</span>
</pre>
<nav role="progress"><div class="progresscontainer">
<ul class="progressbar"><li class="progressprev"><a href="P-wtmd.html">&#10094;</a></li><li class="progresscurrentchapter">P</li><li class="progresssection"><a href="P-wtmd.html">wtmd</a></li><li class="progresscurrent">asd</li><li class="progresssection"><a href="P-htitm.html">htitm</a></li><li class="progresschapter"><a href="1-lm.html">1</a></li><li class="progresschapter"><a href="2-adj.html">2</a></li><li class="progresschapter"><a href="3-vrb.html">3</a></li><li class="progresschapter"><a href="4-np.html">4</a></li><li class="progressnext"><a href="P-htitm.html">&#10095;</a></li></ul></div>
</nav><!--End of weave-->
</main>
</body>
</html>

View file

@ -167,7 +167,7 @@ in the sense that the reversal of "A knows B" would be "A is known by B",
or in other words "B knows A". See <a href="3-vm.html#SP2" class="internal">VerbMeanings::reverse_VMT</a>.
</li></ul>
<nav role="progress"><div class="progresscontainer">
<ul class="progressbar"><li class="progressprev"><a href="P-wtmd.html">&#10094;</a></li><li class="progresscurrentchapter">P</li><li class="progresssection"><a href="P-wtmd.html">wtmd</a></li><li class="progresscurrent">htitm</li><li class="progresschapter"><a href="1-lm.html">1</a></li><li class="progresschapter"><a href="2-adj.html">2</a></li><li class="progresschapter"><a href="3-vrb.html">3</a></li><li class="progresschapter"><a href="4-np.html">4</a></li><li class="progressnext"><a href="1-lm.html">&#10095;</a></li></ul></div>
<ul class="progressbar"><li class="progressprev"><a href="P-asd.html">&#10094;</a></li><li class="progresscurrentchapter">P</li><li class="progresssection"><a href="P-wtmd.html">wtmd</a></li><li class="progresssection"><a href="P-asd.html">asd</a></li><li class="progresscurrent">htitm</li><li class="progresschapter"><a href="1-lm.html">1</a></li><li class="progresschapter"><a href="2-adj.html">2</a></li><li class="progresschapter"><a href="3-vrb.html">3</a></li><li class="progresschapter"><a href="4-np.html">4</a></li><li class="progressnext"><a href="1-lm.html">&#10095;</a></li></ul></div>
</nav><!--End of weave-->
</main>

View file

@ -63,7 +63,7 @@
<ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../compiler.html">Services</a></li><li><a href="index.html">linguistics</a></li><li><a href="index.html#P">Preliminaries</a></li><li><b>What This Module Does</b></li></ul></div>
<p class="purpose">An overview of the linguistics module's role and abilities.</p>
<ul class="toc"><li><a href="P-wtmd.html#SP1">&#167;1. Prerequisites</a></li><li><a href="P-wtmd.html#SP2">&#167;2. Goals and non-goals</a></li><li><a href="P-wtmd.html#SP5">&#167;5. Lcons</a></li><li><a href="P-wtmd.html#SP6">&#167;6. Cardinals and ordinals</a></li><li><a href="P-wtmd.html#SP7">&#167;7. Noun phrases</a></li><li><a href="P-wtmd.html#SP13">&#167;13. Verb phrases</a></li><li><a href="P-wtmd.html#SP17">&#167;17. Performance in practice</a></li></ul><hr class="tocbar">
<ul class="toc"><li><a href="P-wtmd.html#SP1">&#167;1. Prerequisites</a></li><li><a href="P-wtmd.html#SP2">&#167;2. Goals and non-goals</a></li><li><a href="P-wtmd.html#SP5">&#167;5. Lcons</a></li><li><a href="P-wtmd.html#SP6">&#167;6. Cardinals and ordinals</a></li><li><a href="P-wtmd.html#SP7">&#167;7. Stock for noun phrases</a></li><li><a href="P-wtmd.html#SP13">&#167;13. Stock for verb phrases</a></li><li><a href="P-wtmd.html#SP17">&#167;17. Performance in practice</a></li></ul><hr class="tocbar">
<p class="commentary firstcommentary"><a id="SP1"></a><b>&#167;1. Prerequisites. </b>The linguistics module is a part of the Inform compiler toolset. It is
presented as a literate program or "web". Before diving in:
@ -89,11 +89,15 @@ the ones students draw in school grammar classes. For example,
</blockquote>
<p class="commentary">becomes a "diagram" &mdash; a fragment of the tree provided by the <a href="../syntax-module/index.html" class="internal">syntax</a>
module &mdash; in which the relationship "to be on top of" appears as the root,
with two noun phrases, "most of the heavy bricks" and "the wall", beneath it.
module &mdash; showing the linguistic structure of the sentence.
</p>
<p class="commentary">To be in a position to do this, the module needs a way to accumulate
<p class="commentary">This work is done by the nonterminal &lt;sentence&gt; &mdash; see <a href="4-vp.html" class="internal">Verb Phrases</a>.
Many examples of sentence diagrams can be seen in <a href="P-asd.html" class="internal">About Sentence Diagrams</a>;
read that first.
</p>
<p class="commentary">To be in a position to parse like this, the module needs a way to accumulate
knowledge about the possible nouns, verbs, adjectives, prepositions and so on
which might appear in such sentences. Where sensible, a design goal here is
for each of these grammatical categories to correspond closely to an object
@ -173,7 +177,7 @@ for them to be so: we would need a potentially infinite number of them to
accommodate the possible range of integers which appear.
</p>
<p class="commentary firstcommentary"><a id="SP7"></a><b>&#167;7. Noun phrases. </b>For convenience we will run through the stock in two sets: those grammatical
<p class="commentary firstcommentary"><a id="SP7"></a><b>&#167;7. Stock for noun phrases. </b>For convenience we will run through the stock in two sets: those grammatical
categories used in noun phrases, and provided by <a href="2-adj.html" class="internal">Chapter 2: NP Categories</a>; and those
used in verb phrases, <a href="3-vrb.html" class="internal">Chapter 3: VP Categories</a>. In alphabetical order:
</p>
@ -232,7 +236,7 @@ at three, all automatically created: the subject (he, she), object (him, her)
and possessive (his, her) pronouns. See <a href="2-prn.html" class="internal">Pronouns</a>.
</p>
<p class="commentary firstcommentary"><a id="SP13"></a><b>&#167;13. Verb phrases. </b></p>
<p class="commentary firstcommentary"><a id="SP13"></a><b>&#167;13. Stock for verb phrases. </b></p>
<p class="commentary">Adverb phrases of occurrence refers to wording such as "for the sixth time".
The stock of these is fixed, though as with determiners, each is really a
@ -442,8 +446,8 @@ Within each categpry, items are listed in order of creation.
<span class="plain-syntax">adjective: A135''</span>
<span class="plain-syntax">adjective: A136''</span>
<span class="plain-syntax">article: definite article</span>
<span class="plain-syntax">article: indefinite article</span>
<span class="plain-syntax">article: definite</span>
<span class="plain-syntax">article: indefinite</span>
<span class="plain-syntax">noun: common: 'value'</span>
<span class="plain-syntax">noun: common: 'pointer value'</span>
@ -3628,7 +3632,7 @@ Within each categpry, items are listed in order of creation.
<span class="plain-syntax">verb_form: be(4) + the same unbolting relation storage as + ___ SVO</span>
</pre>
<nav role="progress"><div class="progresscontainer">
<ul class="progressbar"><li class="progressprevoff">&#10094;</li><li class="progresscurrentchapter">P</li><li class="progresscurrent">wtmd</li><li class="progresssection"><a href="P-htitm.html">htitm</a></li><li class="progresschapter"><a href="1-lm.html">1</a></li><li class="progresschapter"><a href="2-adj.html">2</a></li><li class="progresschapter"><a href="3-vrb.html">3</a></li><li class="progresschapter"><a href="4-np.html">4</a></li><li class="progressnext"><a href="P-htitm.html">&#10095;</a></li></ul></div>
<ul class="progressbar"><li class="progressprevoff">&#10094;</li><li class="progresscurrentchapter">P</li><li class="progresscurrent">wtmd</li><li class="progresssection"><a href="P-asd.html">asd</a></li><li class="progresssection"><a href="P-htitm.html">htitm</a></li><li class="progresschapter"><a href="1-lm.html">1</a></li><li class="progresschapter"><a href="2-adj.html">2</a></li><li class="progresschapter"><a href="3-vrb.html">3</a></li><li class="progresschapter"><a href="4-np.html">4</a></li><li class="progressnext"><a href="P-asd.html">&#10095;</a></li></ul></div>
</nav><!--End of weave-->
</main>

View file

@ -65,6 +65,11 @@
<spon class="sectiontitle">What This Module Does</span></a> -
<span class="sectionpurpose">An overview of the linguistics module's role and abilities.</span></p>
</li>
<li>
<p class="sectionentry"><a href="P-asd.html">
<spon class="sectiontitle">About Sentence Diagrams</span></a> -
<span class="sectionpurpose">Description and examples of the diagrams which this module turns sentences into.</span></p>
</li>
<li>
<p class="sectionentry"><a href="P-htitm.html">
<spon class="sectiontitle">How To Include This Module</span></a> -

View file

@ -71,7 +71,7 @@ sentences &mdash; the answer being, all of them. (Inform is more restrictive.)
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">parse_node_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">syntax_tree</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">parse_node_tree</span><span class="plain-syntax"> *</span><span class="function-syntax">Diagramming::test_diagrams</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">Diagramming::test_diagrams</span></span>:<br/>Program Control - <a href="1-pc.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">arg</span><span class="plain-syntax">) {</span>
<span class="reserved-syntax">parse_node_tree</span><span class="plain-syntax"> *</span><span class="function-syntax">Diagramming::test_diagrams</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">Diagramming::test_diagrams</span></span>:<br/>Program Control - <a href="1-pc.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">arg</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">raw</span><span class="plain-syntax">) {</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">syntax_tree</span><span class="plain-syntax"> = </span><a href="../syntax-module/2-st.html#SP2" class="function-link"><span class="function-syntax">SyntaxTree::new</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="1-dgr2.html#SP2_1" class="named-paragraph-link"><span class="named-paragraph">Turn the file into a syntax tree</span><span class="named-paragraph-number">2.1</span></a></span><span class="plain-syntax">;</span>
<span class="plain-syntax"> </span><span class="named-paragraph-container code-font"><a href="1-dgr2.html#SP2_2" class="named-paragraph-link"><span class="named-paragraph">Use the linguistics module on each sentence</span><span class="named-paragraph-number">2.2</span></a></span><span class="plain-syntax">;</span>
@ -95,7 +95,7 @@ sentences &mdash; the answer being, all of them. (Inform is more restrictive.)
<pre class="displayed-code all-displayed-code code-font">
<span class="plain-syntax"> </span><a href="../syntax-module/2-st.html#SP10" class="function-link"><span class="function-syntax">SyntaxTree::traverse</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">syntax_tree</span><span class="plain-syntax">, </span><a href="1-dgr2.html#SP3" class="function-link"><span class="function-syntax">Diagramming::diagram</span></a><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><a href="1-dgr2.html#SP4" class="function-link"><span class="function-syntax">Diagramming::parse_noun_phrases</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">syntax_tree</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">root_node</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">raw</span><span class="plain-syntax"> == </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">) </span><a href="1-dgr2.html#SP4" class="function-link"><span class="function-syntax">Diagramming::parse_noun_phrases</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">syntax_tree</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">root_node</span><span class="plain-syntax">);</span>
</pre>
<ul class="endnotetexts"><li>This code is used in <a href="1-dgr2.html#SP2">&#167;2</a>.</li></ul>
<p class="commentary firstcommentary"><a id="SP3"></a><b>&#167;3. </b>The work of the <a href="../words-module/index.html" class="internal">words</a> and <a href="../syntax-module/index.html" class="internal">syntax</a> modules means that we now have a
@ -129,10 +129,7 @@ by default parsed: they are simply left as <span class="extract"><span class="ex
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Diagramming::parse_noun_phrases</span><button class="popup" onclick="togglePopup('usagePopup3')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup3">Usage of <span class="code-font"><span class="function-syntax">Diagramming::parse_noun_phrases</span></span>:<br/><a href="1-dgr2.html#SP2_2">&#167;2.2</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">p</span><span class="plain-syntax">) {</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (; </span><span class="identifier-syntax">p</span><span class="plain-syntax">; </span><span class="identifier-syntax">p</span><span class="plain-syntax"> = </span><span class="identifier-syntax">p</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">next</span><span class="plain-syntax">) {</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="../syntax-module/2-pn.html#SP5" class="function-link"><span class="function-syntax">Node::get_type</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">) == </span><span class="constant-syntax">UNPARSED_NOUN_NT</span><span class="plain-syntax">) {</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">q</span><span class="plain-syntax"> = </span><a href="../lexicon-module/1-lxc.html#SP3" class="function-link"><span class="function-syntax">Lexicon::retrieve</span></a><span class="plain-syntax">(</span><span class="constant-syntax">NOUN_MC</span><span class="plain-syntax">, </span><a href="../syntax-module/2-pn.html#SP4" class="function-link"><span class="function-syntax">Node::get_text</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">));</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">q</span><span class="plain-syntax">) </span><a href="../linguistics-module/2-nns.html#SP16" class="function-link"><span class="function-syntax">Nouns::set_node_to_be_usage_of_noun</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">, </span><a href="../linguistics-module/2-nns.html#SP14" class="function-link"><span class="function-syntax">Nouns::disambiguate</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">q</span><span class="plain-syntax">, </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">));</span>
<span class="plain-syntax"> }</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="../syntax-module/2-pn.html#SP5" class="function-link"><span class="function-syntax">Node::get_type</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">) == </span><span class="constant-syntax">UNPARSED_NOUN_NT</span><span class="plain-syntax">) </span><a href="../linguistics-module/2-nns.html#SP16" class="function-link"><span class="function-syntax">Nouns::recognise</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><a href="1-dgr2.html#SP4" class="function-link"><span class="function-syntax">Diagramming::parse_noun_phrases</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">p</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">down</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> }</span>
<span class="plain-syntax">}</span>

View file

@ -49,6 +49,7 @@
<pre class="definitions code-font"><span class="definition-keyword">define</span> <span class="constant-syntax">PROGRAM_NAME</span><span class="plain-syntax"> </span><span class="string-syntax">"linguistics-test"</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">VOCABULARY_CLSW</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">TEST_DIAGRAMS_CLSW</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">RAW_DIAGRAMS_CLSW</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">TEST_ARTICLES_CLSW</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">TEST_PRONOUNS_CLSW</span>
</pre>
@ -72,6 +73,8 @@
<span class="plain-syntax"> </span><a href="../../../inweb/docs/foundation-module/3-cla.html#SP5" class="function-link"><span class="function-syntax">CommandLine::declare_switch</span></a><span class="plain-syntax">(</span><span class="constant-syntax">TEST_DIAGRAMS_CLSW</span><span class="plain-syntax">, </span><span class="identifier-syntax">L</span><span class="string-syntax">"diagram"</span><span class="plain-syntax">, </span><span class="constant-syntax">2</span><span class="plain-syntax">,</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">L</span><span class="string-syntax">"test sentence diagrams from text in X"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><a href="../../../inweb/docs/foundation-module/3-cla.html#SP5" class="function-link"><span class="function-syntax">CommandLine::declare_switch</span></a><span class="plain-syntax">(</span><span class="constant-syntax">RAW_DIAGRAMS_CLSW</span><span class="plain-syntax">, </span><span class="identifier-syntax">L</span><span class="string-syntax">"raw"</span><span class="plain-syntax">, </span><span class="constant-syntax">2</span><span class="plain-syntax">,</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">L</span><span class="string-syntax">"test raw sentence diagrams from text in X"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><a href="../../../inweb/docs/foundation-module/3-cla.html#SP5" class="function-link"><span class="function-syntax">CommandLine::declare_switch</span></a><span class="plain-syntax">(</span><span class="constant-syntax">VOCABULARY_CLSW</span><span class="plain-syntax">, </span><span class="identifier-syntax">L</span><span class="string-syntax">"vocabulary"</span><span class="plain-syntax">, </span><span class="constant-syntax">2</span><span class="plain-syntax">,</span>
<span class="plain-syntax"> </span><span class="identifier-syntax">L</span><span class="string-syntax">"read vocabulary from file X for use in -diagram tests"</span><span class="plain-syntax">);</span>
<span class="plain-syntax"> </span><a href="../../../inweb/docs/foundation-module/3-cla.html#SP5" class="function-link"><span class="function-syntax">CommandLine::declare_switch</span></a><span class="plain-syntax">(</span><span class="constant-syntax">TEST_ARTICLES_CLSW</span><span class="plain-syntax">, </span><span class="identifier-syntax">L</span><span class="string-syntax">"test-articles"</span><span class="plain-syntax">, </span><span class="constant-syntax">2</span><span class="plain-syntax">,</span>
@ -93,8 +96,11 @@
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Main::respond</span><span class="plain-syntax">(</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">id</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">val</span><span class="plain-syntax">, </span><span class="reserved-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">arg</span><span class="plain-syntax">, </span><span class="reserved-syntax">void</span><span class="plain-syntax"> *</span><span class="identifier-syntax">state</span><span class="plain-syntax">) {</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">id</span><span class="plain-syntax">) {</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">VOCABULARY_CLSW:</span><span class="plain-syntax"> </span><a href="1-bnk.html#SP2" class="function-link"><span class="function-syntax">Banking::load_from_file</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">arg</span><span class="plain-syntax">); </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">RAW_DIAGRAMS_CLSW:</span>
<span class="plain-syntax"> </span><a href="1-int.html#SP1" class="function-link"><span class="function-syntax">Interpreting::go</span></a><span class="plain-syntax">(</span><a href="1-dgr2.html#SP2" class="function-link"><span class="function-syntax">Diagramming::test_diagrams</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">arg</span><span class="plain-syntax">, </span><span class="constant-syntax">TRUE</span><span class="plain-syntax">));</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">TEST_DIAGRAMS_CLSW:</span>
<span class="plain-syntax"> </span><a href="1-int.html#SP1" class="function-link"><span class="function-syntax">Interpreting::go</span></a><span class="plain-syntax">(</span><a href="1-dgr2.html#SP2" class="function-link"><span class="function-syntax">Diagramming::test_diagrams</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">arg</span><span class="plain-syntax">));</span>
<span class="plain-syntax"> </span><a href="1-int.html#SP1" class="function-link"><span class="function-syntax">Interpreting::go</span></a><span class="plain-syntax">(</span><a href="1-dgr2.html#SP2" class="function-link"><span class="function-syntax">Diagramming::test_diagrams</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">arg</span><span class="plain-syntax">, </span><span class="constant-syntax">FALSE</span><span class="plain-syntax">));</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax"> </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">TEST_ARTICLES_CLSW:</span>
<span class="plain-syntax"> </span><a href="../linguistics-module/2-art.html#SP10" class="function-link"><span class="function-syntax">Articles::create_small_word_sets</span></a><span class="plain-syntax">();</span>

View file

@ -212,7 +212,7 @@ Total memory consumption was 257140K = 251 MB
37.4% was used for memory not allocated for objects:
15.8% text stream storage 41853108 bytes in 263306 claims
15.8% text stream storage 41852724 bytes in 263306 claims
3.5% dictionary storage 9265152 bytes in 16345 claims
---- sorting 1112 bytes in 3 claims
2.7% source text 7200000 bytes in 3 claims

View file

@ -1,13 +1,13 @@
100.0% in inform7 run
66.4% in compilation to Inter
66.5% in compilation to Inter
25.5% in //Phrases::Manager::compile_first_block//
8.5% in //Phrases::Manager::compile_as_needed//
8.6% in //Phrases::Manager::compile_as_needed//
6.9% in //Strings::compile_responses//
6.0% in //World::Compile::compile//
3.4% in //Assertions::Traverse::traverse1//
3.2% in //Sentences::VPs::traverse//
2.1% in //Phrases::Manager::RulePrintingRule_routine//
1.9% in //Phrases::Manager::rulebooks_array//
2.0% in //Phrases::Manager::RulePrintingRule_routine//
1.8% in //Phrases::Manager::rulebooks_array//
1.1% in //NewVerbs::ConjugateVerb//
0.7% in //Phrases::Manager::traverse//
0.5% in //Phrases::Manager::parse_rule_parameters//
@ -19,11 +19,11 @@
0.1% in //Sentences::RuleSubtrees::register_recently_lexed_phrases//
0.1% in //Task::load_types//
0.1% in //World::complete//
3.9% not specifically accounted for
31.2% in running Inter pipeline
4.2% not specifically accounted for
31.3% in running Inter pipeline
10.2% in step preparation
9.8% in inter step 2/12: link
7.3% in inter step 12/12: generate inform6 -> auto.inf
7.5% in inter step 12/12: generate inform6 -> auto.inf
0.3% in inter step 9/12: make-identifiers-unique
0.1% in inter step 10/12: reconcile-verbs
0.1% in inter step 11/12: eliminate-redundant-labels
@ -32,5 +32,4 @@
0.1% in inter step 7/12: resolve-external-symbols
0.1% in inter step 8/12: inspect-plugs
2.2% not specifically accounted for
2.1% in supervisor
0.2% not specifically accounted for
2.0% in supervisor

File diff suppressed because it is too large Load diff

View file

@ -319,7 +319,7 @@ commit:
# -----------------------------------------------------------------------------
.PHONY: pages
pages: icon readmepage prepages {repeat-tools-span}@PAGES{end-span} \
pages: icon readmepage diagrams prepages {repeat-tools-span}@PAGES{end-span} \
{repeat-modules-span}@MPAGES{end-span} morepages
.PHONY: icon
@ -329,13 +329,18 @@ icon:
cp -f docs-src/Inform.png docs/docs-assets
.PHONY: forcepages
forcepages: readmepage forceprepages {repeat-tools-span}@FORCEPAGES{end-span} \
forcepages: readmepage diagrams forceprepages {repeat-tools-span}@FORCEPAGES{end-span} \
{repeat-modules-span}@FORCEMPAGES{end-span} forcemorepages
.PHONY: readmepage
readmepage:
$(INWEBX) -prototype scripts/READMEscript.txt -write-me README.md
.PHONY: diagrams
diagrams:
cp -f services/linguistics-test/Tests/Test\ Diagrams/_Results_Ideal/*.txt services/linguistics-module/Figures
cp -f services/linguistics-test/Tests/vocabulary.txt services/linguistics-module/Figures
{repeat-tools-block:ctools}
.PHONY: @PAGES
@PAGES: docs/$(@LEAF)/index.html

View file

@ -25,7 +25,6 @@ some new node types:
@e verbal_certainty_ANNOT /* |int|: certainty level if known */
@e sentence_is_existential_ANNOT /* |int|: such as "there is a man" */
@e linguistic_error_here_ANNOT /* |int|: one of the errors occurred here */
@e inverted_verb_ANNOT /* |int|: an inversion of subject and object has occurred */
@e possessive_verb_ANNOT /* |int|: this is a non-relative use of "to have" */
@e verb_ANNOT /* |verb_usage|: what's being done here */
@e noun_ANNOT /* |noun_usage|: what's being done here */
@ -90,7 +89,6 @@ void Diagrams::permissions(void) {
Annotations::allow(VERB_NT, verbal_certainty_ANNOT);
Annotations::allow(VERB_NT, sentence_is_existential_ANNOT);
Annotations::allow(VERB_NT, possessive_verb_ANNOT);
Annotations::allow(VERB_NT, inverted_verb_ANNOT);
Annotations::allow(VERB_NT, verb_ANNOT);
Annotations::allow(VERB_NT, preposition_ANNOT);
Annotations::allow(VERB_NT, second_preposition_ANNOT);
@ -123,20 +121,21 @@ void Diagrams::log_node(OUTPUT_STREAM, parse_node *pn) {
if (Node::get_verb(pn))
VerbUsages::write_usage(OUT, Node::get_verb(pn));
if (Annotations::read_int(pn, sentence_is_existential_ANNOT))
WRITE(" (existential)");
WRITE(" {existential}");
if (Annotations::read_int(pn, possessive_verb_ANNOT))
WRITE(" (possessive)");
if (Annotations::read_int(pn, inverted_verb_ANNOT))
WRITE(" (inverted)");
WRITE(" {possessive}");
if (Node::get_verb_meaning(pn))
WRITE(" rel:%S", VerbMeanings::get_regular_meaning(Node::get_verb_meaning(pn))->debugging_log_name);
WRITE(" {meaning: %S}",
VerbMeanings::get_regular_meaning(Node::get_verb_meaning(pn))->debugging_log_name);
if (Annotations::read_int(pn, verbal_certainty_ANNOT) != UNKNOWN_CE) {
WRITE(" certainty:");
WRITE(" {certainty:");
Certainty::write(OUT, Annotations::read_int(pn, verbal_certainty_ANNOT));
WRITE("}");
}
if (Node::get_occurrence(pn)) {
WRITE(" occurrence:");
WRITE(" {occurrence: ");
Occurrence::log(OUT, Node::get_occurrence(pn));
WRITE("}");
}
break;
case UNPARSED_NOUN_NT:
@ -152,7 +151,7 @@ void Diagrams::log_node(OUTPUT_STREAM, parse_node *pn) {
Articles::write_usage(OUT, Node::get_article(pn));
break;
case RELATIONSHIP_NT:
WRITE(" rel:");
WRITE(" {meaning: ");
switch (Annotations::read_int(pn, relationship_node_type_ANNOT)) {
case STANDARD_RELN:
if (Node::get_relationship(pn))
@ -161,6 +160,7 @@ void Diagrams::log_node(OUTPUT_STREAM, parse_node *pn) {
case PARENTAGE_HERE_RELN: WRITE("(here)"); break;
case DIRECTION_RELN: WRITE("(direction)"); break;
}
WRITE("}");
break;
}
}

View file

@ -20,14 +20,16 @@ matched against some form of a pronoun.
=
typedef struct article_usage {
struct article *article_used;
struct vocabulary_entry *word_used;
struct grammatical_usage *usage;
CLASS_DEFINITION
} article_usage;
@ =
void Articles::write_usage(OUTPUT_STREAM, article_usage *au) {
WRITE(" %S", au->article_used->name);
WRITE(" {%S '%V'", au->article_used->name, au->word_used);
Stock::write_usage(OUT, au->usage, GENDER_LCW + NUMBER_LCW + CASE_LCW);
WRITE("}");
}
@ The stock of articles is fixed at two:
@ -40,8 +42,8 @@ article *indefinite_article = NULL;
void Articles::create_category(void) {
articles_category = Stock::new_category(I"article");
METHOD_ADD(articles_category, LOG_GRAMMATICAL_CATEGORY_MTID, Articles::log_item);
definite_article = Articles::new(I"definite article");
indefinite_article = Articles::new(I"indefinite article");
definite_article = Articles::new(I"definite");
indefinite_article = Articles::new(I"indefinite");
}
article *Articles::new(text_stream *name) {
@ -172,6 +174,7 @@ small_word_set *Articles::add(small_word_set *sws, nonterminal *nt, article *a)
if (au == NULL) {
au = CREATE(article_usage);
au->article_used = a;
au->word_used = alt->ve_pt;
au->usage = Stock::new_usage(a->in_stock, NULL);
Stock::add_to_sws(sws, alt->ve_pt, au);
}

View file

@ -79,9 +79,10 @@ typedef struct noun_usage {
@ =
void Nouns::write_usage(OUTPUT_STREAM, noun_usage *nu) {
if (nu->noun_used->noun_subclass == COMMON_NOUN) WRITE(" (common)");
if (nu->noun_used->noun_subclass == PROPER_NOUN) WRITE(" (proper)");
if (nu->noun_used->noun_subclass == COMMON_NOUN) WRITE(" {common");
if (nu->noun_used->noun_subclass == PROPER_NOUN) WRITE(" {proper");
Stock::write_usage(OUT, nu->usage, GENDER_LCW+NUMBER_LCW+CASE_LCW);
WRITE("}");
}
@ Nouns are a grammatical category:
@ -295,11 +296,16 @@ int Nouns::is_eligible_match(noun *nt, int common_only) {
@h Actual usage.
=
void Nouns::recognise(parse_node *p) {
parse_node *q = Lexicon::retrieve(NOUN_MC, Node::get_text(p));
if (q) Nouns::set_node_to_be_usage_of_noun(p, Nouns::disambiguate(q, FALSE));
}
void Nouns::set_node_to_be_usage_of_noun(parse_node *p, noun_usage *nu) {
if (nu->noun_used->noun_subclass == COMMON_NOUN)
Node::set_type_and_clear_annotations(p, COMMON_NOUN_NT);
Node::set_type(p, COMMON_NOUN_NT);
else
Node::set_type_and_clear_annotations(p, PROPER_NOUN_NT);
Node::set_type(p, PROPER_NOUN_NT);
Node::set_noun(p, nu);
}

View file

@ -31,8 +31,9 @@ typedef struct pronoun_usage {
@ =
void Pronouns::write_usage(OUTPUT_STREAM, pronoun_usage *pu) {
WRITE(" %S", pu->pronoun_used->name);
WRITE(" {%S", pu->pronoun_used->name);
Stock::write_usage(OUT, pu->usage, PERSON_LCW + GENDER_LCW + NUMBER_LCW + CASE_LCW);
WRITE("}");
}
@ The stock of pronouns is fixed at six. We are going to regard the three

View file

@ -32,8 +32,11 @@ typedef struct verb_usage {
@ =
void VerbUsages::write_usage(OUTPUT_STREAM, verb_usage *vu) {
if (vu == NULL) { WRITE("(null verb usage)"); return; }
WRITE(" verb '%A'", &(vu->vu_text));
WRITE(" {verb");
verb *V = VerbUsages::get_verb(vu);
if (V) WRITE(" '%A'", &(V->conjugation->infinitive));
Stock::write_usage(OUT, vu->usage, SENSE_LCW+MOOD_LCW+TENSE_LCW+PERSON_LCW+NUMBER_LCW);
WRITE("}");
}
@h Search list and tiers.

View file

@ -6,6 +6,7 @@ Licence: Artistic License 2.0
Preliminaries
What This Module Does
About Sentence Diagrams
How To Include This Module
Chapter 1: Setting Up

View file

@ -0,0 +1,47 @@
(1) a sailor called jack silver is on the table
SENTENCE_NT'a sailor called jack silver is on the table'
VERB_NT'is on' {verb 'be' 3p s act IS_TENSE +ve} {meaning: carries}
CALLED_NT'called'
COMMON_NOUN_NT'a sailor' {common nom/acc m s}
UNPARSED_NOUN_NT'jack silver'
RELATIONSHIP_NT'is on' {meaning: carries-reversed}
COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
(2) on the table is a sailor called ben gunn
SENTENCE_NT'on the table is a sailor called ben gunn'
VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {meaning: is}
RELATIONSHIP_NT'on the table' {meaning: carries-reversed}
COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
CALLED_NT'called'
COMMON_NOUN_NT'sailor' {common nom/acc m s} {indefinite 'a' n/m/f nom/acc s}
UNPARSED_NOUN_NT'ben gunn'
(3) there is a sailor called captain flint
SENTENCE_NT'there is a sailor called captain flint'
VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {existential} {meaning: is}
DEFECTIVE_NOUN_NT'there'
CALLED_NT'called'
COMMON_NOUN_NT'sailor' {common nom/acc m s} {indefinite 'a' n/m/f nom/acc s}
UNPARSED_NOUN_NT'captain flint'
(4) there is a table called the billiards and snooker table
SENTENCE_NT'there is a table called the billiards and snooker table'
VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {existential} {meaning: is}
DEFECTIVE_NOUN_NT'there'
CALLED_NT'called'
COMMON_NOUN_NT'table' {common nom/acc n s} {indefinite 'a' n/m/f nom/acc s}
UNPARSED_NOUN_NT'billiards and snooker table' {definite 'the' n/m/f s/p nom/acc}
(5) there is a table called the billiards table with deep pockets
SENTENCE_NT'there is a table called the billiards table with deep pocket'
VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {existential} {meaning: is}
DEFECTIVE_NOUN_NT'there'
CALLED_NT'called'
COMMON_NOUN_NT'table' {common nom/acc n s} {indefinite 'a' n/m/f nom/acc s}
UNPARSED_NOUN_NT'billiards table with deep pockets' {definite 'the' n/m/f s/p nom/acc}

View file

@ -0,0 +1,52 @@
(1) anna and beth are women
SENTENCE_NT'anna and beth are women'
VERB_NT'are' {verb 'be' s/p 2p act IS_TENSE +ve + 1p/3p p act IS_TENSE +ve} {meaning: is}
AND_NT'and'
PROPER_NOUN_NT'anna' {proper nom/acc f s}
PROPER_NOUN_NT'beth' {proper nom/acc f s}
COMMON_NOUN_NT'women' {common nom/acc f p}
(2) anna , beth and charles are sailors
SENTENCE_NT'anna , beth and charles are sailors'
VERB_NT'are' {verb 'be' s/p 2p act IS_TENSE +ve + 1p/3p p act IS_TENSE +ve} {meaning: is}
AND_NT','
PROPER_NOUN_NT'anna' {proper nom/acc f s}
AND_NT'and'
PROPER_NOUN_NT'beth' {proper nom/acc f s}
PROPER_NOUN_NT'charles' {proper nom/acc m s}
COMMON_NOUN_NT'sailors' {common nom/acc m p}
(3) anna , beth , and charles are sailors
SENTENCE_NT'anna , beth , and charles are sailors'
VERB_NT'are' {verb 'be' s/p 2p act IS_TENSE +ve + 1p/3p p act IS_TENSE +ve} {meaning: is}
AND_NT','
PROPER_NOUN_NT'anna' {proper nom/acc f s}
AND_NT','
PROPER_NOUN_NT'beth' {proper nom/acc f s}
PROPER_NOUN_NT'charles' {proper nom/acc m s}
COMMON_NOUN_NT'sailors' {common nom/acc m p}
(4) anna carries the table and the ming vase
SENTENCE_NT'anna carries the table and the ming vase'
VERB_NT'carries' {verb 'carry' 3p s act IS_TENSE +ve} {meaning: carries}
PROPER_NOUN_NT'anna' {proper nom/acc f s}
RELATIONSHIP_NT'carries' {meaning: carries-reversed}
AND_NT'and'
COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
COMMON_NOUN_NT'ming vase' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
(5) anna is on the table and under the ming vase
SENTENCE_NT'anna is on the table and under the ming vase'
VERB_NT'is on' {verb 'be' 3p s act IS_TENSE +ve} {meaning: carries}
PROPER_NOUN_NT'anna' {proper nom/acc f s}
RELATIONSHIP_NT'is on' {meaning: carries-reversed}
AND_NT'and'
COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
RELATIONSHIP_NT'under the ming vase' {meaning: carries}
COMMON_NOUN_NT'ming vase' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}

View file

@ -0,0 +1,14 @@
(1) anna is a woman
SENTENCE_NT'anna is a woman'
VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {meaning: is}
PROPER_NOUN_NT'anna' {proper nom/acc f s}
COMMON_NOUN_NT'woman' {common nom/acc f s} {indefinite 'a' n/m/f nom/acc s}
(2) anna is not charles
SENTENCE_NT'anna is not charles'
VERB_NT'is not' {verb 'be' 3p s act IS_TENSE -ve} {meaning: is}
PROPER_NOUN_NT'anna' {proper nom/acc f s}
PROPER_NOUN_NT'charles' {proper nom/acc m s}

View file

@ -0,0 +1,17 @@
(1) on the table is the ming vase
SENTENCE_NT'on the table is the ming vase'
VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {meaning: is}
RELATIONSHIP_NT'on the table' {meaning: carries-reversed}
COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
COMMON_NOUN_NT'ming vase' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
(2) on the table is under the ming vase
SENTENCE_NT'on the table is under the ming vase'
VERB_NT'is under' {verb 'be' 3p s act IS_TENSE +ve} {meaning: carries-reversed}
RELATIONSHIP_NT'on the table' {meaning: carries-reversed}
COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
RELATIONSHIP_NT'is under' {meaning: carries}
COMMON_NOUN_NT'ming vase' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}

View file

@ -0,0 +1,32 @@
(1) beth carries the ming vase
SENTENCE_NT'beth carries the ming vase'
VERB_NT'carries' {verb 'carry' 3p s act IS_TENSE +ve} {meaning: carries}
PROPER_NOUN_NT'beth' {proper nom/acc f s}
RELATIONSHIP_NT'carries' {meaning: carries-reversed}
COMMON_NOUN_NT'ming vase' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
(2) the sailors carry the table
SENTENCE_NT'the sailors carry the table'
VERB_NT'carry' {verb 'carry' 1p/2p s/p act IS_TENSE +ve + 3p p act IS_TENSE +ve} {meaning: carries}
COMMON_NOUN_NT'sailors' {common nom/acc m p} {definite 'the' n/m/f s/p nom/acc}
RELATIONSHIP_NT'carry' {meaning: carries-reversed}
COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
(3) the ming vase is carried by beth
SENTENCE_NT'the ming vase is carried by beth'
VERB_NT'is carried by' {verb 'be' 3p s act IS_TENSE +ve} {meaning: carries-reversed}
COMMON_NOUN_NT'ming vase' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
RELATIONSHIP_NT'is carried by' {meaning: carries}
PROPER_NOUN_NT'beth' {proper nom/acc f s}
(4) a woman is on the table
SENTENCE_NT'a woman is on the table'
VERB_NT'is on' {verb 'be' 3p s act IS_TENSE +ve} {meaning: carries}
COMMON_NOUN_NT'woman' {common nom/acc f s} {indefinite 'a' n/m/f nom/acc s}
RELATIONSHIP_NT'is on' {meaning: carries-reversed}
COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}

View file

@ -0,0 +1,12 @@
linguistics-test: sentence failed to parse
(1) arfle barfle gloop
SENTENCE_NT'arfle barfle gloop'
(2) beth is not a sailor
SENTENCE_NT'beth is not a sailor'
VERB_NT'is not' {verb 'be' 3p s act IS_TENSE -ve} {meaning: is}
UNPARSED_NOUN_NT'beth'
UNPARSED_NOUN_NT'sailor' {indefinite 'a' n/m/f nom/acc s}

View file

@ -0,0 +1,7 @@
(1) beth is not a sailor
SENTENCE_NT'beth is not a sailor'
VERB_NT'is not' {verb 'be' 3p s act IS_TENSE -ve} {meaning: is}
PROPER_NOUN_NT'beth' {proper nom/acc f s}
COMMON_NOUN_NT'sailor' {common nom/acc m s} {indefinite 'a' n/m/f nom/acc s}

View file

@ -146,8 +146,8 @@ adjective: A134''
adjective: A135''
adjective: A136''
article: definite article
article: indefinite article
article: definite
article: indefinite
noun: common: 'value'
noun: common: 'pointer value'

View file

@ -0,0 +1,14 @@
(1) there is a table
SENTENCE_NT'there is a table'
VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {existential} {meaning: is}
DEFECTIVE_NOUN_NT'there'
COMMON_NOUN_NT'table' {common nom/acc n s} {indefinite 'a' n/m/f nom/acc s}
(2) some sailors are there
SENTENCE_NT'some sailors are there'
VERB_NT'are' {verb 'be' s/p 2p act IS_TENSE +ve + 1p/3p p act IS_TENSE +ve} {meaning: is}
COMMON_NOUN_NT'sailors' {common nom/acc m p} {indefinite 'some' n/m/f nom/acc p}
UNPARSED_NOUN_NT'there'

View file

@ -0,0 +1,16 @@
(1) beth always carries the ming vase
SENTENCE_NT'beth always carries the ming vase'
VERB_NT'carries' {verb 'carry' 3p s act IS_TENSE +ve} {meaning: carries} {certainty:certain}
PROPER_NOUN_NT'beth' {proper nom/acc f s}
RELATIONSHIP_NT'carries' {meaning: carries-reversed}
COMMON_NOUN_NT'ming vase' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
(2) anna carries the ming vase for the third time
SENTENCE_NT'anna carries the ming vase for the third time'
VERB_NT'carries' {verb 'carry' 3p s act IS_TENSE +ve} {meaning: carries} {occurrence: <3 times>}
PROPER_NOUN_NT'anna' {proper nom/acc f s}
RELATIONSHIP_NT'carries' {meaning: carries-reversed}
COMMON_NOUN_NT'ming vase' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}

View file

@ -0,0 +1,40 @@
(1) he knows her
SENTENCE_NT'he knows her'
VERB_NT'knows' {verb 'know' 3p s act IS_TENSE +ve} {meaning: knows}
PRONOUN_NT'he' {third person pronoun m 3p s nom}
RELATIONSHIP_NT'knows' {meaning: knows-reversed}
PRONOUN_NT'her' {third person pronoun f 3p s acc}
(2) she knows him
SENTENCE_NT'she knows him'
VERB_NT'knows' {verb 'know' 3p s act IS_TENSE +ve} {meaning: knows}
PRONOUN_NT'she' {third person pronoun f 3p s nom}
RELATIONSHIP_NT'knows' {meaning: knows-reversed}
PRONOUN_NT'him' {third person pronoun m 3p s acc}
(3) i carry the ming vase
SENTENCE_NT'i carry the ming vase'
VERB_NT'carry' {verb 'carry' 1p/2p s/p act IS_TENSE +ve + 3p p act IS_TENSE +ve} {meaning: carries}
PRONOUN_NT'i' {first person pronoun n/m/f 1p s nom}
RELATIONSHIP_NT'carry' {meaning: carries-reversed}
COMMON_NOUN_NT'ming vase' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
(4) the sailors know them
SENTENCE_NT'the sailors know them'
VERB_NT'know' {verb 'know' 1p/2p s/p act IS_TENSE +ve + 3p p act IS_TENSE +ve} {meaning: knows}
COMMON_NOUN_NT'sailors' {common nom/acc m p} {definite 'the' n/m/f s/p nom/acc}
RELATIONSHIP_NT'know' {meaning: knows-reversed}
PRONOUN_NT'them' {third person pronoun n/m/f 3p p acc}
(5) you know us
SENTENCE_NT'you know us'
VERB_NT'know' {verb 'know' 1p/2p s/p act IS_TENSE +ve + 3p p act IS_TENSE +ve} {meaning: knows}
PRONOUN_NT'you' {second person pronoun n/m/f s/p nom/acc 2p}
RELATIONSHIP_NT'know' {meaning: knows-reversed}
PRONOUN_NT'us' {first person pronoun n/m/f 1p p acc}

View file

@ -0,0 +1,23 @@
IS = relationship.
HAS = relationship.
CARRIES = relationship.
KNOWS = relationship.
be = verb meaning IS with priority 2.
have = verb meaning HAS with priority 1.
carry = verb meaning CARRIES with priority 3.
know = verb meaning KNOWS with priority 3.
be + on = preposition meaning CARRIES.
be + under = preposition meaning CARRIES-reversed.
Anna = feminine proper noun.
Beth = feminine proper noun.
Charles = masculine proper noun.
man = masculine common noun.
woman = feminine common noun.
person = masculine common noun.
sailor = masculine common noun.
table = neuter common noun.
Ming vase = neuter common noun.

View file

@ -0,0 +1,74 @@
(1) on the table is a sailor with carrying capacity 10
SENTENCE_NT'on the table is a sailor with carrying capacity 10'
VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {meaning: is}
RELATIONSHIP_NT'on the table' {meaning: carries-reversed}
COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
WITH_NT'with'
COMMON_NOUN_NT'sailor' {common nom/acc m s} {indefinite 'a' n/m/f nom/acc s}
PROPERTY_LIST_NT'carrying capacity 10'
(2) a sailor with carrying capacity 10 is on the table
SENTENCE_NT'a sailor with carrying capacity 10 is on the table'
VERB_NT'is on' {verb 'be' 3p s act IS_TENSE +ve} {meaning: carries}
WITH_NT'with'
COMMON_NOUN_NT'sailor' {common nom/acc m s} {indefinite 'a' n/m/f nom/acc s}
PROPERTY_LIST_NT'carrying capacity 10'
RELATIONSHIP_NT'is on' {meaning: carries-reversed}
COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
(3) on the table is a sailor with carrying capacity 10 and wealth 12
SENTENCE_NT'on the table is a sailor with carrying capacity 10 and wealt'
VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {meaning: is}
RELATIONSHIP_NT'on the table' {meaning: carries-reversed}
COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
WITH_NT'with'
COMMON_NOUN_NT'sailor' {common nom/acc m s} {indefinite 'a' n/m/f nom/acc s}
AND_NT'and'
PROPERTY_LIST_NT'carrying capacity 10'
PROPERTY_LIST_NT'wealth 12'
(4) on the table is a sailor with carrying capacity 10 , wealth 12 , and sea count 7
SENTENCE_NT'on the table is a sailor with carrying capacity 10 , wealth '
VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {meaning: is}
RELATIONSHIP_NT'on the table' {meaning: carries-reversed}
COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
WITH_NT'with'
COMMON_NOUN_NT'sailor' {common nom/acc m s} {indefinite 'a' n/m/f nom/acc s}
AND_NT','
PROPERTY_LIST_NT'carrying capacity 10'
AND_NT','
PROPERTY_LIST_NT'wealth 12'
PROPERTY_LIST_NT'sea count 7'
(5) there is a kind of sailor called an admiral
SENTENCE_NT'there is a kind of sailor called an admiral'
VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {existential} {meaning: is}
DEFECTIVE_NOUN_NT'there'
CALLED_NT'called'
KIND_NT'kind of sailor'
COMMON_NOUN_NT'sailor' {common nom/acc m s}
UNPARSED_NOUN_NT'admiral' {indefinite 'an' n/m/f nom/acc s}
(6) an admiral is a kind of sailor
SENTENCE_NT'an admiral is a kind of sailor'
VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {meaning: is}
UNPARSED_NOUN_NT'admiral' {indefinite 'an' n/m/f nom/acc s}
KIND_NT'kind of sailor'
COMMON_NOUN_NT'sailor' {common nom/acc m s}
(7) an admiral is a kind of sailor with wealth 50
SENTENCE_NT'an admiral is a kind of sailor with wealth 50'
VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {meaning: is}
UNPARSED_NOUN_NT'admiral' {indefinite 'an' n/m/f nom/acc s}
WITH_NT'with'
KIND_NT'kind of sailor'
COMMON_NOUN_NT'sailor' {common nom/acc m s}
PROPERTY_LIST_NT'wealth 50'

View file

@ -0,0 +1,107 @@
About Sentence Diagrams.
Description and examples of the diagrams which this module turns sentences into.
@ First, an acknowledgement: the sentence diagrams in this section are generated
automatically by //linguistics-test//. (This means they are always up to date.)
If you are interested in using //linguistics// in some context other than Inform,
//linguistics-test// may be a good starting point.
@ Every example sentence in this section was passed in turn to the <sentence>
nonterminal, and the trees displayed below were the result. For example:
= (undisplayed text from Figures/simple-raw.txt)
Sentence (1) here made no sense: there was no verb. It was therefore left as
a single |SENTENCE_NT| node with no children. In all other cases, as in (2),
there are three children: verb, subject phrase, and object phrase.[1]
In this tree notation, indentation shows which nodes are children of which
others. The node types, such as |SENTENCE_NT|, are in capitals and all end
in |_NT|. The text leading to the creation of the node then appears in quotes.
After that are "annotations", written in braces.[2] In sentence (2), we see:
(a) The |VERB_NT| node is annotated with its grammatical form -- it is "to be",
in third person singular, active mood, present tense, and a negative sense --
and also its semantic meaning -- the equality relationship "is".
(b) The second |UNPARSED_NOUN_NT| node is annotated with the article used to
introduce it -- the indefinite article, "a", which could be any of masculine,
feminine or neuter, could be either nominative or accusative, but is
certainly singular.
[1] Since "to be" is a copular verb, in sentence (2) we really mean "the
phrase in the object position".
[2] Since the 1850s a variety of tree-diagram schemes for sentence structure
have been proposed: see //Wikipedia -> https://en.wikipedia.org/wiki/Sentence_diagram//.
These tend to be quite large, with many optional features -- no bad thing when
the aim is to explain. But our aim is to process, not to illustrate, and
whereas a typical dependency tree would have nodes for both "not" and "a",
we use annotations instead. The aim is to have flattish sentence trees
with a simple, predictable shape.
@ Using <sentence> alone tends to result in a lot of |UNPARSED_NOUN_NT| nodes.
This is unsatisfying, but useful, because sometimes the meaning of a verb
affects how those nodes should be parsed further. The idea is that the user
will traverse the tree and parse the |UNPARSED_NOUN_NT| nodes as needed.
Calling the function //Nouns::recognise// on such a node will test to see
if it's a known common or proper noun, and amend it accordingly.
The //linguistics-test// program does this automatically, so from here on,
all examples shown will have that operation done. For example:
= (undisplayed text from Figures/simple.txt)
Here the two |UNPARSED_NOUN_NT| nodes have been recognised as usages of a
proper noun, Beth, and a common noun, sailor, respectively, and they are
annotated with their grammatical usages -- in so far as we can tell. These
two nouns do not inflect with case in English, but they are both singular.
@ Clearly the //linguistics// module needs to know some vocabulary in order
to do this, and in the test runs displayed in this section, it is using a
very limited stock of nouns, verbs and prepositions as follows:
= (undisplayed text from Figures/vocabulary.txt)
We only know that Beth is feminine-gendered and sailor masculine-gendered[1]
because the vocabulary being used by //linguistics-test// says so. It's
important to appreciate that although an English reader might twig that
Beth is a common girl's name, we can't do that.
[1] In the grammatical sense that "she" can refer to Beth and "he" to a
generic identity-unknown sailor. Pronouns in English are a source of real
sensitivity and if //linguistics// were a module to generate text, rather
than recognise it, we would take much more care over this. Our interest
is in grammatical gender, not the assignment of sexes to people.
@ So, then, let us start with simple copular sentences -- that is,
sentences involving the verb "to be", which equate two subjects rather
than having a subject act upon an object. This is why one "ought to" say
"The traitor is I" instead of "The traitor is me", although nobody does.
= (undisplayed text from Figures/copular.txt)
@ Next, regular sentences, that is, those where the verb is not copular
but instead expresses some relationship between a subject and an object
which play different roles.
= (undisplayed text from Figures/regular.txt)
@ An unusual feature of English is its use of subject-verb inversion:
= (undisplayed text from Figures/inversion.txt)
It would be easy to auto-fix the inversion in sentence (1), by simply
swapping the "on the table" and "Ming vase" subtrees over, but we want
to preserve the distinction because Inform will make some use of it.
Sentence (2) here is arguably just plain wrong, but we do very occasionally
allow that sort of thing in Inform (for e.g. "east of X is south of Y").
@ Now we introduce pronouns to the mix. These are detected automatically
by //linguistics//, and exist in nominative and accusative cases in
English. Note the difference in annotations between "them" and "you",
for example.
= (undisplayed text from Figures/usingpronouns.txt)

View file

@ -23,10 +23,13 @@ the ones students draw in school grammar classes. For example,
>> most of the heavy bricks have been on top of the wall
becomes a "diagram" -- a fragment of the tree provided by the //syntax//
module -- in which the relationship "to be on top of" appears as the root,
with two noun phrases, "most of the heavy bricks" and "the wall", beneath it.
module -- showing the linguistic structure of the sentence.
To be in a position to do this, the module needs a way to accumulate
This work is done by the nonterminal <sentence> -- see //Verb Phrases//.
Many examples of sentence diagrams can be seen in //About Sentence Diagrams//;
read that first.
To be in a position to parse like this, the module needs a way to accumulate
knowledge about the possible nouns, verbs, adjectives, prepositions and so on
which might appear in such sentences. Where sensible, a design goal here is
for each of these grammatical categories to correspond closely to an object
@ -101,7 +104,7 @@ Note that these are not part of the stock. It wouldn't really make sense
for them to be so: we would need a potentially infinite number of them to
accommodate the possible range of integers which appear.
@h Noun phrases.
@h Stock for noun phrases.
For convenience we will run through the stock in two sets: those grammatical
categories used in noun phrases, and provided by //Chapter 2//; and those
used in verb phrases, //Chapter 3//. In alphabetical order:
@ -154,7 +157,7 @@ as referring to this one specific object, just as "Mary" will.
at three, all automatically created: the subject (he, she), object (him, her)
and possessive (his, her) pronouns. See //Pronouns//.
@h Verb phrases.
@h Stock for verb phrases.
Adverb phrases of occurrence refers to wording such as "for the sixth time".
The stock of these is fixed, though as with determiners, each is really a

View file

@ -19,7 +19,7 @@ int Diagramming::allow_in_assertions(verb_conjugation *vc, int tense, int sense,
=
parse_node_tree *syntax_tree = NULL;
parse_node_tree *Diagramming::test_diagrams(text_stream *arg) {
parse_node_tree *Diagramming::test_diagrams(text_stream *arg, int raw) {
syntax_tree = SyntaxTree::new();
@<Turn the file into a syntax tree@>;
@<Use the linguistics module on each sentence@>;
@ -36,7 +36,7 @@ parse_node_tree *Diagramming::test_diagrams(text_stream *arg) {
@<Use the linguistics module on each sentence@> =
SyntaxTree::traverse(syntax_tree, Diagramming::diagram);
Diagramming::parse_noun_phrases(syntax_tree->root_node);
if (raw == FALSE) Diagramming::parse_noun_phrases(syntax_tree->root_node);
@ The work of the //words// and //syntax// modules means that we now have a
rudimentary syntax tree, in which each sentence is just a single |SENTENCE_NT|
@ -67,10 +67,7 @@ by default parsed: they are simply left as |UNPARSED_NOUN_NT| nodes.
=
void Diagramming::parse_noun_phrases(parse_node *p) {
for (; p; p = p->next) {
if (Node::get_type(p) == UNPARSED_NOUN_NT) {
parse_node *q = Lexicon::retrieve(NOUN_MC, Node::get_text(p));
if (q) Nouns::set_node_to_be_usage_of_noun(p, Nouns::disambiguate(q, FALSE));
}
if (Node::get_type(p) == UNPARSED_NOUN_NT) Nouns::recognise(p);
Diagramming::parse_noun_phrases(p->down);
}
}

View file

@ -8,6 +8,7 @@ What shall we test?
@e VOCABULARY_CLSW
@e TEST_DIAGRAMS_CLSW
@e RAW_DIAGRAMS_CLSW
@e TEST_ARTICLES_CLSW
@e TEST_PRONOUNS_CLSW
@ -31,6 +32,8 @@ int main(int argc, char **argv) {
CommandLine::declare_switch(TEST_DIAGRAMS_CLSW, L"diagram", 2,
L"test sentence diagrams from text in X");
CommandLine::declare_switch(RAW_DIAGRAMS_CLSW, L"raw", 2,
L"test raw sentence diagrams from text in X");
CommandLine::declare_switch(VOCABULARY_CLSW, L"vocabulary", 2,
L"read vocabulary from file X for use in -diagram tests");
CommandLine::declare_switch(TEST_ARTICLES_CLSW, L"test-articles", 2,
@ -52,8 +55,11 @@ int main(int argc, char **argv) {
void Main::respond(int id, int val, text_stream *arg, void *state) {
switch (id) {
case VOCABULARY_CLSW: Banking::load_from_file(arg); break;
case RAW_DIAGRAMS_CLSW:
Interpreting::go(Diagramming::test_diagrams(arg, TRUE));
break;
case TEST_DIAGRAMS_CLSW:
Interpreting::go(Diagramming::test_diagrams(arg));
Interpreting::go(Diagramming::test_diagrams(arg, FALSE));
break;
case TEST_ARTICLES_CLSW:
Articles::create_small_word_sets();

View file

@ -1,11 +1,11 @@
article_sws:
(0) the: definite article n/m/f s/p nom/acc
(1) a: indefinite article n/m/f nom/acc s
(2) an: indefinite article n/m/f nom/acc s
(3) some: indefinite article n/m/f nom/acc p
(0) the: {definite 'the' n/m/f s/p nom/acc}
(1) a: {indefinite 'a' n/m/f nom/acc s}
(2) an: {indefinite 'an' n/m/f nom/acc s}
(3) some: {indefinite 'some' n/m/f nom/acc p}
definite_article_sws:
(0) the: definite article n/m/f s/p nom/acc
(0) the: {definite 'the' n/m/f s/p nom/acc}
indefinite_article_sws:
(0) a: indefinite article n/m/f nom/acc s
(1) an: indefinite article n/m/f nom/acc s
(2) some: indefinite article n/m/f nom/acc p
(0) a: {indefinite 'a' n/m/f nom/acc s}
(1) an: {indefinite 'an' n/m/f nom/acc s}
(2) some: {indefinite 'some' n/m/f nom/acc p}

View file

@ -1,47 +1,47 @@
pronouns_sws:
(0) i: first person pronoun n/m/f 1p s nom
(1) we: first person pronoun n/m/f 1p p nom
(2) me: first person pronoun n/m/f 1p s acc
(3) us: first person pronoun n/m/f 1p p acc
(4) you: second person pronoun n/m/f s/p nom/acc 2p
(5) it: third person pronoun nom/acc n 3p s
(6) they: third person pronoun n/m/f 3p p nom
(7) he: third person pronoun m 3p s nom
(8) she: third person pronoun f 3p s nom
(9) them: third person pronoun n/m/f 3p p acc
(10) him: third person pronoun m 3p s acc
(11) her: third person pronoun f 3p s acc
(0) i: {first person pronoun n/m/f 1p s nom}
(1) we: {first person pronoun n/m/f 1p p nom}
(2) me: {first person pronoun n/m/f 1p s acc}
(3) us: {first person pronoun n/m/f 1p p acc}
(4) you: {second person pronoun n/m/f s/p nom/acc 2p}
(5) it: {third person pronoun nom/acc n 3p s}
(6) they: {third person pronoun n/m/f 3p p nom}
(7) he: {third person pronoun m 3p s nom}
(8) she: {third person pronoun f 3p s nom}
(9) them: {third person pronoun n/m/f 3p p acc}
(10) him: {third person pronoun m 3p s acc}
(11) her: {third person pronoun f 3p s acc}
subject_pronouns_sws:
(0) i: first person pronoun n/m/f 1p s nom
(1) we: first person pronoun n/m/f 1p p nom
(2) you: second person pronoun n/m/f s/p 2p nom
(3) it: third person pronoun n 3p s nom
(4) they: third person pronoun n/m/f 3p p nom
(5) he: third person pronoun m 3p s nom
(6) she: third person pronoun f 3p s nom
(0) i: {first person pronoun n/m/f 1p s nom}
(1) we: {first person pronoun n/m/f 1p p nom}
(2) you: {second person pronoun n/m/f s/p 2p nom}
(3) it: {third person pronoun n 3p s nom}
(4) they: {third person pronoun n/m/f 3p p nom}
(5) he: {third person pronoun m 3p s nom}
(6) she: {third person pronoun f 3p s nom}
object_pronouns_sws:
(0) me: first person pronoun n/m/f 1p s acc
(1) us: first person pronoun n/m/f 1p p acc
(2) you: second person pronoun n/m/f s/p 2p acc
(3) it: third person pronoun n 3p s acc
(4) them: third person pronoun n/m/f 3p p acc
(5) him: third person pronoun m 3p s acc
(6) her: third person pronoun f 3p s acc
(0) me: {first person pronoun n/m/f 1p s acc}
(1) us: {first person pronoun n/m/f 1p p acc}
(2) you: {second person pronoun n/m/f s/p 2p acc}
(3) it: {third person pronoun n 3p s acc}
(4) them: {third person pronoun n/m/f 3p p acc}
(5) him: {third person pronoun m 3p s acc}
(6) her: {third person pronoun f 3p s acc}
possessive_pronouns_sws:
(0) my: first person possessive pronoun n/m/f nom/acc 1p s
(1) our: first person possessive pronoun n/m/f nom/acc 1p p
(2) your: second person possessive pronoun n/m/f s/p nom/acc 2p
(3) its: third person possessive pronoun nom/acc n 3p s
(4) their: third person possessive pronoun n/m/f nom/acc 3p p
(5) his: third person possessive pronoun nom/acc m 3p s
(6) her: third person possessive pronoun nom/acc f 3p s
(0) my: {first person possessive pronoun n/m/f nom/acc 1p s}
(1) our: {first person possessive pronoun n/m/f nom/acc 1p p}
(2) your: {second person possessive pronoun n/m/f s/p nom/acc 2p}
(3) its: {third person possessive pronoun nom/acc n 3p s}
(4) their: {third person possessive pronoun n/m/f nom/acc 3p p}
(5) his: {third person possessive pronoun nom/acc m 3p s}
(6) her: {third person possessive pronoun nom/acc f 3p s}
first_person_possessive_pronouns_sws:
(0) my: first person possessive pronoun n/m/f nom/acc 1p s
(1) our: first person possessive pronoun n/m/f nom/acc 1p p
(0) my: {first person possessive pronoun n/m/f nom/acc 1p s}
(1) our: {first person possessive pronoun n/m/f nom/acc 1p p}
second_person_possessive_pronouns_sws:
(0) your: second person possessive pronoun n/m/f s/p nom/acc 2p
(0) your: {second person possessive pronoun n/m/f s/p nom/acc 2p}
third_person_possessive_pronouns_sws:
(0) its: third person possessive pronoun nom/acc n 3p s
(1) their: third person possessive pronoun n/m/f nom/acc 3p p
(2) his: third person possessive pronoun nom/acc m 3p s
(3) her: third person possessive pronoun nom/acc f 3p s
(0) its: {third person possessive pronoun nom/acc n 3p s}
(1) their: {third person possessive pronoun n/m/f nom/acc 3p p}
(2) his: {third person possessive pronoun nom/acc m 3p s}
(3) her: {third person possessive pronoun nom/acc f 3p s}

View file

@ -1,47 +1,47 @@
(1) a sailor called jack silver is on the table
SENTENCE_NT'a sailor called jack silver is on the table'
VERB_NT'is on' verb 'is' 3p s act IS_TENSE +ve rel:carries
VERB_NT'is on' {verb 'be' 3p s act IS_TENSE +ve} {meaning: carries}
CALLED_NT'called'
COMMON_NOUN_NT'a sailor' (common) nom/acc n s
COMMON_NOUN_NT'a sailor' {common nom/acc m s}
UNPARSED_NOUN_NT'jack silver'
RELATIONSHIP_NT'is on' rel:carries-reversed
COMMON_NOUN_NT'table' (common) nom/acc n s
RELATIONSHIP_NT'is on' {meaning: carries-reversed}
COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
(2) on the table is a sailor called ben gunn
SENTENCE_NT'on the table is a sailor called ben gunn'
VERB_NT'is' verb 'is' 3p s act IS_TENSE +ve rel:is
RELATIONSHIP_NT'on the table' rel:carries-reversed
COMMON_NOUN_NT'table' (common) nom/acc n s
VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {meaning: is}
RELATIONSHIP_NT'on the table' {meaning: carries-reversed}
COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
CALLED_NT'called'
COMMON_NOUN_NT'sailor' (common) nom/acc n s
COMMON_NOUN_NT'sailor' {common nom/acc m s} {indefinite 'a' n/m/f nom/acc s}
UNPARSED_NOUN_NT'ben gunn'
(3) there is a sailor called captain flint
SENTENCE_NT'there is a sailor called captain flint'
VERB_NT'is' verb 'is' 3p s act IS_TENSE +ve (existential) rel:is
VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {existential} {meaning: is}
DEFECTIVE_NOUN_NT'there'
CALLED_NT'called'
COMMON_NOUN_NT'sailor' (common) nom/acc n s
COMMON_NOUN_NT'sailor' {common nom/acc m s} {indefinite 'a' n/m/f nom/acc s}
UNPARSED_NOUN_NT'captain flint'
(4) there is a table called the billiards and snooker table
SENTENCE_NT'there is a table called the billiards and snooker table'
VERB_NT'is' verb 'is' 3p s act IS_TENSE +ve (existential) rel:is
VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {existential} {meaning: is}
DEFECTIVE_NOUN_NT'there'
CALLED_NT'called'
COMMON_NOUN_NT'table' (common) nom/acc n s
UNPARSED_NOUN_NT'billiards and snooker table' definite article n/m/f s/p nom/acc
COMMON_NOUN_NT'table' {common nom/acc n s} {indefinite 'a' n/m/f nom/acc s}
UNPARSED_NOUN_NT'billiards and snooker table' {definite 'the' n/m/f s/p nom/acc}
(5) there is a table called the billiards table with deep pockets
SENTENCE_NT'there is a table called the billiards table with deep pocket'
VERB_NT'is' verb 'is' 3p s act IS_TENSE +ve (existential) rel:is
VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {existential} {meaning: is}
DEFECTIVE_NOUN_NT'there'
CALLED_NT'called'
COMMON_NOUN_NT'table' (common) nom/acc n s
UNPARSED_NOUN_NT'billiards table with deep pockets' definite article n/m/f s/p nom/acc
COMMON_NOUN_NT'table' {common nom/acc n s} {indefinite 'a' n/m/f nom/acc s}
UNPARSED_NOUN_NT'billiards table with deep pockets' {definite 'the' n/m/f s/p nom/acc}

View file

@ -1,52 +1,52 @@
(1) anna and beth are women
SENTENCE_NT'anna and beth are women'
VERB_NT'are' verb 'are' s/p 2p act IS_TENSE +ve + 1p/3p p act IS_TENSE +ve rel:is
VERB_NT'are' {verb 'be' s/p 2p act IS_TENSE +ve + 1p/3p p act IS_TENSE +ve} {meaning: is}
AND_NT'and'
PROPER_NOUN_NT'anna' (proper) nom/acc f s
PROPER_NOUN_NT'beth' (proper) nom/acc f s
COMMON_NOUN_NT'women' (common) nom/acc n p
PROPER_NOUN_NT'anna' {proper nom/acc f s}
PROPER_NOUN_NT'beth' {proper nom/acc f s}
COMMON_NOUN_NT'women' {common nom/acc f p}
(2) anna , beth and charles are sailors
SENTENCE_NT'anna , beth and charles are sailors'
VERB_NT'are' verb 'are' s/p 2p act IS_TENSE +ve + 1p/3p p act IS_TENSE +ve rel:is
VERB_NT'are' {verb 'be' s/p 2p act IS_TENSE +ve + 1p/3p p act IS_TENSE +ve} {meaning: is}
AND_NT','
PROPER_NOUN_NT'anna' (proper) nom/acc f s
PROPER_NOUN_NT'anna' {proper nom/acc f s}
AND_NT'and'
PROPER_NOUN_NT'beth' (proper) nom/acc f s
PROPER_NOUN_NT'charles' (proper) nom/acc m s
COMMON_NOUN_NT'sailors' (common) nom/acc n p
PROPER_NOUN_NT'beth' {proper nom/acc f s}
PROPER_NOUN_NT'charles' {proper nom/acc m s}
COMMON_NOUN_NT'sailors' {common nom/acc m p}
(3) anna , beth , and charles are sailors
SENTENCE_NT'anna , beth , and charles are sailors'
VERB_NT'are' verb 'are' s/p 2p act IS_TENSE +ve + 1p/3p p act IS_TENSE +ve rel:is
VERB_NT'are' {verb 'be' s/p 2p act IS_TENSE +ve + 1p/3p p act IS_TENSE +ve} {meaning: is}
AND_NT','
PROPER_NOUN_NT'anna' (proper) nom/acc f s
PROPER_NOUN_NT'anna' {proper nom/acc f s}
AND_NT','
PROPER_NOUN_NT'beth' (proper) nom/acc f s
PROPER_NOUN_NT'charles' (proper) nom/acc m s
COMMON_NOUN_NT'sailors' (common) nom/acc n p
PROPER_NOUN_NT'beth' {proper nom/acc f s}
PROPER_NOUN_NT'charles' {proper nom/acc m s}
COMMON_NOUN_NT'sailors' {common nom/acc m p}
(4) anna carries the table and the ming vase
SENTENCE_NT'anna carries the table and the ming vase'
VERB_NT'carries' verb 'carries' 3p s act IS_TENSE +ve rel:carries
PROPER_NOUN_NT'anna' (proper) nom/acc f s
RELATIONSHIP_NT'carries' rel:carries-reversed
VERB_NT'carries' {verb 'carry' 3p s act IS_TENSE +ve} {meaning: carries}
PROPER_NOUN_NT'anna' {proper nom/acc f s}
RELATIONSHIP_NT'carries' {meaning: carries-reversed}
AND_NT'and'
COMMON_NOUN_NT'table' (common) nom/acc n s
COMMON_NOUN_NT'ming vase' (common) nom/acc n s
COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
COMMON_NOUN_NT'ming vase' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
(5) anna is on the table and under the ming vase
SENTENCE_NT'anna is on the table and under the ming vase'
VERB_NT'is on' verb 'is' 3p s act IS_TENSE +ve rel:carries
PROPER_NOUN_NT'anna' (proper) nom/acc f s
RELATIONSHIP_NT'is on' rel:carries-reversed
VERB_NT'is on' {verb 'be' 3p s act IS_TENSE +ve} {meaning: carries}
PROPER_NOUN_NT'anna' {proper nom/acc f s}
RELATIONSHIP_NT'is on' {meaning: carries-reversed}
AND_NT'and'
COMMON_NOUN_NT'table' (common) nom/acc n s
RELATIONSHIP_NT'under the ming vase' rel:carries
COMMON_NOUN_NT'ming vase' (common) nom/acc n s
COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
RELATIONSHIP_NT'under the ming vase' {meaning: carries}
COMMON_NOUN_NT'ming vase' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}

View file

@ -1,28 +1,14 @@
(1) anna is a woman
SENTENCE_NT'anna is a woman'
VERB_NT'is' verb 'is' 3p s act IS_TENSE +ve rel:is
PROPER_NOUN_NT'anna' (proper) nom/acc f s
COMMON_NOUN_NT'woman' (common) nom/acc n s
VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {meaning: is}
PROPER_NOUN_NT'anna' {proper nom/acc f s}
COMMON_NOUN_NT'woman' {common nom/acc f s} {indefinite 'a' n/m/f nom/acc s}
(2) anna is not charles
SENTENCE_NT'anna is not charles'
VERB_NT'is not' verb 'is not' 3p s act IS_TENSE -ve rel:is
PROPER_NOUN_NT'anna' (proper) nom/acc f s
PROPER_NOUN_NT'charles' (proper) nom/acc m s
(3) she is a person
SENTENCE_NT'she is a person'
VERB_NT'is' verb 'is' 3p s act IS_TENSE +ve rel:is
PRONOUN_NT'she' third person pronoun f 3p s nom
COMMON_NOUN_NT'person' (common) nom/acc n s
(4) there is a table
SENTENCE_NT'there is a table'
VERB_NT'is' verb 'is' 3p s act IS_TENSE +ve (existential) rel:is
DEFECTIVE_NOUN_NT'there'
COMMON_NOUN_NT'table' (common) nom/acc n s
VERB_NT'is not' {verb 'be' 3p s act IS_TENSE -ve} {meaning: is}
PROPER_NOUN_NT'anna' {proper nom/acc f s}
PROPER_NOUN_NT'charles' {proper nom/acc m s}

View file

@ -0,0 +1,17 @@
(1) on the table is the ming vase
SENTENCE_NT'on the table is the ming vase'
VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {meaning: is}
RELATIONSHIP_NT'on the table' {meaning: carries-reversed}
COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
COMMON_NOUN_NT'ming vase' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
(2) on the table is under the ming vase
SENTENCE_NT'on the table is under the ming vase'
VERB_NT'is under' {verb 'be' 3p s act IS_TENSE +ve} {meaning: carries-reversed}
RELATIONSHIP_NT'on the table' {meaning: carries-reversed}
COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
RELATIONSHIP_NT'is under' {meaning: carries}
COMMON_NOUN_NT'ming vase' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}

View file

@ -1,49 +1,32 @@
(1) beth carries the ming vase
SENTENCE_NT'beth carries the ming vase'
VERB_NT'carries' verb 'carries' 3p s act IS_TENSE +ve rel:carries
PROPER_NOUN_NT'beth' (proper) nom/acc f s
RELATIONSHIP_NT'carries' rel:carries-reversed
COMMON_NOUN_NT'ming vase' (common) nom/acc n s
VERB_NT'carries' {verb 'carry' 3p s act IS_TENSE +ve} {meaning: carries}
PROPER_NOUN_NT'beth' {proper nom/acc f s}
RELATIONSHIP_NT'carries' {meaning: carries-reversed}
COMMON_NOUN_NT'ming vase' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
(2) the sailors carry the table
SENTENCE_NT'the sailors carry the table'
VERB_NT'carry' verb 'carry' 1p/2p s/p act IS_TENSE +ve + 3p p act IS_TENSE +ve rel:carries
COMMON_NOUN_NT'sailors' (common) nom/acc n p
RELATIONSHIP_NT'carry' rel:carries-reversed
COMMON_NOUN_NT'table' (common) nom/acc n s
VERB_NT'carry' {verb 'carry' 1p/2p s/p act IS_TENSE +ve + 3p p act IS_TENSE +ve} {meaning: carries}
COMMON_NOUN_NT'sailors' {common nom/acc m p} {definite 'the' n/m/f s/p nom/acc}
RELATIONSHIP_NT'carry' {meaning: carries-reversed}
COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
(3) the ming vase is carried by beth
SENTENCE_NT'the ming vase is carried by beth'
VERB_NT'is carried by' verb 'is' 3p s act IS_TENSE +ve rel:carries-reversed
COMMON_NOUN_NT'ming vase' (common) nom/acc n s
RELATIONSHIP_NT'is carried by' rel:carries
PROPER_NOUN_NT'beth' (proper) nom/acc f s
VERB_NT'is carried by' {verb 'be' 3p s act IS_TENSE +ve} {meaning: carries-reversed}
COMMON_NOUN_NT'ming vase' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
RELATIONSHIP_NT'is carried by' {meaning: carries}
PROPER_NOUN_NT'beth' {proper nom/acc f s}
(4) on the table is the ming vase
SENTENCE_NT'on the table is the ming vase'
VERB_NT'is' verb 'is' 3p s act IS_TENSE +ve rel:is
RELATIONSHIP_NT'on the table' rel:carries-reversed
COMMON_NOUN_NT'table' (common) nom/acc n s
COMMON_NOUN_NT'ming vase' (common) nom/acc n s
(5) a woman is on the table
(4) a woman is on the table
SENTENCE_NT'a woman is on the table'
VERB_NT'is on' verb 'is' 3p s act IS_TENSE +ve rel:carries
COMMON_NOUN_NT'woman' (common) nom/acc n s
RELATIONSHIP_NT'is on' rel:carries-reversed
COMMON_NOUN_NT'table' (common) nom/acc n s
(6) on the table is under the ming vase
SENTENCE_NT'on the table is under the ming vase'
VERB_NT'is under' verb 'is' 3p s act IS_TENSE +ve rel:carries-reversed
RELATIONSHIP_NT'on the table' rel:carries-reversed
COMMON_NOUN_NT'table' (common) nom/acc n s
RELATIONSHIP_NT'is under' rel:carries
COMMON_NOUN_NT'ming vase' (common) nom/acc n s
VERB_NT'is on' {verb 'be' 3p s act IS_TENSE +ve} {meaning: carries}
COMMON_NOUN_NT'woman' {common nom/acc f s} {indefinite 'a' n/m/f nom/acc s}
RELATIONSHIP_NT'is on' {meaning: carries-reversed}
COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}

View file

@ -0,0 +1,12 @@
linguistics-test: sentence failed to parse
(1) arfle barfle gloop
SENTENCE_NT'arfle barfle gloop'
(2) beth is not a sailor
SENTENCE_NT'beth is not a sailor'
VERB_NT'is not' {verb 'be' 3p s act IS_TENSE -ve} {meaning: is}
UNPARSED_NOUN_NT'beth'
UNPARSED_NOUN_NT'sailor' {indefinite 'a' n/m/f nom/acc s}

View file

@ -0,0 +1,7 @@
(1) beth is not a sailor
SENTENCE_NT'beth is not a sailor'
VERB_NT'is not' {verb 'be' 3p s act IS_TENSE -ve} {meaning: is}
PROPER_NOUN_NT'beth' {proper nom/acc f s}
COMMON_NOUN_NT'sailor' {common nom/acc m s} {indefinite 'a' n/m/f nom/acc s}

View file

@ -1,14 +1,14 @@
(1) there is a table
SENTENCE_NT'there is a table'
VERB_NT'is' verb 'is' 3p s act IS_TENSE +ve (existential) rel:is
VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {existential} {meaning: is}
DEFECTIVE_NOUN_NT'there'
COMMON_NOUN_NT'table' (common) nom/acc n s
COMMON_NOUN_NT'table' {common nom/acc n s} {indefinite 'a' n/m/f nom/acc s}
(2) some sailors are there
SENTENCE_NT'some sailors are there'
VERB_NT'are' verb 'are' s/p 2p act IS_TENSE +ve + 1p/3p p act IS_TENSE +ve rel:is
COMMON_NOUN_NT'sailors' (common) nom/acc n p
VERB_NT'are' {verb 'be' s/p 2p act IS_TENSE +ve + 1p/3p p act IS_TENSE +ve} {meaning: is}
COMMON_NOUN_NT'sailors' {common nom/acc m p} {indefinite 'some' n/m/f nom/acc p}
UNPARSED_NOUN_NT'there'

View file

@ -1,16 +1,16 @@
(1) beth always carries the ming vase
SENTENCE_NT'beth always carries the ming vase'
VERB_NT'carries' verb 'carries' 3p s act IS_TENSE +ve rel:carries certainty:certain
PROPER_NOUN_NT'beth' (proper) nom/acc f s
RELATIONSHIP_NT'carries' rel:carries-reversed
COMMON_NOUN_NT'ming vase' (common) nom/acc n s
VERB_NT'carries' {verb 'carry' 3p s act IS_TENSE +ve} {meaning: carries} {certainty:certain}
PROPER_NOUN_NT'beth' {proper nom/acc f s}
RELATIONSHIP_NT'carries' {meaning: carries-reversed}
COMMON_NOUN_NT'ming vase' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
(2) anna carries the ming vase for the third time
SENTENCE_NT'anna carries the ming vase for the third time'
VERB_NT'carries' verb 'carries' 3p s act IS_TENSE +ve rel:carries occurrence:<3 times>
PROPER_NOUN_NT'anna' (proper) nom/acc f s
RELATIONSHIP_NT'carries' rel:carries-reversed
COMMON_NOUN_NT'ming vase' (common) nom/acc n s
VERB_NT'carries' {verb 'carry' 3p s act IS_TENSE +ve} {meaning: carries} {occurrence: <3 times>}
PROPER_NOUN_NT'anna' {proper nom/acc f s}
RELATIONSHIP_NT'carries' {meaning: carries-reversed}
COMMON_NOUN_NT'ming vase' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}

View file

@ -1,40 +1,40 @@
(1) he knows her
SENTENCE_NT'he knows her'
VERB_NT'knows' verb 'knows' 3p s act IS_TENSE +ve rel:knows
PRONOUN_NT'he' third person pronoun m 3p s nom
RELATIONSHIP_NT'knows' rel:knows-reversed
PRONOUN_NT'her' third person pronoun f 3p s acc
VERB_NT'knows' {verb 'know' 3p s act IS_TENSE +ve} {meaning: knows}
PRONOUN_NT'he' {third person pronoun m 3p s nom}
RELATIONSHIP_NT'knows' {meaning: knows-reversed}
PRONOUN_NT'her' {third person pronoun f 3p s acc}
(2) she knows him
SENTENCE_NT'she knows him'
VERB_NT'knows' verb 'knows' 3p s act IS_TENSE +ve rel:knows
PRONOUN_NT'she' third person pronoun f 3p s nom
RELATIONSHIP_NT'knows' rel:knows-reversed
PRONOUN_NT'him' third person pronoun m 3p s acc
VERB_NT'knows' {verb 'know' 3p s act IS_TENSE +ve} {meaning: knows}
PRONOUN_NT'she' {third person pronoun f 3p s nom}
RELATIONSHIP_NT'knows' {meaning: knows-reversed}
PRONOUN_NT'him' {third person pronoun m 3p s acc}
(3) i carry the ming vase
SENTENCE_NT'i carry the ming vase'
VERB_NT'carry' verb 'carry' 1p/2p s/p act IS_TENSE +ve + 3p p act IS_TENSE +ve rel:carries
PRONOUN_NT'i' first person pronoun n/m/f 1p s nom
RELATIONSHIP_NT'carry' rel:carries-reversed
COMMON_NOUN_NT'ming vase' (common) nom/acc n s
VERB_NT'carry' {verb 'carry' 1p/2p s/p act IS_TENSE +ve + 3p p act IS_TENSE +ve} {meaning: carries}
PRONOUN_NT'i' {first person pronoun n/m/f 1p s nom}
RELATIONSHIP_NT'carry' {meaning: carries-reversed}
COMMON_NOUN_NT'ming vase' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
(4) the sailors know them
SENTENCE_NT'the sailors know them'
VERB_NT'know' verb 'know' 1p/2p s/p act IS_TENSE +ve + 3p p act IS_TENSE +ve rel:knows
COMMON_NOUN_NT'sailors' (common) nom/acc n p
RELATIONSHIP_NT'know' rel:knows-reversed
PRONOUN_NT'them' third person pronoun n/m/f 3p p acc
VERB_NT'know' {verb 'know' 1p/2p s/p act IS_TENSE +ve + 3p p act IS_TENSE +ve} {meaning: knows}
COMMON_NOUN_NT'sailors' {common nom/acc m p} {definite 'the' n/m/f s/p nom/acc}
RELATIONSHIP_NT'know' {meaning: knows-reversed}
PRONOUN_NT'them' {third person pronoun n/m/f 3p p acc}
(5) you know us
SENTENCE_NT'you know us'
VERB_NT'know' verb 'know' 1p/2p s/p act IS_TENSE +ve + 3p p act IS_TENSE +ve rel:knows
PRONOUN_NT'you' second person pronoun n/m/f s/p nom/acc 2p
RELATIONSHIP_NT'know' rel:knows-reversed
PRONOUN_NT'us' first person pronoun n/m/f 1p p acc
VERB_NT'know' {verb 'know' 1p/2p s/p act IS_TENSE +ve + 3p p act IS_TENSE +ve} {meaning: knows}
PRONOUN_NT'you' {second person pronoun n/m/f s/p nom/acc 2p}
RELATIONSHIP_NT'know' {meaning: knows-reversed}
PRONOUN_NT'us' {first person pronoun n/m/f 1p p acc}

View file

@ -1,31 +1,31 @@
(1) on the table is a sailor with carrying capacity 10
SENTENCE_NT'on the table is a sailor with carrying capacity 10'
VERB_NT'is' verb 'is' 3p s act IS_TENSE +ve rel:is
RELATIONSHIP_NT'on the table' rel:carries-reversed
COMMON_NOUN_NT'table' (common) nom/acc n s
VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {meaning: is}
RELATIONSHIP_NT'on the table' {meaning: carries-reversed}
COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
WITH_NT'with'
COMMON_NOUN_NT'sailor' (common) nom/acc n s
COMMON_NOUN_NT'sailor' {common nom/acc m s} {indefinite 'a' n/m/f nom/acc s}
PROPERTY_LIST_NT'carrying capacity 10'
(2) a sailor with carrying capacity 10 is on the table
SENTENCE_NT'a sailor with carrying capacity 10 is on the table'
VERB_NT'is on' verb 'is' 3p s act IS_TENSE +ve rel:carries
VERB_NT'is on' {verb 'be' 3p s act IS_TENSE +ve} {meaning: carries}
WITH_NT'with'
COMMON_NOUN_NT'sailor' (common) nom/acc n s
COMMON_NOUN_NT'sailor' {common nom/acc m s} {indefinite 'a' n/m/f nom/acc s}
PROPERTY_LIST_NT'carrying capacity 10'
RELATIONSHIP_NT'is on' rel:carries-reversed
COMMON_NOUN_NT'table' (common) nom/acc n s
RELATIONSHIP_NT'is on' {meaning: carries-reversed}
COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
(3) on the table is a sailor with carrying capacity 10 and wealth 12
SENTENCE_NT'on the table is a sailor with carrying capacity 10 and wealt'
VERB_NT'is' verb 'is' 3p s act IS_TENSE +ve rel:is
RELATIONSHIP_NT'on the table' rel:carries-reversed
COMMON_NOUN_NT'table' (common) nom/acc n s
VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {meaning: is}
RELATIONSHIP_NT'on the table' {meaning: carries-reversed}
COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
WITH_NT'with'
COMMON_NOUN_NT'sailor' (common) nom/acc n s
COMMON_NOUN_NT'sailor' {common nom/acc m s} {indefinite 'a' n/m/f nom/acc s}
AND_NT'and'
PROPERTY_LIST_NT'carrying capacity 10'
PROPERTY_LIST_NT'wealth 12'
@ -33,11 +33,11 @@ SENTENCE_NT'on the table is a sailor with carrying capacity 10 and wealt'
(4) on the table is a sailor with carrying capacity 10 , wealth 12 , and sea count 7
SENTENCE_NT'on the table is a sailor with carrying capacity 10 , wealth '
VERB_NT'is' verb 'is' 3p s act IS_TENSE +ve rel:is
RELATIONSHIP_NT'on the table' rel:carries-reversed
COMMON_NOUN_NT'table' (common) nom/acc n s
VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {meaning: is}
RELATIONSHIP_NT'on the table' {meaning: carries-reversed}
COMMON_NOUN_NT'table' {common nom/acc n s} {definite 'the' n/m/f s/p nom/acc}
WITH_NT'with'
COMMON_NOUN_NT'sailor' (common) nom/acc n s
COMMON_NOUN_NT'sailor' {common nom/acc m s} {indefinite 'a' n/m/f nom/acc s}
AND_NT','
PROPERTY_LIST_NT'carrying capacity 10'
AND_NT','
@ -47,28 +47,28 @@ SENTENCE_NT'on the table is a sailor with carrying capacity 10 , wealth '
(5) there is a kind of sailor called an admiral
SENTENCE_NT'there is a kind of sailor called an admiral'
VERB_NT'is' verb 'is' 3p s act IS_TENSE +ve (existential) rel:is
VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {existential} {meaning: is}
DEFECTIVE_NOUN_NT'there'
CALLED_NT'called'
KIND_NT'kind of sailor'
COMMON_NOUN_NT'sailor' (common) nom/acc n s
UNPARSED_NOUN_NT'admiral' indefinite article n/m/f nom/acc s
COMMON_NOUN_NT'sailor' {common nom/acc m s}
UNPARSED_NOUN_NT'admiral' {indefinite 'an' n/m/f nom/acc s}
(6) an admiral is a kind of sailor
SENTENCE_NT'an admiral is a kind of sailor'
VERB_NT'is' verb 'is' 3p s act IS_TENSE +ve rel:is
UNPARSED_NOUN_NT'admiral' indefinite article n/m/f nom/acc s
VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {meaning: is}
UNPARSED_NOUN_NT'admiral' {indefinite 'an' n/m/f nom/acc s}
KIND_NT'kind of sailor'
COMMON_NOUN_NT'sailor' (common) nom/acc n s
COMMON_NOUN_NT'sailor' {common nom/acc m s}
(7) an admiral is a kind of sailor with wealth 50
SENTENCE_NT'an admiral is a kind of sailor with wealth 50'
VERB_NT'is' verb 'is' 3p s act IS_TENSE +ve rel:is
UNPARSED_NOUN_NT'admiral' indefinite article n/m/f nom/acc s
VERB_NT'is' {verb 'be' 3p s act IS_TENSE +ve} {meaning: is}
UNPARSED_NOUN_NT'admiral' {indefinite 'an' n/m/f nom/acc s}
WITH_NT'with'
KIND_NT'kind of sailor'
COMMON_NOUN_NT'sailor' (common) nom/acc n s
COMMON_NOUN_NT'sailor' {common nom/acc m s}
PROPERTY_LIST_NT'wealth 50'

View file

@ -1,7 +1,3 @@
Anna is a woman.
Anna is not Charles.
She is a person.
There is a table.

View file

@ -0,0 +1,5 @@
[Subject-verb inversion.]
On the table is the Ming vase.
On the table is under the Ming vase.

View file

@ -4,8 +4,4 @@ The sailors carry the table.
The Ming vase is carried by Beth.
On the table is the Ming vase.
A woman is on the table.
On the table is under the Ming vase.

View file

@ -0,0 +1,3 @@
Arfle barfle gloop.
Beth is not a sailor.

View file

@ -0,0 +1 @@
Beth is not a sailor.

View file

@ -26,8 +26,13 @@
set: $A = $PATH/_Results_Actual/$CASE.txt
set: $I = $PATH/_Results_Ideal/$CASE.txt
set: $U = -diagram
if: $CASE %c*-raw
set: $U = -raw
endif
mkdir: $PATH/_Results_Actual
step: services/linguistics-test/Tangled/linguistics-test -vocabulary $V -diagram $PATH/$CASE.txt >$A 2>&1
step: services/linguistics-test/Tangled/linguistics-test -vocabulary $V $U $PATH/$CASE.txt >$A 2>&1
or: 'produced errors in linguistics-test' $A
show: $A

View file

@ -15,9 +15,9 @@ Anna = feminine proper noun.
Beth = feminine proper noun.
Charles = masculine proper noun.
man = neuter common noun.
woman = neuter common noun.
person = neuter common noun.
sailor = neuter common noun.
man = masculine common noun.
woman = feminine common noun.
person = masculine common noun.
sailor = masculine common noun.
table = neuter common noun.
Ming vase = neuter common noun.