title: Find exact word in a sentence using Java
body: <p>I am writing a code to spot country names in the text. I am using a dictionary with names of countries say <code>India, America, Sri Lanka, ...</code>. I am currently using <code>text.contains(key)</code> with <code>key</code> from the dictionary. However, this returns true even for a string like <code>Indiana</code>. I tried putting the words of the sentence in an array and then doing the contains, similar approach can be considered with equals but they are really slow. Is there any other faster way you could think of?</p>