Dictionary Design
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10

Thread: Dictionary Design

  1. #1
    Join Date
    Sep 2004
    Posts
    2

    Dictionary Design

    I am trying to make a Turkish-Spanish dictionary. I couldn't make a decision about how to keep data in files. Can you give me any advices about how to keep files? I have made decision about lookup in memory. Thanks in advance

  2. #2
    Join Date
    Aug 2002
    Location
    Madrid
    Posts
    4,588

    Re: Dictionary Design

    You could dump your memory to disk, if it's in a format that can be written as is (e.g. a FSM), you could use a database (this will allow you not to have to read everything into memory at run-time) or you could use a simple text file (which will be longer to read, but the user can edit it then).
    Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
    Supports C++ and VB out of the box, but can be configured for other languages.

  3. #3
    Join Date
    Sep 2004
    Location
    Tehran(Ir)
    Posts
    469

    Re: Dictionary Design

    IMO,working with databases is much easier but I have a question here,can you tell me what you mean from database...
    I mean how I can write a software when its installed every time could install our word database on every client computer ....
    (i.e in ASP.NET we have only one database copied to the server and every request could be handled through DBMS of the server computer but here we should install the databse on every client computer...
    can someone make it clear for me,am I wrong completely?)
    Thanks in advance.


    --------------------
    Mehdi.

  4. #4
    Join Date
    Aug 2002
    Location
    Madrid
    Posts
    4,588

    Re: Dictionary Design

    On Windows, you can always use Jet databases through DAO or ADO. This should be installed on any recent Windows computer.
    Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
    Supports C++ and VB out of the box, but can be configured for other languages.

  5. #5
    Join Date
    Apr 2003
    Location
    Los Angeles area
    Posts
    776

    Re: Dictionary Design

    I have found that word dictionaries are best handled by "directed acyclic word graphs." They provide very fast lookup and can be compressed enough so that you can store both the Spanish and Turkish language in memory without going to disk. If you are intending to put in definitions, usages, and that stuff though then it may be easier to use a database (but not faster).

  6. #6
    Join Date
    Sep 2004
    Location
    Tehran(Ir)
    Posts
    469

    Re: Dictionary Design

    yes,you are right ....
    consider,we wan to use MSsqlserver here(a non jet database) ...
    can you tell me How its possible? ...
    Tnx

    ------------------
    Mehdi.

  7. #7
    Join Date
    Sep 2004
    Location
    Tehran(Ir)
    Posts
    469

    Re: Dictionary Design

    Quote Originally Posted by Yves M
    You could dump your memory to disk, if it's in a format that can be written as is (e.g. a FSM), you could use a database (this will allow you not to have to read everything into memory at run-time) or you could use a simple text file (which will be longer to read, but the user can edit it then).
    Hello Yves,
    could you tell me what you mean from dumping memory,do you mean i.e I can use Stream and StreamReader objects for buffering my database file while reading it or you meant something else?!,
    could you help me or point me to a link or tip?!
    thank you very much in advance.

    ---------------
    Mehdi.

  8. #8
    Join Date
    Jun 2002
    Location
    Moscow, Russia.
    Posts
    2,176

    Re: Dictionary Design

    I think that anyway the best way out would be the manually written engine or some dictionary-specific simple engine, because any dictionary is a simple structure and if you write it manually (and properly!) you will receive the greater speed and no need in support (and purchase) for external systems like databases or any general technology.

    Indexing may be done in two-three implementations at once: binary alphabetic tree for positioning the dictionary on entering first chars, hash for quick search and inexact search. Of cause all info would be stored on disk without loading into memory, indexes just store some information to get that info from file. File structure depends on if you need to change a large number of words runtime: if it is, you should provide some safe saving method (clustering of file would be OK). Hash and binary tree can be updated in no time.
    "Programs must be written for people to read, and only incidentally for machines to execute."

  9. #9
    Join Date
    Sep 2004
    Location
    Tehran(Ir)
    Posts
    469

    Re: Dictionary Design

    Thank you very much for your reply
    I found a good explanation in this book,
    fundamentals of datastructures by Ellis Horowitz :chapter 8:Hashing

    -------------------
    Mehdi.

  10. #10
    Join Date
    Jan 2005
    Posts
    1

    Re: Dictionary Design

    Quote Originally Posted by galatasarayer
    I am trying to make a Turkish-Spanish dictionary. I couldn't make a decision about how to keep data in files. Can you give me any advices about how to keep files? I have made decision about lookup in memory. Thanks in advance
    FSM is a good Idea for store dictionary entries (and in your case the entry translation as definition). If you chose this way, I advice you use s_fsa toolkit develop by Dan daciuk. You can build an minimal automa. You can also deal with diacritics errors ...

    http://juggernaut.eti.pg.gda.pl/~jandac/ for more informations

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center