Method | Description | |
---|---|---|
AddAnySpellingExceptionsFromBackup ( string backupPath ) : void |
Used in restoring backups, copy the specified file, typically an exc, to the hunspell directory Will not overwrite any existing files. Exceptions for vernacular dictionaries are wiped out when the dictionary is initialized. |
|
DictionaryExists ( int ws, ILgWritingSystemFactory wsf ) : bool |
Return true iff GetSpellChecker will return a non-null value.
|
|
DictionaryExists ( string dictId ) : bool |
Return true iff GetSpellChecker will return a non-null value.
|
|
DictionaryId ( int ws, ILgWritingSystemFactory wsf ) : string |
Return the string which should be used to request a dictionary for the specified writing system, or null if none will work.
|
|
EnsureDictionary ( int ws, ILgWritingSystemFactory wsf ) : ISpellEngine |
Make sure that a dictionary exists for the specified writing system. Currently this will NOT do so if its spelling ID is set to None (in angle brackets). Callers may want to include code like this: var wsObj = Cache.ServiceLocator.WritingSystems.DefaultVernacularWritingSystem; if (wsObj.SpellCheckingId == "None") // add angle brackets around None wsObj.SpellCheckingId = wsObj.Id.Replace('-', '_'); Enhance JohnT: maybe code like that should be part of this method? But it is meant to just make sure the dictionary exists, once the right SpellCheckingId has been established.
|
|
GetDictionaryIds ( ) : IEnumerable |
Get all the IDs that will produce dictionaries (without any tricks like prefix matching).
|
|
GetExceptionFileName ( string dictFileName ) : string |
The file name where we store exceptions is unfortunately the short-file-name version of the dictionary. We can't easily change this, so that is what we have to deal with any time we care about it.
|
|
GetSpellChecker ( int ws, ILgWritingSystemFactory wsf ) : ISpellEngine |
Get a dictionary for the specified writing system, or null if we don't know of one. We ideally want a dictionary that exactly matches the specified writing system, that is, the file name for the .dic file == the SpellCheckDictionary of the writing system. If we can't find such a dictionary, for major languages (those we didn't create from wordform inventory), we will return a dictionary that shares a prefix, for example, 'en' when looking for 'en_US' or vice versa. This is not allowed for vernacular languages (where the dictionary is one we created ourselves); we return null if we can't find an exact match or an approximate match that is a 'major' language dictionary.
|
|
IsVernacular ( string dictId ) : bool |
A dictionary is considered vernacular if it contains our special word. That is, we presume it is one we created and can rewrite if we choose; and it should not be used for any dictionary ID that is not an exact match.
|
|
PathsToBackup ( string dictId ) : IEnumerable |
Return the files that should be backed up for the given dictionary. For now this is just the exc file, if it exists, and if the dictionary is not vernacular. (We assume any major language dictionary can be recovered from somewhere, and a vernacular one can be rebuilt from the WFI.)
|
|
ResetDictionary ( string id, IEnumerable |
Reset the whole dictionary for this ID. Henceforth it will contain exactly the words passed. Note that this will not affect any existing ISpellEngine; try not to have any left around.
|
|
SetSpellingStatus ( string word, int ws, ILgWritingSystemFactory wsf, bool fCorrect ) : void |
Ensure that the spelling dictionary (if any) for the specified ws will give the specified answer regarding the specified word.
|
Method | Description | |
---|---|---|
AddAnySpellingExceptionsFromBackup ( string backupDictionaryPath, string destinationPath ) : void | ||
ClearAllDictionaries ( ) : void |
For testing (so far), clear all dictionaries so we can make a new one and verify persistence.
|
|
DictIdFromPath ( string path ) : string | ||
DictionaryId ( string dictId ) : string | ||
EnsureDictionary ( string dictId ) : void | ||
GetDicPath ( string dirPath, string icuLocale ) : string |
Get the path for the dictionary for a particular locale, if it is one of our private ones, given the path to the directory where we make them and the icuLocale.
|
|
GetShortName ( string input ) : string | ||
GetShortPathName ( string lpszLongPath, char lpszShortPath, int cchBuffer ) : uint | ||
GetSpellChecker ( string dictId ) : ISpellEngine | ||
GetSpellingDirectoryPath ( ) : string |
Locates the directory in which we look for and create hunspell dictionaries.
|
|
InitDictionary ( string dicPath, IEnumerable |
||
IsValidDictionary ( string path ) : bool | ||
RawDictionaryId ( int ws, ILgWritingSystemFactory wsf ) : string | ||
RawGetSpellChecker ( string dictId ) : |
||
SpellingHelper ( ) : System |
public static AddAnySpellingExceptionsFromBackup ( string backupPath ) : void | ||
backupPath | string | |
return | void |
public static DictionaryExists ( int ws, ILgWritingSystemFactory wsf ) : bool | ||
ws | int | |
wsf | ILgWritingSystemFactory | |
return | bool |
public static DictionaryExists ( string dictId ) : bool | ||
dictId | string | |
return | bool |
public static DictionaryId ( int ws, ILgWritingSystemFactory wsf ) : string | ||
ws | int | |
wsf | ILgWritingSystemFactory | |
return | string |
public static EnsureDictionary ( int ws, ILgWritingSystemFactory wsf ) : ISpellEngine | ||
ws | int | |
wsf | ILgWritingSystemFactory | |
return | ISpellEngine |
public static GetDictionaryIds ( ) : IEnumerable |
||
return | IEnumerable |
public static GetExceptionFileName ( string dictFileName ) : string | ||
dictFileName | string | |
return | string |
public static GetSpellChecker ( int ws, ILgWritingSystemFactory wsf ) : ISpellEngine | ||
ws | int | |
wsf | ILgWritingSystemFactory | |
return | ISpellEngine |
public static IsVernacular ( string dictId ) : bool | ||
dictId | string | |
return | bool |
public static PathsToBackup ( string dictId ) : IEnumerable |
||
dictId | string | |
return | IEnumerable |
public static ResetDictionary ( string id, IEnumerable |
||
id | string | |
words | IEnumerable |
|
return | void |
public static SetSpellingStatus ( string word, int ws, ILgWritingSystemFactory wsf, bool fCorrect ) : void | ||
word | string | |
ws | int | |
wsf | ILgWritingSystemFactory | |
fCorrect | bool | |
return | void |