MUD-Dev
mailing list archive
[ Other Periods
| Other mailing lists
| Search
]
Date:
[ Previous
| Next
]
Thread:
[ Previous
| Next
]
Index:
[ Author
| Date
| Thread
]
Re: [MUD-Dev] Text Parsing
[Kylotan, in response to Albert:]
> How can you tell, out of context, whether a noun is the direct object or the
> indirect object? (eg. in "get the bag" and "put the ball in the bag" the
> word "bag" is direct in the first instance, and indirect in the second.) I
> would think you'd need to be looking for other clues, such as
> prepositions/prepositional phrases to indicate that you are now expecting an
> indirect object.
That's pretty much what I was going to say, too. A given word can play
lots of different roles in English. E.g.
bag the groceries
take the bag
take the eggs from the bag
put the sausage into the bag
put the bag down
put down the bag
down
with the classic, of course being:
time flies like an arrow
Anyway, my solution to this is to have the form of a verb stored with
every word that can be a verb. There can be multiple uses of the same
verb, so long as there is a preposition that distinguishes them. E.g.,
the above are examples of the forms:
BAG <noun-phrase>...
TAKE <noun-phrase>...
TAKE <noun-phrase>... FROM <noun-phrase>
PUT <noun-phrase>... INTO <noun-phrase>
PUT <noun-phrase>... DOWN === PUT DOWN <noun-phrase>...
DOWN
I don't record all nouns and adjectives at all. A <noun-phrase> is just
one or more words (skipping an optional 'a', 'an', 'the') that ends
with something that is important to the verb, or at the end of the command.
The last word is the noun, and the rest are considered to be adjectives.
There are some cases this doesn't handle, but it gets quite a few.
--
Don't design inefficiency in - it'll happen in the implementation.
Chris Gray cg#ami-cg,GraySage.Edmonton.AB.CA
http://www.GraySage.Edmonton.AB.CA/cg/
_______________________________________________
MUD-Dev maillist - MUD-Dev#kanga,nu
http://www.kanga.nu/lists/listinfo/mud-dev
- Thread context:
- Re: [MUD-Dev] Text Parsing, (continued)
- Re: [MUD-Dev] Text Parsing,
Kylotan kylotan#kylotan,force9.co.uk, Fri 28 May 1999, 21:08 GMT
- Re: [MUD-Dev] Text Parsing,
Greg Miller gmiller#classic-games,com, Sat 29 May 1999, 00:51 GMT
- Re: [MUD-Dev] Text Parsing,
Mik Clarke mikclrk#ibm,net, Sat 29 May 1999, 21:14 GMT
- Re: [MUD-Dev] Text Parsing,
Travis Casey efindel#io,com, Mon 31 May 1999, 03:34 GMT
- Re: [MUD-Dev] Text Parsing,
Chris Gray cg#ami-cg,GraySage.Edmonton.AB.CA, Sat 29 May 1999, 01:10 GMT
- Re: [MUD-Dev] Text Parsing,
Cynbe ru Taren cynbe#muq,org, Mon 31 May 1999, 04:01 GMT
- Re: [MUD-Dev] Text Parsing,
Chris Gray cg#ami-cg,GraySage.Edmonton.AB.CA, Mon 31 May 1999, 13:50 GMT
[ Other Periods
| Other mailing lists
| Search
]