code: @SuppressWarnings("unchecked")
      public Collection<Emit> parseText(String text)
      {
          checkForConstructedFailureStates();
  
          int position = 0;
          State currentState = this.rootState;
          List<Emit> collectedEmits = new ArrayList<Emit>();
          for (int i = 0; i < text.length(); ++i)
          {
              currentState = getState(currentState, text.charAt(i));
              storeEmits(position, currentState, collectedEmits);
              ++position;
          }
  
          if (!trieConfig.isAllowOverlaps())
          {
              IntervalTree intervalTree = new IntervalTree((List<Intervalable>) (List<?>) collectedEmits);
              intervalTree.removeOverlaps((List<Intervalable>) (List<?>) collectedEmits);
          }
  
          if (trieConfig.remainLongest)
          {
              remainLongest(collectedEmits);
          }
  
          return collectedEmits;
      }
docs: 模式匹配
  
  @param text 待匹配的文本
  @return 匹配到的模式串