The easiest way is to download their database from here , and then analyze the space-separated data files (data.adj, data.adv, data.noun, data.verb) for the 5th element in each row and put them in the corresponding data structure .
Perhaps a hash table with a start letter as a key and each element as an array of words starting with that letter.
, , ( ), .
C wordnet . .
#include <stdio.h>
#include <string.h>
int main(int argc,char**argv)
{
FILE *fp;
fp=fopen("data.noun", "r");
char line [ 3000 ];
while ( fgets ( line, sizeof line, fp ) != NULL )
{
char *result = NULL;
int count =0;
result = (char*)strtok( line, " ");
count++;
while( result != NULL )
{
if (count == 5)
{
printf( "result is \"%s\"\n", result );
}
result = (char*)strtok( NULL, " ");
count++;
}
}
return 0;
}
WordNet .
API WordNet C , . findtheinfo, , , , , API.