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.
e.g. String "How can I download codec from internet for facebook, Professional programmer support"
[the string above may not make any sense but I am using it for illustration purpose]
segment list
- Microsoft word
- Microsoft excel
- Professional Programmer.
- Download codec from internet.
Ouptut :
- Download codec from internet
- Professional programmer
Bascially i am trying to do a query reduction.
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.
Regards
~Paul