mirror of https://github.com/apache/lucene.git
fix syn test bug
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1228704 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e855df6879
commit
defd51a11b
|
@ -260,9 +260,16 @@ public class TestSynonymMapFilter extends BaseTokenStreamTestCase {
|
|||
} else {
|
||||
outputs[matchIDX] = outputs[matchIDX] + "/" + synOutputs[synUpto++];
|
||||
}
|
||||
if (synOutputs.length == 1) {
|
||||
// Add endOffset
|
||||
outputs[matchIDX] = outputs[matchIDX] + ":" + ((inputIDX*2) + syn.in.length());
|
||||
final int endOffset;
|
||||
if (matchIDX < numInputs) {
|
||||
if (synOutputs.length == 1) {
|
||||
// Add full endOffset
|
||||
endOffset = (inputIDX*2) + syn.in.length();
|
||||
} else {
|
||||
// Add endOffset matching input token's
|
||||
endOffset = (matchIDX*2) + 1;
|
||||
}
|
||||
outputs[matchIDX] = outputs[matchIDX] + ":" + endOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue