mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
I'm looking for some script that would give me the nouns/adjectives in a sentence(i know languages can't understand english), e.g

I was thinking maybe a sockets script to send the sentence/words to a site to return the type of the word

is this feasible guys? anyone know such site where they tell if you if its a noun or an adjective?

edit* i've found:
http://dictionary.reference.com/browse

should i just submit the word, and then in the sockread check if i find 'noun' or 'adjective' ?

Last edited by pouncer; 31/03/07 10:10 AM.
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Yes, you'd want to use a dictionary site for that. My dictionary script displays such information. However, what are you going to do when something is both a noun and an adjective? Is that a single counter, or are they separate counters?


Invision Support
#Invision on irc.irchighway.net
Joined: Jan 2007
Posts: 259
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Jan 2007
Posts: 259
I would make a hash table, submit the word to whatever dictionary site you're using, then save the results in the hash table for future reference. Also, be aware that reference.com may return different words close to or related to what you search for, and thus it will return "Noun" "Verb" etc.


Those who can, cannot. Those who cannot, can.
Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
Thanks for the input guys.

Hey riamus, i am only interested in nouns/adjectives. So, if a word is both a noun and an adjective then it's fine!

so if i had a sentence:

'My cat is nice'

would i submit all these 4 words using 4 sockets? Any chance you can show me how to do it Riamus, I downloaded your program but i think im only need a small snippet for this

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Well, the dictionary program was for an example of getting the data from the site. You'd need to do similar sockopen/sockread things and check to see if it's a noun/adjective by parsing the lines.

The suggestion of putting "known" words into a hash table is a good one as it will speed things up as you start to get more and more known words.

As for submitting the words, yes, you'd submit all of them. If you use the hash table idea, then you'd only submit the words that aren't "known".

You can use the socket part of my script if you want for checking the words. Then, just change the parsing part of it to look just for the noun/adjective info. The rest of the script isn't necessary for what you're doing.

For the hash table part, use a normal hash table setup, where the item name is the word and the data is something simple, such as 1 if it's an adjective/verb, and 0 if it's not. Then, when you loop through your words, you would first check the hash table to see if the itemname (word) exists. If it does, then you won't submit that to be checked because you know if it's an adjective or verb already.


Invision Support
#Invision on irc.irchighway.net
Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
hi Riamus, in your dictionary script does it display different colors for nouns etc

and where is the code to where it actually finds if its a noun, verb or whatever, thanks!!

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Yes, it does. You can change the colors in the settings.

As for where it has that, the definition (including noun/verb/etc) is set wherever you see a line that starts with:

Then, you just see if noun isin it or adjective isin it or whatever.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard