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
Re: Reading from an external file
Quote:
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?
Quote:
How do I retrieve it ?
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
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
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.
Re: Reading from an external file
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