Skip to content

Commit

Permalink
Avoid crash in section code.
Browse files Browse the repository at this point in the history
  • Loading branch information
linas committed Mar 10, 2023
1 parent 40fad89 commit 0388d78
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions link-grammar/dict-atomese/lookup-atomese.cc
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ thread_local HandleSeq sent_words;
void as_start_lookup(Dictionary dict, Sentence sent)
{
Local* local = (Local*) (dict->as_server);
sentlo = sent;

lgdebug(D_USER_INFO, "Atomese: Start dictionary lookup for >>%s<<\n",
sent->orig_sentence);
Expand All @@ -489,7 +490,6 @@ void as_start_lookup(Dictionary dict, Sentence sent)
// if (0 < local->pair_disjuncts or 0 < local->extra_pairs)
if (0 < local->pair_disjuncts)
{
sentlo = sent;
for(size_t i=0; i<sent->length; i++)
{
const char* wstr = sent->word[i].unsplit_word;
Expand Down Expand Up @@ -519,12 +519,12 @@ void as_start_lookup(Dictionary dict, Sentence sent)
void as_end_lookup(Dictionary dict, Sentence sent)
{
Local* local = (Local*) (dict->as_server);
sentlo = nullptr;

// XXX FIXME Someday handle extra_pairs, too.
// if (0 < local->pair_disjuncts or 0 < local->extra_pairs)
if (0 < local->pair_disjuncts)
{
sentlo = nullptr;
sent_words.clear();
}

lgdebug(D_USER_INFO, "Atomese: Finish dictionary lookup for >>%s<<\n",
sent->orig_sentence);
Expand Down

0 comments on commit 0388d78

Please sign in to comment.