Get Noun,Adj,Adv with PHP
How to get english other st开发者_开发问答ates 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.,..
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.
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...
精彩评论