code: private int getState(int currentState, char character)
      {
          int newCurrentState = transitionWithRoot(currentState, character);  // 先按success跳转
          while (newCurrentState == -1) // 跳转失败的话，按failure跳转
          {
              currentState = fail[currentState];
              newCurrentState = transitionWithRoot(currentState, character);
          }
          return newCurrentState;
      }
docs: 转移状态，支持failure转移
  
  @param currentState
  @param character
  @return