[MUD-Dev] English grammar thoughts

Jon Leonard jleonard at slimy.com
Thu Oct 25 16:35:48 New Zealand Daylight Time 2001

On Fri, Oct 19, 2001 at 07:29:34PM -0700, Par Winzell wrote:

[want single syntactic model for the Skotos parser]

> ... most everything should be on the form

>   'carefully put the frog in the bag'
>   'wave at the sky angrily with my sword'
>   'fill my mug with water'
>   'nod at the man, "I understand what you're saying."'

For these, I might try restricting the general English grammar:

  * Disallow indirect objects to verbs
     (So "give the man the sword" -> "give the sword to the man")
  * Disallow prepositions modifying nouns
     (This disambiguates "Carefully put the frog in the bag on the
     table."  Is the frog in the bag now, or is there a bag on the
     table to put it in?)

Then here's a possible grammar:

  statement -> adverb* verb object?
             (prep_phrase|adverb)* evoke?
  prep_phrases -> preposition object
  object -> article? adjective* noun
  evoke -> "<quoted text>"


  * represents 0 or more
  ? represents 0 or 1
  and terminals are preposition, verb, article, adverb, adjective, noun

You'll then need to fill in the fields that your code needs,
generating errors as appropriate.

If you like indirect objects, you could replace "object?" with
"(indirect_object? object)?" or some such without breaking

The usual way that ambiguity is clarified in English is by reference
to the environment, or non-local knowlege.  Since you probably don't
want to have the parser inspect world state, you'll want to avoid
any ambiguity in your grammar.  The "frog in the bag on the table"
is the sort of thing that is usually clarified by there being only
one frog, or no bag on the table, etc.

> So, first, what I think I know: in English, the direct object is
> the answer to the question 'What did you put? wave? fill? nod?' 
> and thus invariant under word-order juggling -- in
>   'wave my sword at the sky'

> and

>   'wave at the sky with my sword'
> the direct object is the sword in both cases. If this were true,
> it'd mean that direct objects can have prepositions in front of
> them, which I had previously thought they could not.

The meaning is (almost) invariant in this sort of transformation,
but the grammatical terms change.  I can't immediately find a good
example for the indirect object/to <noun> transform, but for the
active/passive voice transformation, My copy of _The Oxford English
Grammar_ uses "will have the active object [...] as subject, the
active subject [...] will optionally appear after the verb in a
by-phrase ..."

> The other object is easier -- I'm going to call it 'indirect' even
> in those cases where apparantly it might more correctly be
> referred to as 'object of the preposition'.

Something like "The object that would be the indirect object of the
straightforwardly written sentence", perhaps?  There doesn't seem to
be good terminology for this in English.

> Next, I believe the following configuration parameters would
> specify a verb's expressive possibilities completely:

>   Evoke:               Forbid/Allow/Require
>   Direct Object:       Forbid/Allow/Require
>   Direct Preposition:  Forbid/Allow/Require
>   Indirect Object:     Forbid/Allow/Require

Looks reasonable for a simple grammar.  You might want to consider
always allowing an Evoke, treating it as a separate statement where
it's not normally a statement verb.

> Finally, does anybody know what the relationship is between the
> notions of on one hand direct and indirect objects and the object
> of the preposition, and on the other hand noun cases like
> nominative, accusative, dative, etc?

The cases are nearly vestigal in English.  You can still see them in
word sets like "Who/whom/whose" and "He/him/his", corresponding to
the nominative, accusitave (or dative with to <pronoun>) and
genitive, respectively.

Of course if you're picky about these things, you'll want to handle
malformed sentences too, right?

How much more did you want your limited grammar to handle?  There
are probably larger subsets that are still quite parsable.

Jon Leonard
MUD-Dev mailing list
MUD-Dev at kanga.nu

More information about the MUD-Dev mailing list