title: When do we actually use a Trie?
body: <p>I am starting to read about Trie. I got also references from friends here in: <a href="https://stackoverflow.com/questions/10684646/looking-for-a-good-introduction-on-trie/10685469#comment13868291_10685469">Tutorials on Trie</a>   </p>
  
  <p>I am not clear on the following:<br>
  It seems that to go on and use a Trie one assumes that all the input strings that will be the search space and used to build the Trie are separated in <em>distinct word boundaries</em>.<br>
  E.g. all the example tutorials I have seen use input such as:  </p>
  
  <pre><code>S={ball, bid, byte, car, cat, mac, map etc...}
  </code></pre>
  
  <p>Then we build the trie from <code>S</code> and do our searches (really fast)<br>
  My question is: How did we end up with <code>S</code> to begin with?<br>
  I mean before starting to read about tries I imagined that <code>S</code> would be an arbitrarily long text e.g. A <code>Shakespeare</code> passage. </p>
  
  <p>Then using a Trie we could find things really fast.<br>
  But it seems this is not the case.  </p>
  
  <p>Is the assumption here that the input passage (of <code>Shakespeare</code> for example) is pre-processed first extracting all the words to get <code>S</code>? </p>
  
  <p>So if one wants to search for patterns (same way as you do when you Google and see all pages having also spaces in your search query) a Trie is not appropriate?<br>
  When can we know if a Trie is the data structure that we can actually use?  </p>