Dictionary Data Structure

Discussion in 'C Programming' started by ravi, Aug 18, 2007.

  1. ravi

    ravi Guest

    I want to implement a dictionary data structure with the features
    features
    * autocorrect
    * autocomplete
    * spellcheck

    can any body tell me that which data structure will be best for its
    implementation in C/C++

    Thanx in adv.
    ravi, Aug 18, 2007
    #1
    1. Advertising

  2. ravi

    ravi Guest

    I think of Hash Table or Tries

    but the space required by them will be very large
    ravi, Aug 18, 2007
    #2
    1. Advertising

  3. ravi

    Ian Collins Guest

    ravi wrote:
    > I want to implement a dictionary data structure with the features
    > features
    > * autocorrect
    > * autocomplete
    > * spellcheck
    >
    > can any body tell me that which data structure will be best for its
    > implementation in C/C++
    >

    Which language are you using? The answer will be different for each.

    --
    Ian Collins.
    Ian Collins, Aug 18, 2007
    #3
  4. ravi

    ravi Guest

    On Aug 18, 12:15 pm, Ian Collins <> wrote:
    > ravi wrote:
    > > I want to implement a dictionary data structure with the features
    > > features
    > > * autocorrect
    > > * autocomplete
    > > * spellcheck

    >
    > > can any body tell me that which data structure will be best for its
    > > implementation in C/C++

    >
    > Which language are you using? The answer will be different for each.
    >
    > --
    > Ian Collins.


    C/C++
    ravi, Aug 18, 2007
    #4
  5. ravi

    Ian Collins Guest

    ravi wrote:
    > On Aug 18, 12:15 pm, Ian Collins <> wrote:
    >> ravi wrote:
    >>> I want to implement a dictionary data structure with the features
    >>> features
    >>> * autocorrect
    >>> * autocomplete
    >>> * spellcheck
    >>> can any body tell me that which data structure will be best for its
    >>> implementation in C/C++

    >> Which language are you using? The answer will be different for each.
    >>

    >
    > C/C++
    >

    There is no such language, are you using C or C++?

    --
    Ian Collins.
    Ian Collins, Aug 18, 2007
    #5
  6. "Ian Collins" <> wrote in message
    news:...
    > ravi wrote:
    >> I want to implement a dictionary data structure with the features
    >> features
    >> * autocorrect
    >> * autocomplete
    >> * spellcheck
    >>
    >> can any body tell me that which data structure will be best for its
    >> implementation in C/C++
    >>

    > Which language are you using? The answer will be different for each.
    >

    No it won't. Algorithms are independent of the language they are implemented
    in. Making the post strictly non-topical, though I think we are maybe being
    too strict in rejecting all algorthmic questions.

    Autocomplete implies a tree structure. Autocorrect is a lot more difficult
    because you need an intelligent matching function. Spellcheck is implied by
    autocomplete.
    New words will be added by the user relatively infrequently. It seems to me
    we are looking at a alphabetically ordered flat array for autocomplete /
    spell check. Intelligent spelling correction I don't know. Presumably you
    use a Needleman-Wunch algorithm to get the best match, though how to filter
    efficiently before calling it I don't know.

    --
    Free games and programming goodies.
    http://www.personal.leeds.ac.uk/~bgy1mm
    Malcolm McLean, Aug 18, 2007
    #6
  7. ravi

    ravi Guest

    On Aug 18, 12:40 pm, Ian Collins <> wrote:
    > ravi wrote:
    > > On Aug 18, 12:15 pm, Ian Collins <> wrote:
    > >> ravi wrote:
    > >>> I want to implement a dictionary data structure with the features
    > >>> features
    > >>> * autocorrect
    > >>> * autocomplete
    > >>> * spellcheck
    > >>> can any body tell me that which data structure will be best for its
    > >>> implementation in C/C++
    > >> Which language are you using? The answer will be different for each.

    >
    > > C/C++

    >
    > There is no such language, are you using C or C++?
    >
    > --
    > Ian Collins.


    Yes
    ravi, Aug 18, 2007
    #7
  8. ravi

    Sensei Guest

    On 2007-08-18 10:35:37 +0200, ravi <> said:

    >> There is no such language, are you using C or C++?

    >
    > Yes


    Technically the answer is perfect... Like 'excuse me, do you know what
    time is it?', answer 'yes'.

    --
    Sensei <senseiwa at Apple's mac dot com>

    Beware of bugs in the above code; I have only proved it correct, not tried it.
    (Donald Knuth)
    Sensei, Aug 18, 2007
    #8
  9. ravi

    mani Guest

    ravi wrote:
    > I want to implement a dictionary data structure with the features
    > features
    > * autocorrect
    > * autocomplete
    > * spellcheck
    >
    > can any body tell me that which data structure will be best for its
    > implementation in C/C++
    >
    > Thanx in adv.


    ternary search tree is the best
    mani, Aug 18, 2007
    #9
  10. ravi

    Ian Collins Guest

    Malcolm McLean wrote:
    >
    > "Ian Collins" <> wrote in message
    > news:...
    >> ravi wrote:
    >>> I want to implement a dictionary data structure with the features
    >>> features
    >>> * autocorrect
    >>> * autocomplete
    >>> * spellcheck
    >>>
    >>> can any body tell me that which data structure will be best for its
    >>> implementation in C/C++
    >>>

    >> Which language are you using? The answer will be different for each.
    >>

    > No it won't. Algorithms are independent of the language they are
    > implemented in. Making the post strictly non-topical, though I think we
    > are maybe being too strict in rejecting all algorthmic questions.
    >

    Yes it will, the OP asked which *data structure* would be best.

    --
    Ian Collins.
    Ian Collins, Aug 18, 2007
    #10
  11. ravi

    ravi Guest

    On Aug 18, 1:53 pm, mani <> wrote:
    > ravi wrote:
    > > I want to implement a dictionary data structure with the features
    > > features
    > > * autocorrect
    > > * autocomplete
    > > * spellcheck

    >
    > > can any body tell me that which data structure will be best for its
    > > implementation in C/C++

    >
    > > Thanx in adv.

    >
    > ternary search tree is the best


    Can you tell me how ?
    ravi, Aug 18, 2007
    #11
  12. Sensei <senseiwa at Apple's mac dot com> said:

    > On 2007-08-18 10:35:37 +0200, ravi <> said:
    >
    >>> There is no such language, are you using C or C++?

    >>
    >> Yes

    >
    > Technically the answer is perfect... Like 'excuse me, do you know what
    > time is it?', answer 'yes'.


    Indeed. Nevertheless, it confirms that Sturgeon was an optimist when it
    comes to gmail-based posters. What "ravi" has missed is that the best C
    answer is different to the best C++ answer.

    --
    Richard Heathfield <http://www.cpax.org.uk>
    Email: -www. +rjh@
    Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
    "Usenet is a strange place" - dmr 29 July 1999
    Richard Heathfield, Aug 18, 2007
    #12
  13. ravi

    Coos Haak Guest

    Op Sat, 18 Aug 2007 06:08:27 -0700 schreef ravi:

    > On Aug 18, 1:53 pm, mani <> wrote:
    >> ravi wrote:
    >>> I want to implement a dictionary data structure with the features
    >>> features
    >>> * autocorrect
    >>> * autocomplete
    >>> * spellcheck

    >>
    >>> can any body tell me that which data structure will be best for its
    >>> implementation in C/C++

    >>
    >>> Thanx in adv.

    >>
    >> ternary search tree is the best

    >
    > Can you tell me how ?


    You're using gmail, is this not a part of Google?
    Look it up: 'ternary trees' gives 681.000 hits when I try!
    --
    Coos
    Coos Haak, Aug 18, 2007
    #13
  14. ravi

    SM Ryan Guest

    # > > I want to implement a dictionary data structure with the features
    # > > features
    # > > * autocorrect
    # > > * autocomplete
    # > > * spellcheck

    # > Which language are you using? The answer will be different for each.

    Which platform? I believe Mac OS 10 provides all this with a few
    Objective-C calls.

    --
    SM Ryan http://www.rawbw.com/~wyrmwif/
    Mention something out of a Charleton Heston movie, and suddenly
    everybody's a theology scholar.
    SM Ryan, Aug 19, 2007
    #14
  15. ravi

    ravi Guest

    On Aug 19, 4:58 am, SM Ryan <wyrm...@tango-sierra-oscar-foxtrot-
    tango.fake.org> wrote:
    > # > > I want to implement a dictionary data structure with the features
    > # > > features
    > # > > * autocorrect
    > # > > * autocomplete
    > # > > * spellcheck
    >
    > # > Which language are you using? The answer will be different for each.
    >
    > Which platform? I believe Mac OS 10 provides all this with a few
    > Objective-C calls.
    >
    > --
    > SM Ryanhttp://www.rawbw.com/~wyrmwif/
    > Mention something out of a Charleton Heston movie, and suddenly
    > everybody's a theology scholar.


    No, I am using Windows XP
    ravi, Aug 19, 2007
    #15
  16. ravi

    Ian Collins Guest

    ravi wrote:
    > On Aug 19, 4:58 am, SM Ryan <wyrm...@tango-sierra-oscar-foxtrot-
    > tango.fake.org> wrote:
    >> # > > I want to implement a dictionary data structure with the features
    >> # > > features
    >> # > > * autocorrect
    >> # > > * autocomplete
    >> # > > * spellcheck
    >>
    >> # > Which language are you using? The answer will be different for each.
    >>
    >> Which platform? I believe Mac OS 10 provides all this with a few
    >> Objective-C calls.
    >>

    *Please don't quote signatures*
    >
    > No, I am using Windows XP
    >

    You still haven't said which language you are using.

    --
    Ian Collins.
    Ian Collins, Aug 19, 2007
    #16
  17. ravi

    ravi Guest

    Ian Collins wrote:
    > ravi wrote:
    > > On Aug 19, 4:58 am, SM Ryan <wyrm...@tango-sierra-oscar-foxtrot-
    > > tango.fake.org> wrote:
    > >> # > > I want to implement a dictionary data structure with the features
    > >> # > > features
    > >> # > > * autocorrect
    > >> # > > * autocomplete
    > >> # > > * spellcheck
    > >>
    > >> # > Which language are you using? The answer will be different for each.
    > >>
    > >> Which platform? I believe Mac OS 10 provides all this with a few
    > >> Objective-C calls.
    > >>

    > *Please don't quote signatures*
    > >
    > > No, I am using Windows XP
    > >

    > You still haven't said which language you are using.
    >
    > --
    > Ian Collins.


    I am using C programming language.
    ravi, Aug 20, 2007
    #17
  18. ravi

    CBFalconer Guest

    ravi wrote:
    > Ian Collins wrote:
    >> ravi wrote:
    >>

    .... snip ...
    >>
    >> *Please don't quote signatures*
    >>>
    >>> No, I am using Windows XP

    >>
    >> You still haven't said which language you are using.
    >>
    >> --
    >> Ian Collins.

    >
    > I am using C programming language.


    You still haven't learned the fine art of snipping signatures.

    --
    Chuck F (cbfalconer at maineline dot net)
    Available for consulting/temporary embedded and systems.
    <http://cbfalconer.home.att.net>



    --
    Posted via a free Usenet account from http://www.teranews.com
    CBFalconer, Aug 20, 2007
    #18
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ilias Lazaridis
    Replies:
    6
    Views:
    434
    Ilias Lazaridis
    Feb 21, 2006
  2. james_027
    Replies:
    1
    Views:
    319
    Marc 'BlackJack' Rintsch
    Aug 22, 2007
  3. Albert Hopkins
    Replies:
    0
    Views:
    526
    Albert Hopkins
    Feb 23, 2009
  4. Navkirat Singh
    Replies:
    6
    Views:
    3,013
    Navkirat Singh
    Jul 29, 2010
  5. A
    Replies:
    27
    Views:
    1,592
    Jorgen Grahn
    Apr 17, 2011
Loading...

Share This Page