diff --git a/chewing-dict/dictionary.dat b/chewing-dict/dictionary.dat index f857ad65..655cbfa8 100644 Binary files a/chewing-dict/dictionary.dat and b/chewing-dict/dictionary.dat differ diff --git a/chewing-dict/index_tree.dat b/chewing-dict/index_tree.dat index 8dd9e8bc..455b1d2f 100644 Binary files a/chewing-dict/index_tree.dat and b/chewing-dict/index_tree.dat differ diff --git a/chewing-dict/symbols.dat b/chewing-dict/symbols.dat index fd14f5e7..b16f8639 100644 --- a/chewing-dict/symbols.dat +++ b/chewing-dict/symbols.dat @@ -1,11 +1,11 @@ … ※ -常用符號=,、。.?!;︰‧‥﹐﹒˙·‘’“”〝〞‵′〃~$%@&#* +常用符號=,、。.?!;:‧‥﹐﹒˙·‘’“”〝〞‵′〃~$%@&#* 左右括號=()「」〔〕{}〈〉『』《》【】﹙﹚﹝﹞﹛﹜ 上下括號=︵︶﹁﹂︹︺︷︸︿﹀﹃﹄︽︾︻︼ 希臘字母=αβγδεζηθικλμνξοπρστυφχψωΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ 數學符號=+-×÷=≠≒∞±√<>﹤﹥≦≧∩∪ˇ⊥∠∟⊿㏒㏑∫∮∵∴╳﹢ -特殊圖形=↑↓←→↖↗↙↘㊣◎○●⊕⊙○●△▲☆★◇◆□■▽▼§¥〒¢£※♀♂ +特殊圖形=↑↓←→↖↗↙↘㊣◎○●⊕⊙△▲☆★◇◆□■▽▼§¥〒¢£※♀♂ Unicode=♨☀☁☂☃♠♥♣♦♩♪♫♬☺☻ 單線框=├─┼┴┬┤┌┐╞═╪╡│▕└┘╭╮╰╯ 雙線框=╔╦╗╠═╬╣╓╥╖╒╤╕║╚╩╝╟╫╢╙╨╜╞╪╡╘╧╛ diff --git a/libchewing/arm64-v8a/include/chewing/chewing.h b/libchewing/arm64-v8a/include/chewing/chewing.h index 8faceb71..08dc23f7 100644 --- a/libchewing/arm64-v8a/include/chewing/chewing.h +++ b/libchewing/arm64-v8a/include/chewing/chewing.h @@ -44,8 +44,12 @@ extern "C" { * specific functionality. */ +#ifdef WITH_RUST +# include "chewing_rs.h" +#else +# include "global.h" +#endif #include "chewingio.h" -#include "global.h" #include "mod_aux.h" /* backward compatibility */ diff --git a/libchewing/arm64-v8a/include/chewing/chewingio.h b/libchewing/arm64-v8a/include/chewing/chewingio.h index b9e5455a..10e471db 100644 --- a/libchewing/arm64-v8a/include/chewing/chewingio.h +++ b/libchewing/arm64-v8a/include/chewing/chewingio.h @@ -22,7 +22,11 @@ * \author libchewing Core Team */ -#include "global.h" +#ifdef WITH_RUST +# include "chewing_rs.h" +#else +# include "global.h" +#endif #define KEYSTROKE_IGNORE 1 #define KEYSTROKE_COMMIT 2 @@ -498,6 +502,30 @@ CHEWING_API int chewing_get_phraseChoiceRearward(const ChewingContext *ctx); /*@}*/ +/*! \name Behavior of automatic learning after committing + */ + +/*@{*/ +/** + * @brief Set the behavior of automatic learning + * + * @param ctx + * @param mode AUTOLEARN_ENABLED or AUTOLEARN_DISABLED + */ +CHEWING_API void chewing_set_autoLearn(ChewingContext *ctx, int mode); + + +/** + * @brief Get the behavior of automatic learning + * + * @param ctx + * @return AUTOLEARN_ENABLED or AUTOLEARN_DISABLED + */ +CHEWING_API int chewing_get_autoLearn(const ChewingContext *ctx); + +/*@}*/ + + /*! \name Phonetic sequence in Chewing internal state machine */ @@ -552,6 +580,8 @@ CHEWING_API ChewingContext *chewing_new2(const char *syspath, void (*logger) (void *data, int level, const char *fmt, ...), void *loggerdata); +CHEWING_API int chewing_phone_to_bopomofo(unsigned short phone, char *buf, unsigned short len); + /* *INDENT-OFF* */ #endif /* _CHEWING_IO_H */ /* *INDENT-ON* */ diff --git a/libchewing/arm64-v8a/include/chewing/global.h b/libchewing/arm64-v8a/include/chewing/global.h index ac46483c..5f5bb283 100644 --- a/libchewing/arm64-v8a/include/chewing/global.h +++ b/libchewing/arm64-v8a/include/chewing/global.h @@ -26,6 +26,8 @@ #define SYMBOL_MODE 0 #define FULLSHAPE_MODE 1 #define HALFSHAPE_MODE 0 +#define AUTOLEARN_DISABLED 1 +#define AUTOLEARN_ENABLED 0 /* specified to Chewing API */ #if defined(_WIN32) || defined(_WIN64) || defined(_WIN32_WCE) @@ -73,30 +75,6 @@ # endif #endif -/* The following macros are modified from GLIB. - * from GNU cpp Manual: - * C99 introduces the _Pragma operator. This feature addresses a major problem - * with `#pragma': being a directive, it cannot be produced as the result of - * macro expansion. _Pragma is an operator, much like sizeof or defined, and - * can be embedded in a macro. - */ -#if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))) -# define BEGIN_IGNORE_DEPRECATIONS \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wdeprecated-declarations\"") -# define END_IGNORE_DEPRECATIONS \ - _Pragma ("GCC diagnostic pop") -#elif defined (_MSC_VER) && (_MSC_VER >= 1500) -# define BEGIN_IGNORE_DEPRECATIONS \ - __pragma (warning (push)) \ - __pragma (warning (disable : 4996)) -# define END_IGNORE_DEPRECATIONS \ - __pragma (warning (pop)) -#else -# define BEGIN_IGNORE_DEPRECATIONS -# define END_IGNORE_DEPRECATIONS -#endif - #define MIN_SELKEY 1 #define MAX_SELKEY 10 diff --git a/libchewing/arm64-v8a/include/chewing/mod_aux.h b/libchewing/arm64-v8a/include/chewing/mod_aux.h index 96aa244e..650c53d2 100644 --- a/libchewing/arm64-v8a/include/chewing/mod_aux.h +++ b/libchewing/arm64-v8a/include/chewing/mod_aux.h @@ -18,7 +18,11 @@ * \author libchewing Core Team */ -#include "global.h" +#ifdef WITH_RUST +# include "chewing_rs.h" +#else +# include "global.h" +#endif /** * @brief Chewing the state for input context during commit process diff --git a/libchewing/arm64-v8a/lib/libchewing.a b/libchewing/arm64-v8a/lib/libchewing.a index 5a45efca..f68f7471 100644 Binary files a/libchewing/arm64-v8a/lib/libchewing.a and b/libchewing/arm64-v8a/lib/libchewing.a differ diff --git a/libchewing/armeabi-v7a/include/chewing/chewing.h b/libchewing/armeabi-v7a/include/chewing/chewing.h index 8faceb71..08dc23f7 100644 --- a/libchewing/armeabi-v7a/include/chewing/chewing.h +++ b/libchewing/armeabi-v7a/include/chewing/chewing.h @@ -44,8 +44,12 @@ extern "C" { * specific functionality. */ +#ifdef WITH_RUST +# include "chewing_rs.h" +#else +# include "global.h" +#endif #include "chewingio.h" -#include "global.h" #include "mod_aux.h" /* backward compatibility */ diff --git a/libchewing/armeabi-v7a/include/chewing/chewingio.h b/libchewing/armeabi-v7a/include/chewing/chewingio.h index b9e5455a..10e471db 100644 --- a/libchewing/armeabi-v7a/include/chewing/chewingio.h +++ b/libchewing/armeabi-v7a/include/chewing/chewingio.h @@ -22,7 +22,11 @@ * \author libchewing Core Team */ -#include "global.h" +#ifdef WITH_RUST +# include "chewing_rs.h" +#else +# include "global.h" +#endif #define KEYSTROKE_IGNORE 1 #define KEYSTROKE_COMMIT 2 @@ -498,6 +502,30 @@ CHEWING_API int chewing_get_phraseChoiceRearward(const ChewingContext *ctx); /*@}*/ +/*! \name Behavior of automatic learning after committing + */ + +/*@{*/ +/** + * @brief Set the behavior of automatic learning + * + * @param ctx + * @param mode AUTOLEARN_ENABLED or AUTOLEARN_DISABLED + */ +CHEWING_API void chewing_set_autoLearn(ChewingContext *ctx, int mode); + + +/** + * @brief Get the behavior of automatic learning + * + * @param ctx + * @return AUTOLEARN_ENABLED or AUTOLEARN_DISABLED + */ +CHEWING_API int chewing_get_autoLearn(const ChewingContext *ctx); + +/*@}*/ + + /*! \name Phonetic sequence in Chewing internal state machine */ @@ -552,6 +580,8 @@ CHEWING_API ChewingContext *chewing_new2(const char *syspath, void (*logger) (void *data, int level, const char *fmt, ...), void *loggerdata); +CHEWING_API int chewing_phone_to_bopomofo(unsigned short phone, char *buf, unsigned short len); + /* *INDENT-OFF* */ #endif /* _CHEWING_IO_H */ /* *INDENT-ON* */ diff --git a/libchewing/armeabi-v7a/include/chewing/global.h b/libchewing/armeabi-v7a/include/chewing/global.h index ac46483c..5f5bb283 100644 --- a/libchewing/armeabi-v7a/include/chewing/global.h +++ b/libchewing/armeabi-v7a/include/chewing/global.h @@ -26,6 +26,8 @@ #define SYMBOL_MODE 0 #define FULLSHAPE_MODE 1 #define HALFSHAPE_MODE 0 +#define AUTOLEARN_DISABLED 1 +#define AUTOLEARN_ENABLED 0 /* specified to Chewing API */ #if defined(_WIN32) || defined(_WIN64) || defined(_WIN32_WCE) @@ -73,30 +75,6 @@ # endif #endif -/* The following macros are modified from GLIB. - * from GNU cpp Manual: - * C99 introduces the _Pragma operator. This feature addresses a major problem - * with `#pragma': being a directive, it cannot be produced as the result of - * macro expansion. _Pragma is an operator, much like sizeof or defined, and - * can be embedded in a macro. - */ -#if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))) -# define BEGIN_IGNORE_DEPRECATIONS \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wdeprecated-declarations\"") -# define END_IGNORE_DEPRECATIONS \ - _Pragma ("GCC diagnostic pop") -#elif defined (_MSC_VER) && (_MSC_VER >= 1500) -# define BEGIN_IGNORE_DEPRECATIONS \ - __pragma (warning (push)) \ - __pragma (warning (disable : 4996)) -# define END_IGNORE_DEPRECATIONS \ - __pragma (warning (pop)) -#else -# define BEGIN_IGNORE_DEPRECATIONS -# define END_IGNORE_DEPRECATIONS -#endif - #define MIN_SELKEY 1 #define MAX_SELKEY 10 diff --git a/libchewing/armeabi-v7a/include/chewing/mod_aux.h b/libchewing/armeabi-v7a/include/chewing/mod_aux.h index 96aa244e..650c53d2 100644 --- a/libchewing/armeabi-v7a/include/chewing/mod_aux.h +++ b/libchewing/armeabi-v7a/include/chewing/mod_aux.h @@ -18,7 +18,11 @@ * \author libchewing Core Team */ -#include "global.h" +#ifdef WITH_RUST +# include "chewing_rs.h" +#else +# include "global.h" +#endif /** * @brief Chewing the state for input context during commit process diff --git a/libchewing/armeabi-v7a/lib/libchewing.a b/libchewing/armeabi-v7a/lib/libchewing.a index ad5eb9b6..ad73f7fa 100644 Binary files a/libchewing/armeabi-v7a/lib/libchewing.a and b/libchewing/armeabi-v7a/lib/libchewing.a differ diff --git a/libchewing/x86/include/chewing/chewing.h b/libchewing/x86/include/chewing/chewing.h index 8faceb71..08dc23f7 100644 --- a/libchewing/x86/include/chewing/chewing.h +++ b/libchewing/x86/include/chewing/chewing.h @@ -44,8 +44,12 @@ extern "C" { * specific functionality. */ +#ifdef WITH_RUST +# include "chewing_rs.h" +#else +# include "global.h" +#endif #include "chewingio.h" -#include "global.h" #include "mod_aux.h" /* backward compatibility */ diff --git a/libchewing/x86/include/chewing/chewingio.h b/libchewing/x86/include/chewing/chewingio.h index b9e5455a..10e471db 100644 --- a/libchewing/x86/include/chewing/chewingio.h +++ b/libchewing/x86/include/chewing/chewingio.h @@ -22,7 +22,11 @@ * \author libchewing Core Team */ -#include "global.h" +#ifdef WITH_RUST +# include "chewing_rs.h" +#else +# include "global.h" +#endif #define KEYSTROKE_IGNORE 1 #define KEYSTROKE_COMMIT 2 @@ -498,6 +502,30 @@ CHEWING_API int chewing_get_phraseChoiceRearward(const ChewingContext *ctx); /*@}*/ +/*! \name Behavior of automatic learning after committing + */ + +/*@{*/ +/** + * @brief Set the behavior of automatic learning + * + * @param ctx + * @param mode AUTOLEARN_ENABLED or AUTOLEARN_DISABLED + */ +CHEWING_API void chewing_set_autoLearn(ChewingContext *ctx, int mode); + + +/** + * @brief Get the behavior of automatic learning + * + * @param ctx + * @return AUTOLEARN_ENABLED or AUTOLEARN_DISABLED + */ +CHEWING_API int chewing_get_autoLearn(const ChewingContext *ctx); + +/*@}*/ + + /*! \name Phonetic sequence in Chewing internal state machine */ @@ -552,6 +580,8 @@ CHEWING_API ChewingContext *chewing_new2(const char *syspath, void (*logger) (void *data, int level, const char *fmt, ...), void *loggerdata); +CHEWING_API int chewing_phone_to_bopomofo(unsigned short phone, char *buf, unsigned short len); + /* *INDENT-OFF* */ #endif /* _CHEWING_IO_H */ /* *INDENT-ON* */ diff --git a/libchewing/x86/include/chewing/global.h b/libchewing/x86/include/chewing/global.h index ac46483c..5f5bb283 100644 --- a/libchewing/x86/include/chewing/global.h +++ b/libchewing/x86/include/chewing/global.h @@ -26,6 +26,8 @@ #define SYMBOL_MODE 0 #define FULLSHAPE_MODE 1 #define HALFSHAPE_MODE 0 +#define AUTOLEARN_DISABLED 1 +#define AUTOLEARN_ENABLED 0 /* specified to Chewing API */ #if defined(_WIN32) || defined(_WIN64) || defined(_WIN32_WCE) @@ -73,30 +75,6 @@ # endif #endif -/* The following macros are modified from GLIB. - * from GNU cpp Manual: - * C99 introduces the _Pragma operator. This feature addresses a major problem - * with `#pragma': being a directive, it cannot be produced as the result of - * macro expansion. _Pragma is an operator, much like sizeof or defined, and - * can be embedded in a macro. - */ -#if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))) -# define BEGIN_IGNORE_DEPRECATIONS \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wdeprecated-declarations\"") -# define END_IGNORE_DEPRECATIONS \ - _Pragma ("GCC diagnostic pop") -#elif defined (_MSC_VER) && (_MSC_VER >= 1500) -# define BEGIN_IGNORE_DEPRECATIONS \ - __pragma (warning (push)) \ - __pragma (warning (disable : 4996)) -# define END_IGNORE_DEPRECATIONS \ - __pragma (warning (pop)) -#else -# define BEGIN_IGNORE_DEPRECATIONS -# define END_IGNORE_DEPRECATIONS -#endif - #define MIN_SELKEY 1 #define MAX_SELKEY 10 diff --git a/libchewing/x86/include/chewing/mod_aux.h b/libchewing/x86/include/chewing/mod_aux.h index 96aa244e..650c53d2 100644 --- a/libchewing/x86/include/chewing/mod_aux.h +++ b/libchewing/x86/include/chewing/mod_aux.h @@ -18,7 +18,11 @@ * \author libchewing Core Team */ -#include "global.h" +#ifdef WITH_RUST +# include "chewing_rs.h" +#else +# include "global.h" +#endif /** * @brief Chewing the state for input context during commit process diff --git a/libchewing/x86/lib/libchewing.a b/libchewing/x86/lib/libchewing.a index 0ba94468..4b7e16f1 100644 Binary files a/libchewing/x86/lib/libchewing.a and b/libchewing/x86/lib/libchewing.a differ diff --git a/libchewing/x86_64/include/chewing/chewing.h b/libchewing/x86_64/include/chewing/chewing.h index 8faceb71..08dc23f7 100644 --- a/libchewing/x86_64/include/chewing/chewing.h +++ b/libchewing/x86_64/include/chewing/chewing.h @@ -44,8 +44,12 @@ extern "C" { * specific functionality. */ +#ifdef WITH_RUST +# include "chewing_rs.h" +#else +# include "global.h" +#endif #include "chewingio.h" -#include "global.h" #include "mod_aux.h" /* backward compatibility */ diff --git a/libchewing/x86_64/include/chewing/chewingio.h b/libchewing/x86_64/include/chewing/chewingio.h index b9e5455a..10e471db 100644 --- a/libchewing/x86_64/include/chewing/chewingio.h +++ b/libchewing/x86_64/include/chewing/chewingio.h @@ -22,7 +22,11 @@ * \author libchewing Core Team */ -#include "global.h" +#ifdef WITH_RUST +# include "chewing_rs.h" +#else +# include "global.h" +#endif #define KEYSTROKE_IGNORE 1 #define KEYSTROKE_COMMIT 2 @@ -498,6 +502,30 @@ CHEWING_API int chewing_get_phraseChoiceRearward(const ChewingContext *ctx); /*@}*/ +/*! \name Behavior of automatic learning after committing + */ + +/*@{*/ +/** + * @brief Set the behavior of automatic learning + * + * @param ctx + * @param mode AUTOLEARN_ENABLED or AUTOLEARN_DISABLED + */ +CHEWING_API void chewing_set_autoLearn(ChewingContext *ctx, int mode); + + +/** + * @brief Get the behavior of automatic learning + * + * @param ctx + * @return AUTOLEARN_ENABLED or AUTOLEARN_DISABLED + */ +CHEWING_API int chewing_get_autoLearn(const ChewingContext *ctx); + +/*@}*/ + + /*! \name Phonetic sequence in Chewing internal state machine */ @@ -552,6 +580,8 @@ CHEWING_API ChewingContext *chewing_new2(const char *syspath, void (*logger) (void *data, int level, const char *fmt, ...), void *loggerdata); +CHEWING_API int chewing_phone_to_bopomofo(unsigned short phone, char *buf, unsigned short len); + /* *INDENT-OFF* */ #endif /* _CHEWING_IO_H */ /* *INDENT-ON* */ diff --git a/libchewing/x86_64/include/chewing/global.h b/libchewing/x86_64/include/chewing/global.h index ac46483c..5f5bb283 100644 --- a/libchewing/x86_64/include/chewing/global.h +++ b/libchewing/x86_64/include/chewing/global.h @@ -26,6 +26,8 @@ #define SYMBOL_MODE 0 #define FULLSHAPE_MODE 1 #define HALFSHAPE_MODE 0 +#define AUTOLEARN_DISABLED 1 +#define AUTOLEARN_ENABLED 0 /* specified to Chewing API */ #if defined(_WIN32) || defined(_WIN64) || defined(_WIN32_WCE) @@ -73,30 +75,6 @@ # endif #endif -/* The following macros are modified from GLIB. - * from GNU cpp Manual: - * C99 introduces the _Pragma operator. This feature addresses a major problem - * with `#pragma': being a directive, it cannot be produced as the result of - * macro expansion. _Pragma is an operator, much like sizeof or defined, and - * can be embedded in a macro. - */ -#if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))) -# define BEGIN_IGNORE_DEPRECATIONS \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wdeprecated-declarations\"") -# define END_IGNORE_DEPRECATIONS \ - _Pragma ("GCC diagnostic pop") -#elif defined (_MSC_VER) && (_MSC_VER >= 1500) -# define BEGIN_IGNORE_DEPRECATIONS \ - __pragma (warning (push)) \ - __pragma (warning (disable : 4996)) -# define END_IGNORE_DEPRECATIONS \ - __pragma (warning (pop)) -#else -# define BEGIN_IGNORE_DEPRECATIONS -# define END_IGNORE_DEPRECATIONS -#endif - #define MIN_SELKEY 1 #define MAX_SELKEY 10 diff --git a/libchewing/x86_64/include/chewing/mod_aux.h b/libchewing/x86_64/include/chewing/mod_aux.h index 96aa244e..650c53d2 100644 --- a/libchewing/x86_64/include/chewing/mod_aux.h +++ b/libchewing/x86_64/include/chewing/mod_aux.h @@ -18,7 +18,11 @@ * \author libchewing Core Team */ -#include "global.h" +#ifdef WITH_RUST +# include "chewing_rs.h" +#else +# include "global.h" +#endif /** * @brief Chewing the state for input context during commit process diff --git a/libchewing/x86_64/lib/libchewing.a b/libchewing/x86_64/lib/libchewing.a index 8d9a0724..62157b7e 100644 Binary files a/libchewing/x86_64/lib/libchewing.a and b/libchewing/x86_64/lib/libchewing.a differ diff --git a/toolchain-versions.json b/toolchain-versions.json index 43649ac9..546362e0 100644 --- a/toolchain-versions.json +++ b/toolchain-versions.json @@ -2,5 +2,5 @@ "cmake": "3.22.1", "ndk": " 25.2.9519653", "platform": 23, - "prebuilder": "ebcc7fa3c2658d8bf4b884661528d4e9cafbc415" + "prebuilder": "7260db47ae26bb65111df1d2aa8b29dd66d7d988" } \ No newline at end of file