docs: static <INN extends CoreMap & HasWord> void mergeTwoDocumentsByLongestSequence(
  			List<INN> mainDocument, 
  			List<INN> auxDocument, 
  			Set<String> auxLabels, 
  			String background ) {
  		
  		class Sequence {
  			String type;
  			int start;
  			int len;
  			Sequence (String type, int start, int len) {
  				this.type = type;
  				this.start = start;
  				this.len = len;
  			}
  			public String toString() {
  				return String.format("%s:%d:%d", type, start, len);
  			}
  		}
  		
  		List<Sequence> mainSeq = new ArrayList<>();
  		List<Sequence> auxSeq = new ArrayList<>();
  		
  		String prevAnswer = "O";
  		int len = 0;
  		int id = -1;
  		for (INN l : mainDocument) {
  			id++;
  			String answer = l.get(AnswerAnnotation.class);
  			if (!answer.equals(prevAnswer)) {
  				if (!prevAnswer.equals(background)) {
  					mainSeq.add(new Sequence(prevAnswer, id-len, len));
  				}
  				if (!answer.equals(background)) {
  					len = 1;
  				}
  				prevAnswer = answer;
  			} else {
  				len++;
  			}			
  		}
  		if (!prevAnswer.equals(background)) mainSeq.add(new Sequence(prevAnswer, id-len+1, len));
  		
  		prevAnswer = "O";
  		len = 0;
  		id = -1;
  		for (INN l : auxDocument) {
  			id++;
  			String answer = l.get(AnswerAnnotation.class);
  			if (!answer.equals(prevAnswer)) {
  				if (!prevAnswer.equals(background)) {
  					auxSeq.add(new Sequence(prevAnswer, id-len, len));
  				}
  				if (!answer.equals(background)) {
  					len = 1;
  				}
  				prevAnswer = answer;
  			} else {
  				len++;
  			}			
  		}
  		if (!prevAnswer.equals(background)) auxSeq.add(new Sequence(prevAnswer, id-len+1, len));
  		
  		List<Sequence> resSeq = new ArrayList<>();
  		Iterator<Sequence> mainSeqIt = mainSeq.iterator();
  		Iterator<Sequence> auxSeqIt = auxSeq.iterator();
  		Sequence main = null, aux = null, s = null;
  		id = -1;
  		if (mainSeqIt.hasNext()) main = mainSeqIt.next();
  		if (auxSeqIt.hasNext()) aux = auxSeqIt.next();
  		while(main != null || aux != null) {
  			while (main != null && main.start < id) {
  				if (mainSeqIt.hasNext()) main = mainSeqIt.next();
  				else main = null;
  			}
  			
  			while (aux != null && aux.start < id) {
  				if (auxSeqIt.hasNext()) aux = auxSeqIt.next();
  				else aux = null;
  			}
  			
  			s = main;
  			if (s == null 
  					|| aux != null && (aux.start + aux.len - 1 < s.start
  							|| s.len < aux.len
  							&& (aux.start >= s.start && aux.start < s.start + s.len || s.start >= aux.start && s.start < aux.start + aux.len))) {
  				s = aux;
  			}
  			if (s != null) {
  				resSeq.add(s);
  				id = s.start + s.len;
  			}
  		}
  		
  //		for (Sequence seq: mainSeq) System.err.print(seq + " ");
  //		System.err.println();
  //		for (Sequence seq: auxSeq) System.err.print(seq + " ");
  //		System.err.println();
  //		for (Sequence seq: resSeq) System.err.print(seq + " ");
  //		System.err.println();
  //		for (Sequence seq: resSeq) {
  //			for (int i = seq.start; i < seq.start + seq.len; i++) {
  //				System.err.printf("%s[%s/%s] ", mainDocument.get(i).word(), mainDocument.get(i).get(AnswerAnnotation.class), auxDocument.get(i).get(AnswerAnnotation.class));
  //			}
  //		}		
  		for (INN l : mainDocument) l.set(AnswerAnnotation.class, background);
  		for (Sequence seq : resSeq) {
  			for (int i = seq.start; i < seq.start + seq.len; i++) {
  				mainDocument.get(i).set(AnswerAnnotation.class, seq.type);
  			}
  		}
  	}