From 46f8f31cc99eab50a2404ec427ac84505d5fa19c Mon Sep 17 00:00:00 2001 From: Ko van der Sloot Date: Fri, 7 Oct 2022 16:24:31 +0200 Subject: [PATCH] attempted fix for https://github.com/LanguageMachines/libfolia/issues/49. Uses new select_set() function --- src/folia_impl.cxx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/folia_impl.cxx b/src/folia_impl.cxx index 24479ca..a5128ab 100644 --- a/src/folia_impl.cxx +++ b/src/folia_impl.cxx @@ -2298,9 +2298,17 @@ namespace folia { cerr << "no space? s: " << s << endl; } if ( s ){ - vector words = s->select(false); - if ( !words.empty() ){ - Word *last = words.back(); + set wanted = {Word_t,Correction_t}; + set excl; + vector elts = s->select_set( wanted, + "", + excl, + SELECT_FLAGS::LOCAL ); + if ( !elts.empty() ){ + if ( debug ){ + cerr << "found some mixed stuff: " << elts << endl; + } + FoliaElement *last = elts.back(); if ( debug ){ cerr << "no space? last: " << last << endl; }