code: private void getMultiWordSpans(final String[] tokens, final List<WF> wfs,
        final List<ixa.kaflib.Span<WF>> tokenSpans) {
      final Span[] multiWordSpans = this.multiWordMatcher
          .multiWordsToSpans(tokens);
      int counter = 0;
      for (final Span mwSpan : multiWordSpans) {
        final Integer fromIndex = mwSpan.getStart() - counter;
        final Integer toIndex = mwSpan.getEnd() - counter;
        // add to the counter the length of the span removed
        counter = counter + tokenSpans.subList(fromIndex, toIndex).size() - 1;
        // create multiword targets and Span
        final List<WF> wfTargets = wfs
            .subList(mwSpan.getStart(), mwSpan.getEnd());
        final ixa.kaflib.Span<WF> multiWordSpan = KAFDocument
            .newWFSpan(wfTargets);
        // remove the token Spans to be replaced by the multiword span
        tokenSpans.subList(fromIndex, toIndex).clear();
        // add the new Span containing several WFs (multiWordSpan)
        // the counter is used to allow matching the spans to the
        // tokenSpans list indexes
        tokenSpans.add(fromIndex, multiWordSpan);
      }
    }
docs: Creates the multiword spans. It gets an initial list of spans (one per
  token) and creates a multiword span when a multiword is detected.
  
  @param tokens
  the list of tokens
  @param wfs
  the list of WFs
  @param tokenSpans
  the list of initial token spans