Daimonin
Members login
Sign Up!      problems?
N F
* Daimonin Forum
Home Help Search Calendar

Welcome Guest, you have to register to post here.
Search

News

Stats
74114 Posts in 6714 Topics by 8115 Members
Latest Member: salvafrench
Daimonin Forum  |  Project News  |  Official announcements  |  Programmers' blogs  |  Topic: ToParse « previous next »
Pages: [1] Go Down Print
Topic: ToParse  (Read 420 times)
smacky
Administrator
*
*
*
*
*


Karma: +114/-98
Posts: 5254



View Profile
« on: December 09, 2007, 02:36:44 pm »

This is a spin-off idea from SENTInce. I won't be doing anything practical about it until SENTInce is finished, but in the meantime, here's a repository for my ideas (it is a blog after all) and hopefully other people's input too.

Quote from: Smacky
This also raises a question over pronouns. Sometimes pronouns can also be ignored. For example, 'give me the sword' could have the pronoun (me) and article (the) removed without its meaning suffering: 'give sword'. But equally, 'give the sword to me' could lose pronoun, article, and preposition (to). But if the topic is 'give my sword to him' the two pronouns are important, so it's not a simple matter. Rather, this level of topic processing requires quite a complex parser. As mentioned above, this would need to be done server side (well it could be done client side -- for example, the client could encapsulate 'useless' words in non-printable chars -- in this way they could still be displayed (the words not the chars) in the GUI but could be ignored by the topic matching -- however this would slightly increase the amount of data being transferred: 'give ®the® sword ®to me®'.

At this stage punctuation also becomes interesting... You see where this is going. Smile A full client-side parser for /talk topics a la those found in text adventures may be a useful addition, making NPC interaction via the GUI much more satisfying and powerful.

However, this is a big job, probably enough to warrant its own separate development stream.
A better way to do this, I think, would be to parse the topic message, client-side, into just three (one mandatory and two optional) 'parts'.

The first part (the mandatory one) would be the action: for example, repair, cast, give, sell, etc.

The second part (optional) would be the direct object: for example, sword.

The third part (optional but requires direct object too) would be the indirect object. For example, Smacky.

Thus 'give the sword to Smacky' and 'give Smacky the sword' both parse to:
    action = give
    dobj = sword
    iobj = smacky

The client send both the message as typed and the parsed topic to the server, in the same way as a map name and media string is sent the other way. Ie, using some sort of separator tag: /talk give the sword to smacky®give sword smacky

Scripts can then use tl:CheckMessage() to match the message as typed in the normal way. For backwards compatibility.

OR they can use, eg, toparse.lua which matches the parsed topic instead.
« Last Edit: February 29, 2008, 06:53:55 am by ANICH » Logged

Pages: [1] Go Up Print 
Daimonin Forum  |  Project News  |  Official announcements  |  Programmers' blogs  |  Topic: ToParse « previous next »
Jump to:  

Page created in 0.069 seconds with 18 queries.
Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks
Copyright 2008 Daimonin MMORPG  •  Terms of Service  •  XHTML  •  Daimonin sourceforge open source project