if (positions[j] != null && positions[j].length > 0) {
withPositions = true;
}
j++;
}
v = new SegmentTermPositionVector(v.getField(), newTerms, newFreqs,
withPositions ? positions : null,
withOffsets ? offsets : null);
} else {
v = new SegmentTermVector(v.getField(), newTerms, newFreqs);
}