tags:

views:

241

answers:

2

How to get english other states when I enter 1 state.

I mean

I have a noun and I want to get other adjustment.

$word_list=get_list('play','n');

and then I want to get v , adj, adv, etc.,..

A: 

You going to need a dictionary and a way to connect related words (Manually?). Well once you have a database of all the words in the dictionary and how they are related then its pretty easy from there.

For example if you store your dictionary like this:

id | word      | noun | adverb | adjective | etc.
1  | play      |  1   |   2    |     3     | ...
2  | playfully |  1   |   2    |     3     | ...
3  | playful   |  3   |   2    |     3     | ...
4  | quick     |      |   5    |     4     | ...
5  | quickly   |      |   5    |     4     | ...

Then you can make a query like:

SELECT adverb FROM dictionary WHERE word = 'play'

And you can query the word corresponding to that id.

In short its gonna be a lot of work...

Chaim Chaikin
oh! many data need to add. I don't want to add data :( there is no way like pspell. pspell can check spell correct or not.
saturngod
while pspell can check and correct incorrect spelling, as far as I know, it doesn't have in its dictionary the relationship (adverb, noun etc.) between different words. So you would have to do that yourself.
Chaim Chaikin
@saturngod: You would need to find an application that deals with grammar, not simply spelling, to find this data. You might find it in an open-source office suite.
Anonymous
+1  A: 

The WordNet MySQL Database will have all the data that you need, so if you can handle querying that, it might be a good solution.

Adam Benzan
wow... great!!!
saturngod