Skip to main content

How to Add Dictionaries in Code

The following example demonstrates how to add dictionaries to the spell checker programmatically:

// ...
uses
  dxISpellDecompressor;
// ...
var
  ADictionaryItem: TdxSpellCheckerDictionaryItem;
begin
  ADictionaryItem := SpellChecker.DictionaryItems.Add;
  ADictionaryItem.DictionaryTypeClass := TdxISpellDictionary;
  TdxISpellDictionary(ADictionaryItem.DictionaryType).DictionaryPath := '..\data\american.xlg';
  TdxISpellDictionary(ADictionaryItem.DictionaryType).GrammarPath := '..\data\english.aff';
  SpellChecker.LoadDictionaries;
end;
See Also