summaryrefslogtreecommitdiffstats
path: root/src/storage/pinyin_base.cpp
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-08-08 13:44:49 +0800
committerPeng Wu <alexepico@gmail.com>2011-08-08 13:44:49 +0800
commit1dab453f2326a9ad2c8b03ca1a26e5bac6906bb8 (patch)
treef0ff2c445dce8db539d9e94f6d532764fe1052f3 /src/storage/pinyin_base.cpp
parent3aaa518dce7f164b2b758f1c3502b3fa6dde97d0 (diff)
downloadlibpinyin-1dab453f2326a9ad2c8b03ca1a26e5bac6906bb8.tar.gz
libpinyin-1dab453f2326a9ad2c8b03ca1a26e5bac6906bb8.tar.xz
libpinyin-1dab453f2326a9ad2c8b03ca1a26e5bac6906bb8.zip
add Ge<=>Ke fuzzy pinyin
Diffstat (limited to 'src/storage/pinyin_base.cpp')
-rw-r--r--src/storage/pinyin_base.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/storage/pinyin_base.cpp b/src/storage/pinyin_base.cpp
index c12c7ba..e7715a0 100644
--- a/src/storage/pinyin_base.cpp
+++ b/src/storage/pinyin_base.cpp
@@ -60,8 +60,8 @@ static const PinyinToken __pinyin_initials[] =
{"f", "ㄈ", 1, 1},
{"h", "ㄏ", 1, 1},
{"g", "ㄍ", 1, 1},
- {"j", "ㄐ", 1, 1},
{"k", "ㄎ", 1, 1},
+ {"j", "ㄐ", 1, 1},
{"m", "ㄇ", 1, 1},
{"n", "ㄋ", 1, 1},
{"l", "ㄌ", 1, 1},
@@ -135,7 +135,7 @@ static const PinyinToken __pinyin_tones [] =
static const PinyinTokenIndex __pinyin_initials_index[] =
{
//a b c d e f g h i j k l m
- {-1,0},{1,1}, {2,2}, {4,1}, {-1,0},{5,1}, {7,1}, {6,1}, {-1,0},{8,1}, {9,1}, {12,1},{10,1},
+ {-1,0},{1,1}, {2,2}, {4,1}, {-1,0},{5,1}, {7,1}, {6,1}, {-1,0},{9,1}, {8,1}, {12,1},{10,1},
//n o p q r s t u v w x y z
{11,1},{-1,0},{14,1},{15,1},{13,1},{16,2},{18,1},{-1,0},{-1,0},{19,1},{20,1},{21,1},{22,2}
};
@@ -1381,7 +1381,11 @@ int pinyin_compare_initial (const PinyinCustomSettings &custom,
(custom.use_ambiguities [PINYIN_AmbFoHe] &&
((lhs == PINYIN_Fo && rhs == PINYIN_He) ||
- (lhs == PINYIN_He && rhs == PINYIN_Fo)))
+ (lhs == PINYIN_He && rhs == PINYIN_Fo))) ||
+
+ (custom.use_ambiguities [PINYIN_AmbGeKe] &&
+ ((lhs == PINYIN_Ge && rhs == PINYIN_Ke) ||
+ (lhs == PINYIN_Ke && rhs == PINYIN_Ge)))
)
return 0;
else return (lhs - rhs);