CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2009
    Posts
    3

    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

  2. #2
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: Reading from an external file

    Quote Originally Posted by suprajasankari View Post
    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?

    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
    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.

  3. #3
    Join Date
    Feb 2009
    Posts
    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

  4. #4
    Join Date
    Feb 2009
    Posts
    3

    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.

  5. #5
    Join Date
    Feb 2009
    Posts
    1

    Re: Reading from an external file

    Nice information...

    thanks for sharing....


    take care



    __________________________________________________
    Wholesale Battery & Power Suppliers Directory | UAE & Dubai Business Services Directory | Sports Wholesalers & Suppliers Directory | Something Directory
    Last edited by Maria_David; February 24th, 2009 at 06:18 AM.

  6. #6
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    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
  •  





Click Here to Expand Forum to Full Width

Featured