Exemplo n.º 1
0
        static void Test()
        {
            MakeSensitiveWordMap();
            string test = "草你妈 三天之内杀了你";


            WordHandler h = new WordHandler(test);

            h.ChangeSensitiveWords();
            Console.WriteLine(h.newStr);
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            //prepare
            string str = File.ReadAllText(sensitiveWordsLibPath, Encoding.Default);

            string[] words = Regex.Split(str, @"\s+");
            sensitiveWord = new HashSet <string>(words);
            MakeSensitiveWordMap();

            //a new task
            string      raw     = Console.ReadLine();
            WordHandler handler = new WordHandler(raw);

            Console.WriteLine("\nafter processed:\n");
            handler.ChangeSensitiveWords();
            Console.WriteLine(handler.newStr);


            Console.ReadKey();
        }