[MUD-Dev] Re: Prescience Rules?

Richard Woolcock KaVir at dial.pipex.com
Fri Jun 19 17:16:10 New Zealand Standard Time 1998


Vadim Tkachenko wrote:
> 
> Richard Woolcock wrote:

[big snip]

> > I would like to (when I have the time) replace the announce command with
> > a parser to check through spoken strings and determine what the players is
> > actually saying, creating a 'TRUE/FALSE' lie detection accordingly.
> 
> Side note: make it external and pluggable, it may consume all the
> processor power :-)

I'm not sure...I guess I'll have to see ;)  Here is how I was planning to code
it...

while not at end of string loop

   if the current character is a space then
      interpret the word
      start a new word
      continue
   end if

   if the current character is non-alphabetic then
      continue
   end if

   if the current letter is a vowel and not the first letter of the word then
      continue
   end if

   if the current letter is the same as the previous letter then
      continue
   end if

   if not the first letter of the word then
      word <<= 5 bits
   end if

   word &= character in lowercase - 'a' + 1

   if the word is holding 6 values then
      interpret the word
      start a new word
   end if

end loop


(roughly speaking)...then I'll have the "interpret_word" function which
does a switch case and stores some sort of result accordingly...for example
suppose you had the string "I have never committed diablerie" from my
previous example...the above function would send the following words one
after the other:

I = i = 9
have = hv = (8<<5)+(22) = 278 (I think)
never = nvr = (14<<10)+(22<<5)+(18) = something
committed = cmtd = ...
diablerie = dblr = ...

Doing a switch case on the first word (9), the mud determines that the
talker is referring to themself.  The second word (278) determines that
the talker is referring to either something the own, or something they
have done.  The third word would inform the mud that the talker was
inversing their claim.  The fourth word would inform the mud that the
talker had performed a certain action.  The fifth word would inform the
mud that the talker was referring to the act of diablerie.  From this
(and this is the bit I don't yet know how to do) the mud could determine
that:

Bubba claims that the act of diablerie was not performed by himself.

This system wouldn't be perfect, but I could probably get it 'fairly'
accurate, and I don't think it would be too much of a drain on the
processor.

KaVir.




More information about the MUD-Dev mailing list