AbiSource, Inc.
This document provides preliminary design notes for SpellChecker integration into AbiWord.
AbiWord will integrate a third-party GPL'd spelling checker. It will be built as a library and linked with AbiWord; it will not use a separate executable or process. The source for this library will be located in a directory under the
Conceptually, the SpellChecker may be divided into the following parts:
1. Code which resides in the Format/View code that determines which portions of the document are unchecked and either performs the check or schedules them for checking. (VIEW)
2. Code which draws squiggly red lines under incorrect words, and provides various GUI interaction with the user, such as a context-menu to suggest alternatives and any dialogs. (GUI)
3. Code which implements the dictionary lookup and composes alternatives for misspelled words. This code will be adapted from existing third-party GPL sources. (LOOKUP)
4. Code which updates the document for ignoring words on an individual-instance and document-instance basis. (DOC)
5. Code which updates the user's document-independent ignore list. (PREF)
The VIEW-related code will execute in the
The VIEW will maintain a series of data structures identifying the
(Handwave) The VIEW will also make use of the existing Block and Run data structures to record the results of previous spell checks. This includes: Correct, IgnoreThisInstance, IgnoreInThisDocument, Wrong, etc.
The GUI for SpellCheck should include:
1. Variations on the red squiggly line.
2. Context menu listing alternatives or to ignore this instance.
3. Various dialogs.
The LOOKUP engine should provide an API to allow the timer code to request a spell-check on a passage. Whether this executes in-thread or uses its own thread is a detail we can address after we choose and port a third-party engine.
The AbiWord Document Format[2] will need to augmented to remember span-level attributes for text marked IgnoreThisInstance and to remember document-level attributes for text marked IgnoreInThisDocument.
(Handwave) The AbiWord User Preference Mechanism[3] will need to be augmented to remember words that should always be ignored.
[1] AbiWord Thread Design Notes....
[2] AbiWord Document Format ....
[3] AbiWord User Preference Mechanism ....