From 99d9d67ba033e1ebe1f2dcb6f1c318cfa22648c9 Mon Sep 17 00:00:00 2001 From: danemadsen Date: Mon, 5 Aug 2024 15:30:17 +1000 Subject: [PATCH] correct word cleaner --- src/cleaners.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cleaners.cpp b/src/cleaners.cpp index 0025346..2609477 100644 --- a/src/cleaners.cpp +++ b/src/cleaners.cpp @@ -153,8 +153,10 @@ namespace DeepPhonemizer { result.insert(result.end(), words.begin(), words.end()); - if (i > 0 && i < suffixes.size()) { - result.push_back(suffixes[i - 1]); + if (i < suffixes.size() && i < parts.size() - 1) { + int suffix = parts.size() - i - 2; + + result.push_back(suffixes[suffix]); } }