I have a string containing words that i need to match like the one below, it is constant and the other string that can be changed may contain words from this string ‘s’.
string s = "run fun play game do work click type";
string g = "he will be running. He is playing a game by clicking the mouse";
I want to be be able to match these words and make them bold in a windows form application text box. Like run and Running match so running will be turned bold and so on. :-/ any ideas??
What I would do is use a stemmer (such as the Porter stemmer), split the strings using a split(‘ ‘) and go through each. Compare the stemmed version of both words and then bold the ones which match.
On the porter stemmer including source code:
http://tartarus.org/martin/PorterStemmer/