PanGu.Dict.WordDictionary.DeleteWord C# (CSharp) Method

DeleteWord() public method

public DeleteWord ( String word ) : void
word String
return void
        public void DeleteWord(String word)
        {
            string key = word.ToLower();

            if (key.Length == 1)
            {
                if (_FirstCharDict.ContainsKey(key[0]))
                {
                    _FirstCharDict.Remove(key[0]);
                    return;
                }
                else
                {
                    return;
                }
            }

            if (key.Length == 2)
            {
                uint doubleChar = ((uint)key[0] * 65536) + key[1];
                if (_DoubleCharDict.ContainsKey(doubleChar))
                {
                    _DoubleCharDict.Remove(doubleChar);
                    return;
                }
                else
                {
                    return;
                }
            }

            if (_WordDict == null)
            {
                return;
            }

            if (_WordDict.ContainsKey(key))
            {
                _WordDict.Remove(key);
            }
        }