public static bool IsNonWord(string inWord, CSpellApi cSpellApi, bool debugFlag) { // init RootDictionary checkDic = cSpellApi.GetCheckDic(); RootDictionary unitDic = cSpellApi.GetUnitDic(); // non-word must be: // 1. not known in the dictionary // 2. not exception, such as url, email, digit, ... // => if excpetion, even is a nor-word, still not a misspelt bool nonWordFlag = (!checkDic.IsValidWord(inWord)) && (!IsNonWordExceptions(inWord, unitDic)); if (debugFlag == true) { bool wordDicFlag = checkDic.IsValidWord(inWord); bool wordExceptionFlag = IsNonWordExceptions(inWord, unitDic); DebugPrint.PrintNwDetect(inWord, nonWordFlag, wordDicFlag, wordExceptionFlag, debugFlag); } return(nonWordFlag); }