aspell-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Aspell-user] Re: [aspell-devel] Suggestions for correct words, etc.


From: Kevin Atkinson
Subject: [Aspell-user] Re: [aspell-devel] Suggestions for correct words, etc.
Date: Mon, 27 Nov 2006 00:49:13 -0700 (MST)

On Mon, 27 Nov 2006, Devdutt Marathe wrote:

[Originally posted to aspell-devel, but it belongs to aspell-user so I am replying to aspell-user]

I need to receive alternate spellings not only for words not in the
dictionary, but also for words that are present in the dictionary. This
would be used, for example, to interface with a search engine and offer
suggestions for even correctly spelt words based on number of hits received
for the alternative spellings. What's the easiest way to do this?

If you use the C API you can do this. The suggest function doesn't care if the word is in the dictionary or not.

I am also thinking of writing some code to set up aspell as an apache httpd
dynamic shared object which can be accessed over an http api. Is there a
related effort going on somewhere in the community? In this regard, is it
safe to use mod_prefork? What about thread-safety? Do I need to
"synchronize" around calls to the Aspell API? If so, one alternative I can
think of is to maintain a pool of Aspell objects at the server and use one
that is free (somewhat like DB connection pooling). Any comments?

This is documented in the manual.

Lastly, what is the behavior of aspell in the following scenario: I am
accessing aspell (say correcting a very large file in pipe mode), and while
I am doing this, I delete the current dictionary, phonetic map, etc., and
replace them with a new dictionary and phonetic map. Will this cause the
current call to aspell to crash? When will the new dictionary be loaded?

I assume you mean "change" not "delete" since, in Unix, when you delete a file you are really just unlinking it. Programs which have an open file handle to the old file will continue to have access to it until it closes the handle. If you change the read-only dictionary from under it Aspell will likely crash or do other strange things since those files are mmaped in. If you change a writable (such as the personal word list) dictionary Aspell simply won't use it until the dictionary is reloaded since it is read into memory. You can reload it by calling "aspell_speller_save_all_word_lists" since when saving the wordlist Aspell also checks for new entries. There currently isn't a way to just reload the writable dictionaries from the C API.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]