From ff5cb5327d8a68adc05d4f125aaa93ddbccb099e Mon Sep 17 00:00:00 2001 From: jixiaoxu Date: Thu, 1 Dec 2022 13:51:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=B1=89=E5=AD=97=E8=BD=AC?= =?UTF-8?q?=E6=8B=BC=E9=9F=B3=E6=8E=A5=E5=8F=A3=E9=80=BB=E8=BE=91=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libsearch/file-utils.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libsearch/file-utils.cpp b/libsearch/file-utils.cpp index cc6d4c6..89ccb03 100644 --- a/libsearch/file-utils.cpp +++ b/libsearch/file-utils.cpp @@ -477,9 +477,16 @@ void stitchMultiToneWordsBFSStackLess3(const QString &hanzi, QStringList &result } QStringList FileUtils::findMultiToneWords(const QString &hanzi) { - QStringList output; - stitchMultiToneWordsBFSStackLess3(hanzi, output); - return output; + QStringList output, results; + //stitchMultiToneWordsBFSStackLess3(hanzi, output); + HanZiToPinYin::getInstance()->getResults(hanzi.toStdString(), results); + QString oneResult(results.join("")); + QString firstLetter; + for (QString & info : results) { + if (!info.isEmpty()) + firstLetter += info.at(0); + } + return output << oneResult << firstLetter; } /**