using System;
using System.Collections.Generic;
using System.Linq;
class WordFilter
{
static HashSet<string> wordBank = new HashSet<string> {
"THE MARATHON (CLOTHING)", "AIR TRAINER MAX", "NIKE AIR VAPORMAX",
"AIR JORDAN", "THERMA-FIT", "TECHKNIT", "Grumpy Cat", "Tommy Hilfiger",
"BIGFOOT", "Lululemon", "Oakley", "Simple Modern", "Casio", "KZKR",
"Dry Fit", "CREE LED", "CORTEZ", "air flight", "vapormax", "SWOOSH",
"just do it", "MERCURIAL", "AIR MAX", "emoji", "emojis", "SoClean",
"Emoji", "Rubik'S Cube", "hula hoop", "Hugo Boss", "Hallmark", "frisbee",
"Smiley", "lebron", "FLYKNIT", "dunk", "dri fit", "AIR FORCE 1", "PRESTO",
"DRI-FIT", "Missmile", "Moda europea", "Comfortable To Wear", "Other Colors",
"Christmas Gift", "Perfect Birthday Gift", "exquisite gift", "latest design",
"different colors", "all colors", "various colors", "verschiedene stile",
"as the picture show", "cadeau idéal", "weihnachtsgeschenk", "ideales geschenk",
"kundenspezifisch", "neuer herbst", "einfach zu installieren", "Hot-selling",
"Newest Fashion", "Different Styles", "Perfect Christmas Gift", "Best Selling",
"Perfect Gift", "Fathers Day Gifts", "New Design", "New Release", "New Arrive",
"New Autumn", "Baby Shower Gift", "New Product", "Superior Quality", "New Arrivals",
"Elegante Mode", "Beste Geschenke", "Halloween Geschenk", "perfektes Geschenk",
"New Trendy", "neuer Stil", "New Color", "Halloween Gift", "Mother Day Gifts",
"as picture", "Cool Gift", "CURVEEZ", "Anniversary Gift", "Holiday Gift",
"Top Gift", "Cool Fashion", "Cute Gift", "High-Quality", "high-quality",
"Anniversary Gifts", "Neue", "New High", "Elegant Fashion", "New Stylish",
"UGG", "Gucci", "avamo"
};
static void Main()
{
Console.WriteLine("请输入内容(输入 'quit' 退出):");
while (true)
{
string input = Console.ReadLine();
if (input.ToLower() == "quit") break;
var result = FilterWords(input);
string filtered = result.Item1;
List<string> removedWords = result.Item2;
Console.WriteLine("过滤后的内容:" + filtered);
if (removedWords.Count > 0)
{
Console.WriteLine("删除的词:" + string.Join(", ", removedWords));
}
else
{
Console.WriteLine("未删除任何词。");
}
}
}
static Tuple<string, List<string>> FilterWords(string input)
{
List<string> removedWords = new List<string>();
foreach (string word in wordBank.OrderByDescending(w => w.Length))
{
if (input.Contains(word))
{
removedWords.Add(word);
input = input.Replace(word, "");
}
}
string finalInput = string.Join(" ", input.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries));
return Tuple.Create(finalInput, removedWords);
}
}