SIL.CoreImpl.SpellingHelper.GetSpellChecker C# (CSharp) Method

GetSpellChecker() public static method

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.
public static GetSpellChecker ( int ws, ILgWritingSystemFactory wsf ) : ISpellEngine
ws int
wsf ILgWritingSystemFactory
return ISpellEngine
		public static ISpellEngine GetSpellChecker(int ws, ILgWritingSystemFactory wsf)
		{
			string dictId = DictionaryId(ws, wsf);
			if (dictId == null)
				return null;
			return GetSpellChecker(dictId);
		}

Same methods

SpellingHelper::GetSpellChecker ( string dictId ) : ISpellEngine

Usage Example

Ejemplo n.º 1
0
        public void OurDictionaryIsPrivate()
        {
            var dictId = MakeEmptyFooDictionary();
            var dict   = SpellingHelper.GetSpellChecker(dictId);

            dict.SetStatus("big", true);
            var otherDict = SpellingHelper.GetSpellChecker("fo");             // try to get one with a shorter name

            Assert.That(otherDict, Is.Null);
        }
All Usage Examples Of SIL.CoreImpl.SpellingHelper::GetSpellChecker