code: public int[] findLongest(CharSequence query, int start)
      {
          if ((query == null) || (start >= query.length()))
          {
              return new int[]{0, -1};
          }
          int state = 1;
          int maxLength = 0;
          int lastVal = -1;
          for (int i = start; i < query.length(); i++)
          {
              int[] res = transferValues(state, query.charAt(i));
              if (res[0] == -1)
              {
                  break;
              }
              state = res[0];
              if (res[1] != -1)
              {
                  maxLength = i - start + 1;
                  lastVal = res[1];
              }
          }
          return new int[]{maxLength, lastVal};
      }
docs: 最长查询
  
  @param query
  @param start
  @return (最长长度，对应的值)