Ejemplo n.º 1
0
        private void MakeSensitiveWords()
        {
            List <string> wordResult = new List <string>();
            var           words      = LuceneHelper.AnalysisVocabulary(m_Text);

            foreach (var word in words)
            {
                if (LuceneHelper.WordTree.ExtraWordDict.Contains(word))
                {
                    wordResult.Add(word);
                }
            }

            m_SensitiveWordResult.IsSensitiveWord = true;
            m_SensitiveWordResult.AllDictErrorWord.Add(m_SensitiveWordEntity.Field, wordResult);
        }
Ejemplo n.º 2
0
        private void MakeSensitiveWord()
        {
            var words = LuceneHelper.AnalysisVocabulary(m_Text);

            foreach (var word in words)
            {
                if (LuceneHelper.WordTree.ExtraWordDict.Contains(word))
                {
                    if (m_SensitiveWordResult.SensitiveWordResultType == ESensitiveWordResultType.OnlyOne)
                    {
                        m_SensitiveWordResult.IsSensitiveWord      = true;
                        m_SensitiveWordResult.OnlyOneDictErrorWord = new KeyValuePair <string, string>(m_SensitiveWordEntity.Field, word);
                    }
                    else
                    {
                        m_SensitiveWordResult.PerOneDictErrorWord.Add(m_SensitiveWordEntity.Field, word);
                    }

                    return;
                }
            }
        }