From 652e270a14e27c073395b3b409d6ece5f56892fc Mon Sep 17 00:00:00 2001 From: zty012 <2449637813@qq.com> Date: Wed, 8 Apr 2026 14:03:13 +0800 Subject: [PATCH] docs(ime_pinyin): refine pinyin dictionary instructions (#9925) Co-authored-by: VIFEX <1290176185@qq.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docs/src/widgets/ime_pinyin.rst | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/src/widgets/ime_pinyin.rst b/docs/src/widgets/ime_pinyin.rst index b6a6f14832..8a6d394004 100644 --- a/docs/src/widgets/ime_pinyin.rst +++ b/docs/src/widgets/ime_pinyin.rst @@ -31,10 +31,10 @@ dictionary. If you don't want to use the built-in dictionary, you can disable :c:macro:`LV_IME_PINYIN_USE_DEFAULT_DICT` in ``lv_conf.h``, which can save a lot of memory space. -The built-in thesaurus is customized based on the -**LV_FONT_SOURCE_HAN_SANS_SC_16_CJK** font library, which currently has more -than 1,000 of the most common CJK radicals, so it is recommended to use a -custom font and thesaurus. +The built-in dictionary is customized based on the characters in the +**LV_FONT_SOURCE_HAN_SANS_SC_16_CJK** font library, which currently has only +1,000 of the most common CJK radicals, so it is recommended to use a custom font +and a custom dictionary. In the process of using the Pinyin input method plug-in, you can change the Keyboard and dictionary at any time. @@ -58,7 +58,7 @@ Dictionary format ----------------- The arrangement order of each pinyin syllable is very important. If you -need to customize your own thesaurus according to the Hanyu Pinyin +need to customize your own dictionary according to the Hanyu Pinyin syllable table, you can read `here `__ to learn about the Hanyu Pinyin syllables and the syllable table. @@ -67,7 +67,7 @@ Then, write your own dictionary according to the following format: .. code-block:: c - lv_100ask_pinyin_dict_t your_pinyin_dict[] = { + lv_pinyin_dict_t your_pinyin_dict[] = { { "a", "啊阿呵吖" }, { "ai", "埃挨哎唉哀皑蔼矮碍爱隘癌艾" }, { "an", "按安暗岸俺案鞍氨胺厂广庵揞犴铵桉谙鹌埯黯" }, @@ -78,14 +78,15 @@ Then, write your own dictionary according to the following format: /* ...... */ { "zuo", "昨左佐做作坐座撮琢柞"}, {NULL, NULL} + }; -**The last item** must be ``{null, null}``, or it will not work +**The last item** must be ``{NULL, NULL}``, or it will not work properly. .. _ime_pinyin_apply_new_dictionary: -Applying a new dictionary +Using a custom dictionary ------------------------- After writing a dictionary according to the above dictionary format, you @@ -93,8 +94,8 @@ only need to call this function to set up and use your dictionary: .. code-block:: c - lv_obj_t * pinyin_ime = lv_100ask_pinyin_ime_create(lv_screen_active()); - lv_100ask_pinyin_ime_set_dict(pinyin_ime, your_pinyin_dict); + lv_obj_t * pinyin_ime = lv_ime_pinyin_create(lv_screen_active()); + lv_ime_pinyin_set_dict(pinyin_ime, your_pinyin_dict);