code: @Override
      public boolean incrementToken() throws IOException {
          if (addSingleTerm && previousWord != null) {
              addSingleTerm = false;
              clearAttributes();
              termAtt.append(previousWord);
              return true;
  
          } else if (input.incrementToken()) {
              final String word = new String(termAtt.buffer(), 0, termAtt.length());
              if (word.isEmpty()) {
                  return true;
              }
              if (addSingleTerm) {
                  clearAttributes();
                  termAtt.append(word);
                  previousWord = word;
                  addSingleTerm = false;
              } else {
                  clearAttributes();
                  termAtt.append(previousWord).append(word);
                  previousWord = word;
                  addSingleTerm = true;
              }
              return true;
          }
          return false;
      }
docs: Increments the underlying TokenStream and sets CharTermAttributes to
  construct an expanded set of tokens by concatenating tokens with the
  previous token.
  
  @return whether or not we have hit the end of the TokenStream
  @throws IOException is thrown when an IOException occurs