tags:

views:

256

answers:

1

I am using aspell in my application for spell checking (a c/c++ app), and I want to use it to find best alternatives in a custom work list. I don't want to use a standard dictionary, as I only want to find words in my word list. I can find ways of adding words to a dictionary (aspell_speller_add_to_personal and aspell_speller_add_to_session), but I don't know how to start with an empty dictionary that I can then populate at run time.

Has anybody done this, or know how to do it? Alternatively, any recommendations for algorithms for choosing a "best match" in a word list?

+2  A: 

I did this about three years ago. It was in a convoluted way that included creating a dictionary data structure from an existing file, deleting it and adding words using aspeller::Dictionary::add(). It was tough.

If you do not have to use aspell, you may try hunspell, which may or may not be easier to customize.

See also Peter Norvig's Great Paper about writing a spelling corrector.

Yuval F
Thank you. I thought I might have to mess with dictionary files. The paper you pointed me to is great and I think I shall work with it.
Simon Parker