Search a string for a list of words I have  a large number of long strings, and I need to search them for a given list of words  as fast as reasonably possible. (Neither the strings nor the words are constants)
I learned that I can preprocess the strings that I'm going to be searching for my words by building a suffix array and  an lcp array, and that I should be able to make the searches faster by doing so.
I was wondering, however, if I could preprocess the wordlist in some way as well. It is quite possible that the words will have common parts. I would like to build something like a "word genealogy tree" (or another structure that would achieve the same effect ) where the  substring that can be found in a family of words would be at the top and which would then branch down (for both the prefixes and the suffixes of the ancestor) as the descendants would go. 
I imagine that this would allow me to discard whole branches or trees quickly if an ancestral node failed to match.
Could you please direct me to a suitable strategy that would help me achieve my goal (in this or any other reasonably efficient way)?
Note: I can't really make use of much existing code (can make use of ideas, though). I'm pretty much limited to the standard c library.
Searching in a string that changes often, and looking for a set of words, I would use Aho-Corasick, an extension of KMP that builds a tree (based on the set of words) and looks for the words in parallel.