|
-
February 22nd, 2009, 04:55 AM
#1
Reading from an external file
Hi,
I need to store a minimum of 50 ambiguous words(that can be represented as both nouns or verbs) and the corresponding sense words for each of the senses.For eg, if the word is "land",I will have to store something like this also: {{earth,ground etc.},{bring down etc.}}
Now what is the most efficient way to store such data in java so that it can be read from an external file ? How do I retrieve it ? Because if there is a word hit,then the corresponding list of sense words have to returned.
Pl help.
Thank you All,
Supraja J
-
February 22nd, 2009, 09:09 AM
#2
Re: Reading from an external file
 Originally Posted by suprajasankari
Now what is the most efficient way to store such data in java so that it can be read from an external file ?
What do you mean by 'efficient'? Easiest to code? smallest file size? quickest to read or write? least lines of code?
If it's an external file, as you specify, then you'd have to read the file...
The question is, why would you not use a database rather than a file? A database is designed to handle this kind of data storage and retrieval efficiently. So why specify a file - or was that just a shorthand for 'some form of persistent storage' ?
Being abstract is something profoundly different from being vague... The purpose of abstraction is not to be vague, but to create a new semantic level in which one can be absolutely precise...
E. Dijkstra
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
-
February 24th, 2009, 12:11 AM
#3
Re: Reading from an external file
i meant quickest to read or write.
Yes,iam using a lexicon txt from which i read by HashTable.But the problem is I need not scan every word till the wordhit.Thats why i thought of having a seperate file with just 50 vague words.The dataset is small.So not using database.
Regards,
Supraja
-
February 24th, 2009, 12:13 AM
#4
Re: Reading from an external file
Btw, it is'nt abstraction in writing alone but abstraction & vaguness in thoughts as well !
It is my first project.
-
February 24th, 2009, 06:16 AM
#5
Re: Reading from an external file
Last edited by Maria_David; February 24th, 2009 at 06:18 AM.
-
February 25th, 2009, 03:54 PM
#6
Re: Reading from an external file
It doesn't really matter how you store them in Java, reading and writing the file will be orders of magnitude slower than the Java processing.
Simplicity is prerequisite for reliability...
E. Dijkstra
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|