1
0
forked from GitHub/gf-core

bugfix for unknown words

This commit is contained in:
kr.angelov
2014-12-08 19:38:03 +00:00
parent 676b0d6e81
commit 386ec87405

View File

@@ -11,7 +11,8 @@ public class UnknownLiteralCallback implements LiteralCallback {
}
public CallbackResult match(int lin_idx, String sentence, int offset) {
if (!Character.isUpperCase(sentence.charAt(offset))) {
if (offset < sentence.length() &&
!Character.isUpperCase(sentence.charAt(offset))) {
int start_offset = offset;
while (offset < sentence.length() &&
!Character.isWhitespace(sentence.charAt(offset))) {