From d0e3c30ea6c2e0cd86cb4b5d8f93fad18bbe4d1c Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Tue, 5 Dec 2023 14:01:11 +0100 Subject: [PATCH] remove phrasetable_lookup_epsilons which is no longer in use --- src/runtime/c/pgf/phrasetable.cxx | 50 ------------------------------- src/runtime/c/pgf/phrasetable.h | 5 ---- 2 files changed, 55 deletions(-) diff --git a/src/runtime/c/pgf/phrasetable.cxx b/src/runtime/c/pgf/phrasetable.cxx index e4c6dc866..ade41844a 100644 --- a/src/runtime/c/pgf/phrasetable.cxx +++ b/src/runtime/c/pgf/phrasetable.cxx @@ -817,56 +817,6 @@ void phrasetable_lookup_cohorts(PgfPhrasetable table, } } -PGF_INTERNAL -void phrasetable_lookup_epsilons(PgfPhrasetable table, - ref lincat, size_t r, - std::function,size_t)> &f) -{ - while (table->left != 0) { - table = table->left; - } - - if (table->value.seq->syms.len > 0) - return; - - size_t len = (table->value.backrefs != 0) - ? table->value.backrefs->len - : 0; - - ssize_t i = 0; - ssize_t j = len-1; - while (i <= j) { - ssize_t k = (i + j) / 2; - ref backref = vector_elem(table->value.backrefs, k); - - int cmp = backref_cmp(backref, lincat, r); - if (cmp < 0) { - j = k-1; - } else if (cmp > 0) { - i = k+1; - } else { - i = k; - while (i > 0) { - ref backref = vector_elem(table->value.backrefs, i-1); - if (backref_cmp(backref, lincat, r) != 0) - break; - f(ref::untagged(backref->container),backref->seq_index); - i--; - } - f(ref::untagged(backref->container),backref->seq_index); - j = k; - while (j < len-1) { - ref backref = vector_elem(table->value.backrefs, j+1); - if (backref_cmp(backref, lincat, r) != 0) - break; - f(ref::untagged(backref->container),backref->seq_index); - j++; - } - break; - } - } -} - PGF_INTERNAL void phrasetable_iter(PgfConcr *concr, PgfPhrasetable table, diff --git a/src/runtime/c/pgf/phrasetable.h b/src/runtime/c/pgf/phrasetable.h index 2d8abc8cd..6d4236df9 100644 --- a/src/runtime/c/pgf/phrasetable.h +++ b/src/runtime/c/pgf/phrasetable.h @@ -105,11 +105,6 @@ void phrasetable_lookup_cohorts(PgfPhrasetable table, bool case_sensitive, PgfPhraseScanner *scanner, PgfExn* err); -PGF_INTERNAL_DECL -void phrasetable_lookup_epsilons(PgfPhrasetable table, - ref lincat, size_t r, - std::function, size_t)> &f); - PGF_INTERNAL_DECL void phrasetable_iter(PgfConcr *concr, PgfPhrasetable table,