When I select a start index that is outside the text boundaries, instead of
adding out of bounds values (OOBs), it throws an exception.
Can be reproduced using the the "CleartkExtractorTest" basicTest method.
E.g. by using
new Preceding(5, 6),
or
new Following(5, 6));
in
CleartkExtractor extractor = new CleartkExtractor(
Token.class,
new CoveredTextExtractor(),
new Preceding(2),
new Preceding(3, 6),
new Covered(),
new FirstCovered(1),
new FirstCovered(1, 3),
new LastCovered(1),
new LastCovered(1, 3),
new Following(1, 3),
new Following(3, 5));
Exception:
java.lang.IllegalArgumentException: fromIndex(5) > toIndex(4)
at java.util.SubList.<init>(AbstractList.java:604)
at java.util.AbstractList.subList(AbstractList.java:468)
at org.cleartk.classifier.feature.extractor.CleartkExtractor$LeftToRightContext.extract(CleartkExtractor.java:374)
at
org.cleartk.classifier.feature.extractor.CleartkExtractor$Following.extract(CleartkExtractor.java:1)
at
org.cleartk.classifier.feature.extractor.CleartkExtractor.extract(CleartkExtracto.java:128)
at
org.cleartk.classifier.feature.extractor.CleartkExtractor.extract(CleartkExtractor.java:92)
at
org.cleartk.classifier.feature.extractor.CleartkExtractorTest.testBasic2(CleartkExtractorTest.java:131)
Original issue reported on code.google.com by torsten....@gmail.com on 16 Aug 2012 at 2:58
Original issue reported on code.google.com by
torsten....@gmail.com
on 16 Aug 2012 at 2:58