Пример #1
0
        public static bool IsNonWordMerge(string inWord, CSpellApi cSpellApi, bool debugFlag)
        {
            // init
            RootDictionary checkDic = cSpellApi.GetSplitWordDic();             // merge Dic
            RootDictionary unitDic  = cSpellApi.GetUnitDic();
            // non-word merge must be:
            // 1. not known in the dictionary
            // 2. not exception, such as url, email, digit, ...
            // => if excpetion, even is a non-word, still not a misspelt
            bool nonWordMergeFlag = (!checkDic.IsValidWord(inWord)) && (!IsNonWordMergeExceptions(inWord, unitDic));

            // print out debug
            if (debugFlag == true)
            {
                bool wordDicFlag       = checkDic.IsValidWord(inWord);
                bool wordExceptionFlag = IsNonWordMergeExceptions(inWord, unitDic);
                DebugPrint.PrintNwMergeDetect(inWord, nonWordMergeFlag, wordDicFlag, wordExceptionFlag, debugFlag);
            }
            return(nonWordMergeFlag);
        }