title: Ahocorasick search tree return index out of bound
body: <p>I used the python package ahocorasick(<a href="https://hkn.eecs.berkeley.edu/~dyoo/python/ahocorasick/" rel="nofollow">https://hkn.eecs.berkeley.edu/~dyoo/python/ahocorasick/</a>) for text matching for the state name here:</p>
  
  <pre><code>import ahocorasick
  states = {
      'AK': 'Alaska',
      'AL': 'Alabama',
      'AR': 'Arkansas',
      'AS': 'American Samoa',
      'AZ': 'Arizona',
      'CA': 'California',
      'CO': 'Colorado',
      'CT': 'Connecticut'
  }
  
  def LoadKeywords(keywords):
      #Keyword should be a list
      tree = ahocorasick.KeywordTree()
      for k in keywords:
          tree.add(k)
      tree.make()
      return tree
  
  keywordLong = states.values();
  keywordLongTree = LoadKeywords(keywordLong);
  </code></pre>
  
  <p>Then I try to do search</p>
  
  <pre><code>keywordLongTree.search("Alabama")
  </code></pre>
  
  <p>it returns </p>
  
  <pre><code>(0, 7)
  </code></pre>
  
  <p>Which is fine and legitimate, but when I do</p>
  
  <pre><code>keywordLongTree.search("I don't know why this happen")
  </code></pre>
  
  <p>it should returns a NONE object but it returns:</p>
  
  <pre><code>(145331, 145335)
  </code></pre>
  
  <p>Has someone faces this situation before? why this happen?</p>