1. Thesaurus database

I am thinking of managing a thesaurus database using Euphoria. It would have a list of synonyms and a list of antonyms for every entry.

What's the best way to structure the database?

Thanks

GreenEuphorian

new topic     » topic index » view message » categorize

2. Re: Thesaurus database

GreenEuphorian said...

I am thinking of managing a thesaurus database using Euphoria. It would have a list of synonyms and a list of antonyms for every entry.

What's the best way to structure the database?

Thanks

GreenEuphorian

Off the top of my head, for simplicity:

words: key is string, data is {{synonyms},{antonyms}} (yet more strings)

Or for size:

words: key is string, data is unique_id (probably db_table_size()+1)
index: key is unique_id, data is {word(string),{synonym_ids},{antonym_ids}}

Pete

new topic     » goto parent     » topic index » view message » categorize

3. Re: Thesaurus database

GreenEuphorian said...

I am thinking of managing a thesaurus database using Euphoria. It would have a list of synonyms and a list of antonyms for every entry.

What's the best way to structure the database?

Thanks

GreenEuphorian

One way would be to use the EDS database library that comes with OpenEuphoria. You can do it using two tables.

-- Sets of Words  - A set of closely related synonyms, with zero or one antonym. To find other antonyms, look up the synonyms for the supplied one. 
-- id_set { SetId, {Synonym,...} , Antonym, Usage } 
 
{ 1, {"gird", "girdle", "engird", "encircle", "surround", "enclose",  
      "encompass", "begird", "environ", "hem", "border"}, "open", VERB} 
       
{ 2, {"girdle"}, 0, NOUN}       
 
{ 3, {"surround", "enclosure"}, 0, NOUN} 
 
{ 4, {"hem", "edge", "border"}, 0, NOUN} 
 
{ 5, {"open", ...}, {}, "close", VERB} 
 
{ 6, {"close", ...}, {}, "open", VERB} 
 
{ 7, {"gird", "invest", "equip", "furnish", "clothe"}, "strip", VERB} 
 
{ 8, {"strip", ...}, "apply", VERB} 
       
-- Words in Sets 
-- word_set_id { word, { SetId, ...}} 
 
{ "gird", {1,7}} 
{ "girdle", {1,2}} 
{ "engird", {1}} 
{ "encircle", {1}} 
{ "surround", {1,3}} 
{ "enclose", {1}} 
{ "encompass", {1}} 
{ "begird", {1}} 
{ "environ", {1}} 
{ "hem", {1,4}} 
{ "open", {5}} 
{ "close", {6}} 
{ "invest", {7}} 
{ "equip", {7}} 
{ "furnish", {7}} 
{ "clothe", {7}} 
{ "strip", {8}} 
 
new topic     » goto parent     » topic index » view message » categorize

4. Re: Thesaurus database

Thanks to both of you, Pete and Derek. I'll be mulling over your suggestions and choose the easiest way for me.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu