textPositions.add(sbPos);
}
List<Expression> result = Lists.newArrayList();
SpaceOperator interiorSpaceOperator =
spaceOperators.getInteriorSpaceOperator();
SpaceOperator exteriorSpaceOperator =
spaceOperators.getExteriorSpaceOperator();
int textSegmentCount = textSegments.size();
if (textSegmentCount > 0) {
// pull off leading spaces
Matcher m = LEADING_SPACES.matcher(textSegments.get(0));
String leadingSpaces = "";
if (m.matches()) {
leadingSpaces = exteriorSpaceOperator.apply(m.group(1));
textSegments.set(0, m.group(2));
}
// pull off trailing spaces
m = TRAILING_SPACES.matcher(textSegments.get(textSegmentCount - 1));
String trailingSpaces = "";
if (m.matches()) {
trailingSpaces = exteriorSpaceOperator.apply(m.group(2));
textSegments.set(textSegmentCount - 1, m.group(1));
}
// process interior spaces
for (int i = 0; i < textSegmentCount; i++) {