1
0
forked from GitHub/gf-core

bugfix in the bottom-up prediction for the parser

This commit is contained in:
krasimir
2015-06-25 09:46:43 +00:00
parent b912b12143
commit 51c13f7aac

View File

@@ -1105,7 +1105,9 @@ pgf_parsing_lookahead(PgfParsing *ps, PgfParseState* state,
if (seq->idx != NULL) { if (seq->idx != NULL) {
PgfLexiconIdxEntry* entry = gu_buf_extend(state->lexicon_idx); PgfLexiconIdxEntry* entry = gu_buf_extend(state->lexicon_idx);
entry->idx = seq->idx; entry->idx = seq->idx;
entry->offset = (current - ps->sentence); entry->offset =
(gu_seq_length(seq->syms) == 0) ? state->start_offset
: (size_t) (current - ps->sentence);
} }
if (len+1 <= max) if (len+1 <= max)