【发布时间】:2015-09-11 19:42:48
【问题描述】:
我在创建从字符串中删除停用词的代码时遇到问题。这是我的代码:
String Review="The portfolio is fine except for the fact that the last movement of sonata #6 is missing. What should one expect?";
string[] arrStopword = new string[] {"a", "i", "it", "am", "at", "on", "in", "to", "too", "very","of", "from", "here", "even", "the", "but", "and", "is","my","them", "then", "this", "that", "than", "though", "so", "are"};
StringBuilder sbReview = new StringBuilder(Review);
foreach (string word in arrStopword){
sbReview.Replace(word, "");}
Label1.Text = sbReview.ToString();
运行时Label1.Text = "The portfolo s fne except for fct tht lst movement st #6 s mssng. Wht should e expect? "
我希望它必须返回"portofolio fine except for fact last movement sonata #6 is missing. what should one expect?"
有人知道怎么解决吗?
【问题讨论】:
标签: c# asp.net stop-words