Jump to content

fetching from a text based database


esafwan

Recommended Posts

hi,

i have a database file in .txt its a regional dictionary file released under GPL.

 

below is the model!

 

 

abbey

1. കന്യകാമഠം

2. മഠത്തോട് ബന്ധപ്പെട്ട ദേവാലയം

3. സന്യാസിമഠം

abbot

1. മഠാധിപതി

abbreviate

1. സംക്ഷേപിക്കുക

2. സംഗ്രഹിക്കുക

3. ചുരുക്കുക

abbreviation

1. സംഗ്രഹിക്കല്*

2. ചുരുക്കം

3. ചുരുക്കെഴുത്ത്.

 

How do u i fetch a word from it? Like if any one type abbey in a textbox, the first word in this sample, it should return the meanings numbered 1,2 & 3.

 

How can it be done? can any one give me a sample code? Its for making a free software.

Link to comment
Share on other sites

That is not a database of any type. You are able to query databases for data, text files (like this) you will need to parse yourself.

 

I don't see any real patterns in this text file so its probably not going to be a straight forward task. Id suggest reading up on regular expressions.

Link to comment
Share on other sites

search through the file line by line. compare the textfield with the line until you find the keyword. when you find the keyword return all lines that start with a number until you hit one without a number.

 

the file is probably huge if it's a dictionary so the search may be really slow.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.