// Lazily initialise the segmenter from the text / string when the
// client code tries to dissect the text into the first shard.
if (segmenter == null) {
DissectableString string = document.getDissectableString(text);
segmenter = new StringSegmenter(stringDissector, string);
}
// Handle the fact that when we first get called we haven't been
// placed in a shard at all. Seems ugly that we have to do this...
int segmentIndex = 0;