Findings string segments in a string
<p>I have a list of segments (15000+ segments), I want to find out the occurence of segments in a given string. The segment can be single word or multiword, I can not assume space as a delimeter in string.</p>

<p>e.g. 
String "How can I download codec from internet for facebook, Professional programmer support" </p>

<p>[the string above may not make any sense but I am using it for illustration purpose]</p>

<h2>segment list</h2>

<ul>
<li>Microsoft word</li>
<li>Microsoft excel</li>
<li>Professional Programmer.</li>
<li>Google</li>
<li>Facebook</li>
<li>Download codec from internet.</li>
</ul>

<h2>Ouptut :</h2>

<ul>
<li>Download codec from internet</li>
<li>facebook</li>
<li>Professional programmer</li>
</ul>

<p>Bascially i am trying to do a query reduction.</p>

<p>I want to achieve it less than O(list length + string length) time.
As my list is more than 15000  segments, it will be time consuming to search entire list in string.
The segments are prepared manully and placed in a txt file.</p>

<p>Regards</p>

<p>~Paul</p>
