For search terms that could be ambiguous (i.e. valid Jyutping and English), or valid Jyutping and Pinyin, etc.), first check for whether there are any terms that match the first detected script. If there are none, skip to the next, and finally fall through to English.
Examples:
mango could be parsed as man[1-6] go[1-6] in Jyutping, but there are no results. It's not valid Pinyin, so we search for English.
wangdi could be parsed as wang[1-6] di[1-6] in Jyutping, but there are no results. It is valid Pinyin, and there are results, so we interpret this as a search for Pinyin.
Type of change
[x] Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
[x] macOS
Test Configuration: Tested as described in #143.
OS and version: macOS 14.1 Sonoma
Toolchain: Xcode 15 clang/clang++
Qt Version: Qt 5.15.12
Checklist:
[x] My code follows the style guidelines of this project (black for Python
code, .clang-format in the src/jyut-dict directory for C++)
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
Description
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
Test Configuration: Tested as described in #143.
Checklist:
black
for Python code,.clang-format
in thesrc/jyut-dict
directory for C++)