Javascript: Using dictionary to filter out words from a string?
<p>I need to filter out several hundred "stop" words from a string. As there are many "stop" words I don't think it would be a good idea to do something like this:</p>

<pre><code>sentence.replace(/\b(?:the|it is|we all|an?|by|to|you|[mh]e|she|they|we...)\b/ig, '');
</code></pre>

<p>How can i create something like a hash map to store stop words? In this map a key will be a stop word itself and value is not important. Then filtering will result in checking if the word is not present in stop words map. What data structure to use to build such a map?</p>
