I have a linq list with "impportent words"
which holds sentences and single words.
I need to find if there is any word or sentences from importent_words which is found in "sentence_to_search_for_importent_word"
At last the result should end up in a array or something.
here is what i done until know..
List<string> importent_words = new List<string>() {"age", "what is", ".", "pages"}
string sentence_to_search_for_importent_words = "what is your age.";
I need to find the importent_words
in a sentence and get all the matches outputted to a list
I try this but it does not really do the job
var pattern = new Regex(@"\w+");
var qa = pattern.Split(first_sentence.ToLower()).Where(w => importent_words.Contains(w));
It have to return "age" not "ages" also it should find "what is" not only "what"
With \w
it seems to find age but it only output "this"
instead of "this is"
It seems like the problem is that "this is" is more than one word.