I have a string array of stopWords and string array of input texts i.e.
string[] stopWords = File.ReadAllLines(@"C:\stopWords.txt");
and
con.Open();
SqlCommand query = con.CreateCommand();
query.CommandText = "select p_abstract from aminer_paper where pid between 1 and 500 and DATALENGTH(p_abstract) != 0";
SqlDataReader reader = query.ExecuteReader();
var summary = new List<string>();
while(reader.Read())
{
summary.Add(reader["p_abstract"].ToString());
}
reader.Close();
string[] input_Texts = summary.ToArray();
Now, I have to use these stopWords array to remove from input_Texts array. I have used following technique but not working, weird while accessing both arrays index. For example, take first text at index 0 of input_Texts array i.e.
input_Texts[0]
and then match all the word strings in stopWords array i.e.
// have to match all the indexes of stopWords[] with input_Texts[0]
stopWords[]
then after removing all the stopWords
from index 0 text of input_Texts
array, have to repeat it for all the texts in input_Texts array.
Any suggestions and code samples with modifications will be highly appreciated with acknowledgment.
Thanks.
You can use Linq to do this