CadSpellDictionary
from OpenCAD2D import CadSpellDictionary
class CadSpellDictionary(System.Object) ยท CadSpellDictionary in the .NET reference
The dictionary the MTEXT editor's spell check looks words up in, as AutoCAD 2021's Spell Check panel does: the built-in English dictionary (CadSpelling) and a custom dictionary, a text file of words one to a line (AutoCAD's sample.cus form), with the words ignored for the session. Add Word appends to the file; Edit Dictionaries adds and deletes words in it.
Constructors
__init__
def __init__(self, customFile: str | None = ...) -> None
Makes the dictionary over a custom dictionary file, read where it exists.
Properties and fields
BuiltInCount
BuiltInCount: ClassVar[int]
Gets how many words the built-in English dictionary holds.
CustomFile
@property
def CustomFile(self) -> str | None
Gets the custom dictionary file; null where the words are kept for the session only.
CustomWords
@property
def CustomWords(self) -> System.Collections.Generic.IReadOnlyList[str]
Gets the custom words in ordinal order, letters of either case the same.
Settings
@property
def Settings(self) -> CadSpellSettings
@Settings.setter
def Settings(self, value: CadSpellSettings | None) -> None
Gets or sets which words are passed over, as Check Spelling Settings gives them; the defaults until set.
Methods
Add
def Add(self, word: str) -> str
Adds a word to the custom dictionary, so that it is spelt right from now on, and to the end of its file: Add Word.
Check
def Check(self, editor: CadMTextEditor) -> System.Collections.Generic.IReadOnlyList[CadMisspelledWord]
Finds the words of the editor that are misspelled, in order: runs of letters, digits and inner apostrophes, a symbol or a stack ending a word. The words of the editor as it is now, not as it was when asked before.
IgnoreAll
def IgnoreAll(self, word: str) -> None
Leaves a word as it is wherever it comes, for as long as the dictionary lives: Ignore All.
IsMisspelled
def IsMisspelled(self, word: str) -> bool
Gets whether a word is wrong: not passed over by the settings, not ignored, not in the built-in dictionary (with its plain endings) or the custom one.
Remove
def Remove(self, word: str) -> str
Takes a word out of the custom dictionary and its file, the other lines of the file left as they are: Edit Dictionaries' Delete.
Suggest
def Suggest(self, word: str) -> System.Collections.Generic.IReadOnlyList[str]
Gets the words nearest a misspelled one, at most five, the best first, in the case the word begins with.