Logo

Addictive Software

spelling and thesaurus components

serving software developers since 1996



Code Gear Technology Partner


Technical Details (Addict 2 vs Addict 3)

More technical details for those who are interested:

New main dictionary format:

V3 uses AddictX's dictionary format. This format is far superior to that of 2.X. It is somewhat faster and is capable of reading larger dictionaries. Using AddictX's dictionary format also means that we get to use AddictX's dictionary compiler for v3 dictionaries. It wipes the floor with v2's dictionary compiler on speed and flexibility.

New user dictionary format:

V3 uses AddictX's custom dictionary format as well. Custom dictionaries are now binary structures implemented internally as hash tables. These dictionaries can grow very, very large with little or no speed loss. In fact, due to their simplicity, they are actually about 20-40% faster than main dictionaries. The tradeoff is in size.

New parsing architecture:

One of the nice features of V2 was that you could extend the controls that Addict checked with custom parsers. This worked fairly well, and allowed Addict to add many new 3rd party controls as time went on. However, the v2 parsers needed to understand not only how to communicate with the control they represented, but also how to form words and how to ignore various entities (such as URLs).

The V3 parsing interface take the core advantages of the V2 parsers and leave the other activities up to other areas in the code. Now, V3 parsers need to know nothing about how to form a word, or how to ignore anything. They simply need know how to talk to the component that they represent. This should allow future parsers to be created with more ease and eliminate bugs and inconsistencies between parsers.

New ignore-entity architecture:

A new feature of V3 is the ability to plug in an 'Ignore' entity into the spell check process. What this means is that as the developer, you can create a simple object that knows how to look for an entity (such as words surrounded by $dollar$ signs) and instruct Addict to ignore this entity in the text.

This mechanism is actually used by Addict internally to ignore all of the standard things v2 ignored (UPPERCASE, words with numbers, URLs, etc). This object abstracts the parser away from things that are ignored, allowing for consistency between controls for these features.

New parsing engine:

This is a new feature of V3 as well. Since the parsers are no longer responsible for forming the text stream (words) that Addict checks, a new object called the parsing engine picks up the responsibility for this. This allows for any needed customizations to the way that Addict parses text to be done in one place, regardless of parser. Addict also allows you to replace the parsing engine with one of your own making, or a derived version of the v3 engine with any additional functionality you wish to define.

New suggestions generator:

The responsibility for generating suggestions has now been given to a new object called the suggestions generator. This object can also be extended and replaced allowing you to customize the suggestions generation algorithm more to your liking (if needed).

Phonetic suggestions:

Addict v2 only generated its suggestions based upon common typing errors. v3 continues to do this, but also adds the ability to phonetically suggest replacement. Thus, we're much more able to generate suggestions that "sound" like the original word. The phonetics algorithm is completely configurable for each language.

Completely re-written configuration system:

The configuration class has been completely re-done with a much, much nicer model. Addict no longer requires a configuration file. In fact, it can now store its configuration in a file, in the registry, or in an application defined callback storage (store it in your DB if you wish). All dictionary configurations can now be full-path or relative to supplied (and runtime-changeable) dictionary directories. This is handled automatically and should make sharing dictionaries much easier to do. All dictionary names, paths, etc, now take %ConfigID% style completion macros to make relative paths work well.

New configuration dialogs:

It was found that the old configuration dialog was actually moderately difficult to use for novice users. The ability to add/remove dictionaries themselves would tend to confuse them. Efforts have been made to make this as straightforward as possible without sacrificing functionality. This being said, the options and main dictionaries are presented on the initial dialog. Single-clicking on a main dictionary changes its loaded status... the dictionary list is populated automatically from existing dictionaries in the dictionary directories given to Addict. A drop-down allows the user to change their custom-dictionary, and a 'Dictionaries...' button next to this drop-down allows access to a secondary dialog allowing the user to create / remove / edit / load / unload their custom dictionaries.

User dictionary editing dialog:

This was a common feature request for v2. Now, v3 has a native custom-dictionary editing dialog built in.

New spell check dialog:

The dialog has undergone some slight aesthetic updates, as well as a couple of feature changes. I've removed the 'suggest' button, as this wasn't readily understood by most users and was found very rarely used. The functionality is still available from custom dialogs if wanted. I've also changed the way a loss of focus will affect the dialog. Previously, when losing focus, v2 would disable all controls and enable a 'Start' button which re-started the spell check. This button has been removed in favor of automatically re-starting the spell check from the last checked position in the text (or the cursor position - whichever is earlier in the text).

New dialog control component:

The old spell check dialog control component has been replaced with a new component capable of directly communicating all information needed for both spell checking and configuration. This allows for *ALL* of Addict's dialogs to be directly (and fairly easily) replaced if dissatisfied with any of them.

Undo functionality:

This was completely re-written to divorce all details of an undo operation from the control parser. The control-parser is now simply notified of when it is going to happen, but all of the maintenance and work is performed by Addict.

InitialPosition and SelectionAvoidance properties:

These have worked their way into v3 with one addition to InitialPosition. V3 now defaults to storing the last position that the user has placed the spell check dialog.

Spell check dialog can now be modal:

For those who don't wish to have the user be able to click away from the spell check dialog and edit the text of the control while its up, you can now specify that the dialog remain modal.

Exclude words:

This is a new feature (that can be turned off) of custom dictionaries. The user can now specify a word that can always be considered misspelled. This allows a user who commonly mistypes a common word as another word that also exists in the language to catch their mistake.

Custom dictionary merging:

With v2 custom dictionaries, if two users opened the same dictionary and both made modifications to the dictionary, only the last user to save the dictionary would have their changes saved to the dictionary. v3 now does timestamp comparisons and will automatically merge dictionaries when this situation arises, preserving the changes of both users.

Ability to run a complete spell check programmatically

With v2, you could more or less do this by instantiating a parser, and then inspecting each word one at a time with the check routines and perform if not the same, but a similar function as did v2. This took quite a bit of work. With v3, you can programmatically run a spell check without ever showing a pixel of UI. You can directly simulate all actions available by the user (from Cancel to Add to Undo, etc).

SPEED!

v3 is faster than v2. No smoke and mirrors, no cheap tricks. The main dictionary format is faster and the user dictionary format is miles faster. Couple this with a better parsing architecture and a re-written WinAPI parser more tuned to speed and you get a pretty good boost in spell checking speed.

Here are the side-by-side comparison numbers for v2 and v3 (all numbers from a PIII 866):

Raw spelling check speed with the WinAPI parser on a RichEdit control containing the first 10778 words from Mary Shelly's Frankenstein:

Raw main dictionary lookup speed (American.adm):

New thesaurus UI:

By popular request, the thesaurus UI has been redesigned to be more consistent with other thesaurus products currently on the market. The new dialog is much more usable and is now easily replaceable with a custom dialog.

New AddictRichEdit components:

Addict now ships with two RichEdit components. They derive from the standard VCL RichEdit components for maximum compatibility with current applications. They provide complete live-spelling and live-correct support. Words simply don't do these components justice... we strongly encourage downloading the demo and taking a look at them for yourself.

These components are capable of providing the "little red squiggly underline" under misspelled words. This is a common feature typically seen in commercial word processors. Addict's RichEdit's mimic this look and feel very well. From a context menu the user can choose to do nearly every operation normally available from the spelling check dialog.

The components are also capable of doing auto-correct as you type. If you add an auto-correct entry that maps 'teh' to 'the', then if auto-correct is on and the user types 'teh' in the edit control, it will be automatically replaced with 'the'.