Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Elsar
Newbie


Joined: 22 Sep 2002
Posts: 5

PostPosted: Sun Sep 22, 2002 1:34 pm   

Check Substantinves
 
Hi there,

does someone of you have a Script that will check all Substantinves in a room or perhaps someone can explain me who to do that.

Thanks

Elsar
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Sep 22, 2002 4:07 pm   
 
There is only one problem, how do you tell a noun apart from other words. People do this automatically because they know the meaning of a word and thus are able to clasify it as a noun, verb, adjective, etc. Even if we don't know the meaning of a particular word, we are able to look at its context and infer its function. There is no simple way for a computer to do this short of having a list with every noun in existance.

Kjata
Reply with quote
Elsar
Newbie


Joined: 22 Sep 2002
Posts: 5

PostPosted: Sun Sep 22, 2002 8:05 pm   
 
Ok, i have forgotten to tell you that i need this for German language. So all nouns start with an upper-case character. The only thing that can be a problem is the first word of a sentence because it starts also with a upper-case character.
Perhaps you have now an idea?

Elsar
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Sep 23, 2002 12:18 am   
 
I'm guessing that you want to do "unt" on each noun. Here is something that should work:
#TRIGGER {^%w (*)} {#LOOP %numwords("%1") {#IF (%copy(%word("%1", 1), 1, 1) = %upper(%copy(%word("%1", 1), 1, 1))) {unt %word("%1", 1)}}}

This won't work if the noun is the first word in the line because there is no way to tell a noun at the beggining of a line from another word that is not a noun but is capitalized because it is at the start of the line.

Kjata
Reply with quote
Elsar
Newbie


Joined: 22 Sep 2002
Posts: 5

PostPosted: Mon Sep 23, 2002 12:52 am   
 
Thanks for your help Kjata!

I have testet the Trigger but first i have received a Trigger loop because the Trigger will also be activated after the first "unt Xxx". I have changed it now and have added %lower.
Now it only checks the first noun but this one a few times...
I'm not sure what the Trigger realy do so perhaps you can explain that to me than i can debug it myself.

Elsar
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Sep 23, 2002 1:43 pm   
 
Oops, sorry for that one. Leave the trigger as I posted it, but go into the Settings Editor, find the trigger and uncheck the Trigger on Trigger checkbox in the Options tab.

Let me explain how the trigger works anyway. The pattern it has will look for any line that has more than one word in it. It will catch anything after the first word and store it into %1. Now the trigger loops through every word in %1. It does this by using the %word function which allows you to specify the number of a word to get from a string. So, for every word in %1 it checks to see if the first character is an uppercase character. The way it does this is by comparing the first character in the word (it grabs it by using %copy) agaisnt that same character as returned by %upper (which converts anything you send to it to uppercase.) If the character is in fact an uppercase character, the %upper should return the exact same thing as when %upper is not used. Based on whether it was uppercase or not, it sends "unt"

Kjata
Reply with quote
Elsar
Newbie


Joined: 22 Sep 2002
Posts: 5

PostPosted: Mon Sep 23, 2002 4:29 pm   
 
Hi Kjata,

i have made the tick now by Trigger on Trigger. I can't unterstand what happens now.
This is the long description of the room:

Der Feldweg schlaengelt sich zwischen grossen Feldern gen Norden. Auf den
Feldern arbeiten Bauern, um ihre Produkte in der naheliegenden Stadt Trondheim
feil zu bieten. Du erkennst Weizen, Roggen und Gerstenfelder. Auch
Kuerbisheine und Hopfenaecker sind zu erkennen. Die goldenen Aehren des
Getreides schwingen langsam im Wind. Ein wohliger Geruch von reifen
Feldfruechten umgibt Deine Nase.

Es gibt zwei sichtbare Ausgaenge: norden und suedosten.

This happens when the trigger fires:
unt Feldweg
unt Feldweg
unt Feldweg
unt Feldweg
unt Feldweg
unt Feldweg
unt Feldweg
unt Feldweg
unt Feldweg
unt Feldweg

I have no idea why...

Elsar
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Tue Sep 24, 2002 1:26 am   
 
Hmm, I should really look some more at what I post. Anyway, the problem is in all of the %word functions in the script. I used it like this:
%word("%1", 1)

while it should have been:
%word("%1", %i)

Just change the three instances that are present in the script to use %i instead of 1.

Kjata
Reply with quote
Elsar
Newbie


Joined: 22 Sep 2002
Posts: 5

PostPosted: Tue Sep 24, 2002 1:45 am   
 
Kjata, great work!

It works now. Der is only one more problem :)
After checking the first noun a new description appears with other nouns:

Der Feldweg schlaengelt sich zwischen grossen Feldern gen Norden.
unt Feldweg
Der Feldweg ist sehr schmal und es liegen Steine am Boden.

I guess what i have to do now is to write the nouns i have checked into a File or a List and than compare with the nouns of the description is there is a new one.
Is this possible?

Elsar
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Tue Oct 01, 2002 8:43 pm   
 
Depending on the final use of the list you could use the database with %query/%find or a file with %grep.

Have a look perhaps in the finished script forum to see various equipment database examples.

Ton Diening
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net