diff --git a/.gitignore b/.gitignore index c80c646..785a537 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ examples/go/libsimple-osx-x64/ cmake-build-debug/ +.vscode/ \ No newline at end of file diff --git a/contrib/pinyin.txt b/contrib/pinyin.txt index 1892180..457619f 100644 --- a/contrib/pinyin.txt +++ b/contrib/pinyin.txt @@ -1,4 +1,4 @@ -# version: 0.13.0 +# version: 0.14.0 # source: https://github.com/mozillazg/pinyin-data U+3007: líng,yuán,xīng U+3400: qiū @@ -1798,7 +1798,7 @@ U+3C6A: mèn U+3C6B: làn U+3C6C: wěi U+3C6D: duàn -U+3C6E: kuài +U+3C6E: kuài,huì U+3C6F: ái U+3C70: zǎi U+3C71: huì @@ -5776,6 +5776,7 @@ U+4DB1: tóng U+4DB2: nán U+4DB3: yuè U+4DB5: chí +U+4DB8: yāo U+4E00: yī,yí,yì U+4E01: dīng,zhēng U+4E02: kǎo,qiǎo,yú @@ -7427,7 +7428,7 @@ U+5471: gū,guā,guǎ U+5472: cī,cí,zī U+5473: wèi,mèi U+5474: xǔ,hǒu,hōu,gòu,gōu,gū -U+5475: hē,hā,ā,a,kē,huō,á,à +U+5475: hē,hā,ā,a,kē,huō,á,ǎ,à U+5476: náo,ná,nǔ U+5477: gā,xiā,jiǎ U+5478: pēi @@ -15993,7 +15994,7 @@ U+75EF: guǎn U+75F0: tán U+75F1: fèi,féi,fěi U+75F2: má -U+75F3: lín,lìn +U+75F3: lín,lìn,má U+75F4: chī U+75F5: jì U+75F6: tiǎn,diǎn @@ -17402,7 +17403,7 @@ U+7B70: zuó U+7B71: xiǎo U+7B72: shāo U+7B73: tíng -U+7B74: cè,jiā,jiá +U+7B74: cè,jiā U+7B75: yán U+7B76: gào,gǎo U+7B77: kuài @@ -17955,7 +17956,7 @@ U+7D99: jì U+7D9A: xù U+7D9B: rěn U+7D9C: zōng,zèng,zòng -U+7D9D: chēn,shēn,lín +U+7D9D: chēn,shēn U+7D9E: duǒ U+7D9F: lì,liè U+7DA0: lǜ @@ -18691,7 +18692,7 @@ U+8079: níng U+807A: qié U+807B: nǐ,jiàn U+807C: tīng -U+807D: tīng,tìng +U+807D: tīng U+807E: lóng U+807F: yù U+8080: yù @@ -22199,7 +22200,7 @@ U+8E2D: zhēng U+8E2E: diǎn U+8E2F: zhí U+8E30: yú,yáo,chū -U+8E31: duó,chuò,duò +U+8E31: duó,chuò U+8E32: dùn U+8E33: chuǎn,chǔn,chūn U+8E34: yǒng @@ -22800,7 +22801,7 @@ U+9086: téng U+9087: ěr U+9088: miǎo,miáo U+9089: biān -U+908A: biān +U+908A: biān,bian U+908B: lā,liè U+908C: lí,chí U+908D: yuán @@ -24106,7 +24107,7 @@ U+95A0: rùn U+95A1: ài,hé,hài,gāi,kǎi U+95A2: guān U+95A3: gé -U+95A4: gé,gē,hé +U+95A4: gé,gē U+95A5: fá U+95A6: chù U+95A7: hòng,xiàng @@ -24808,7 +24809,7 @@ U+985E: lèi U+985F: láo U+9860: piǎo U+9861: wài,zhuài -U+9862: mán +U+9862: mán,mān U+9863: cù U+9864: yáo,qiào U+9865: hào @@ -26676,7 +26677,7 @@ U+9FD4: gē U+9FD5: dān U+9FEB: ào U+9FEC: tián -U+9FED: nǐ +U+9FED: nǐ,xǐ U+E815: yè U+E816: zuǒ,yǒu U+E818: gǔn @@ -41275,30 +41276,46 @@ U+2A6CE: pì U+2A6D2: lián U+2A79D: duó U+2A7DD: jì,jī +U+2A833: chē U+2A848: bái U+2A84F: zhān U+2A8AE: luán +U+2A8DD: zào U+2A8FB: lóu U+2A917: liào +U+2AA07: tuí U+2AA0A: sóng U+2AA17: juē +U+2AA27: lún U+2AA30: qū U+2AA36: shē U+2AA58: yǎn U+2AA9D: yōng +U+2AB8B: xiāo +U+2AC77: bèi +U+2ADFD: zàn U+2AEB9: nǔ U+2AED0: cōng +U+2AF47: kē +U+2AF94: xǔ U+2AFA2: xiàn +U+2AFA6: lú U+2B061: lì U+2B088: fèi U+2B099: sù U+2B0DC: kòu +U+2B11B: jīn +U+2B11F: shī +U+2B124: da +U+2B125: lí,xǐ U+2B127: yán U+2B128: chī U+2B137: yì U+2B138: xūn U+2B1ED: wěi U+2B230: qià +U+2B241: ài +U+2B2CC: tè U+2B2D0: gǒng U+2B300: jī U+2B328: luó @@ -41309,13 +41326,20 @@ U+2B363: tóng U+2B36F: xián U+2B370: xǐ U+2B372: xiǎo +U+2B37B: xī U+2B37D: xuān +U+2B3AB: dàn +U+2B3AC: gàn U+2B3CB: juē,qiāo +U+2B3D0: zàn U+2B404: yuè U+2B406: kuài U+2B409: líng U+2B410: ní +U+2B411: guǎn U+2B413: bù,róu +U+2B416: jiāo +U+2B418: kǎn U+2B461: méng U+2B4B6: hán U+2B4E7: fū @@ -41326,16 +41350,22 @@ U+2B4F9: jī U+2B50D: fán U+2B50E: jué U+2B536: niè +U+2B583: huì +U+2B594: bài U+2B5AE: yǐ U+2B5AF: fǔ U+2B5B3: yūn U+2B5E0: zhāng U+2B5E6: bù U+2B5E7: sù +U+2B5E9: luó +U+2B5EB: hú U+2B5EE: huáng +U+2B5F0: duī U+2B5F4: zhān U+2B61C: wén U+2B61D: jué +U+2B61E: tuó U+2B623: hàn U+2B624: ái U+2B626: táo @@ -41343,6 +41373,7 @@ U+2B627: lù U+2B628: tí U+2B62A: yuán U+2B62C: xí +U+2B62D: shuāng U+2B688: xù U+2B689: hóng U+2B692: fú @@ -41350,13 +41381,18 @@ U+2B694: huí U+2B695: shī U+2B696: cǐ U+2B699: pū +U+2B6A5: xiā U+2B6AD: liè U+2B6DB: zhī U+2B6DE: jué U+2B6E2: níng +U+2B6E3: yù U+2B6ED: kuáng +U+2B6F3: fú U+2B6F6: chì U+2B6F8: tí +U+2B728: bà +U+2B72C: zé U+2B737: shòu U+2B738: huà U+2B7A9: mén @@ -41369,55 +41405,77 @@ U+2B806: kuǐ U+2B80A: xuán U+2B81C: ní U+2B825: lòu +U+2B826: suǒ U+2B851: yīn +U+2B892: lǒng U+2B8B8: dàn +U+2B9EF: xiè U+2BAC7: ě,è +U+2BAE6: dàn U+2BB5F: ōu,qū U+2BB62: lǔn U+2BB7C: láo U+2BB83: shàn U+2BBAC: jiàng +U+2BC02: duǒ U+2BC1B: xíng +U+2BD52: tuí +U+2BD58: bī U+2BD77: lì U+2BD87: dié U+2BDF7: xīn U+2BE29: kōu U+2BF1B: diào +U+2BF1D: chōu U+2BF6E: dǎng U+2C029: wěi U+2C02A: xiàn U+2C037: shāng +U+2C060: xiǎng U+2C0A9: jiā U+2C0CA: zhì +U+2C129: yǐn U+2C19B: nǎo +U+2C1AE: kòu U+2C1D5: wàn +U+2C1D8: tuán U+2C1D9: pèi,bèi U+2C1F9: guó +U+2C227: sè U+2C27C: ōu,ǒu U+2C288: xún U+2C2A4: chǎn U+2C317: hé +U+2C359: zhǎn U+2C35B: lì U+2C361: dàng U+2C364: xún U+2C41A: hǎi U+2C454: zhòng +U+2C457: jiàn U+2C461: chǒu U+2C488: què U+2C494: gěng U+2C497: lán U+2C498: xìn +U+2C4EB: qiū U+2C4FC: tuí U+2C542: gōng,lǒng U+2C613: xún +U+2C616: jiǎn U+2C618: dǎn +U+2C61C: zhàn +U+2C61D: zhěn U+2C621: yīn +U+2C622: kuàng U+2C629: tīng U+2C62B: huán U+2C62C: qiàn U+2C62D: lín,chēn U+2C62F: zhǔn +U+2C635: gēng U+2C642: yǎn +U+2C646: fān,fán U+2C64A: mò U+2C64B: xiāng U+2C6F8: niē @@ -41426,48 +41484,63 @@ U+2C72F: liǎng U+2C79F: pín U+2C7C1: yì U+2C7FD: dōng +U+2C88A: sì +U+2C8C0: wèi U+2C8D9: xū U+2C8DE: zhǔ U+2C8E1: jiàn U+2C8F3: hěn U+2C907: yīn U+2C90A: shì +U+2C910: gē U+2C91D: huì U+2C925: zhuàn +U+2C930: huān +U+2C9C0: qiāng,qiàng U+2CA02: qí U+2CA0E: yóu U+2CA7D: xún U+2CAA9: nóng U+2CB29: yì +U+2CB2B: pī U+2CB2D: lún U+2CB2E: chǎng U+2CB31: jīn +U+2CB32: pì U+2CB38: shù U+2CB39: shén +U+2CB3A: chú,jǔ U+2CB3B: lú U+2CB3F: zhāo U+2CB41: mǔ U+2CB4A: dù U+2CB4E: hóng -U+2CB5A: chún +U+2CB5A: chún,duì U+2CB5B: bō +U+2CB63: xiàn U+2CB64: hóu U+2CB69: wēng U+2CB6C: wèi,huì U+2CB6F: piě +U+2CB72: suǒ U+2CB73: xǐ +U+2CB74: jiē U+2CB76: hēi U+2CB78: lín U+2CB7C: suì +U+2CBA4: gé,hé U+2CBB1: yīn U+2CBBF: qí,gài U+2CBC0: jī +U+2CBC5: xiá U+2CBCE: tuí U+2CC03: mù U+2CC56: dí U+2CC5F: wěi +U+2CC66: qī U+2CC9C: chēng U+2CCF2: chǎn +U+2CCF3: fān U+2CCF5: pī U+2CCF6: jiōng U+2CCFD: shēn @@ -41475,6 +41548,7 @@ U+2CCFF: tú U+2CD02: fēi U+2CD03: huō U+2CD0A: lín +U+2CD10: huān U+2CD8B: jū U+2CD8D: tuó U+2CD8F: wéi @@ -41485,15 +41559,95 @@ U+2CDA8: jì U+2CDAD: jì U+2CDAE: xǐ U+2CDD5: bū,bǔ +U+2CE05: chú U+2CE18: yǎn U+2CE1A: yuè U+2CE23: xiān U+2CE26: zhuó U+2CE2A: fán +U+2CE31: qú U+2CE7C: xiè U+2CE88: yǐ U+2CE93: chǔ U+2D016: lí +U+2D11B: jiǎn +U+2D546: suǒ +U+2D613: hū +U+2D6A6: guō +U+2D8C7: diān +U+2D930: yú +U+2DA86: zhuā +U+2DC4A: hòng +U+2DE5C: luó +U+2E18F: lán +U+2E261: lú +U+2E262: zhì +U+2E264: guà +U+2E267: liǎng +U+2E268: guā +U+2E26A: zōu +U+2E26B: ruí +U+2E26C: cuì +U+2E26F: cài +U+2E428: yīng +U+2E502: jié +U+2E505: fù +U+2E50A: liǎng +U+2E581: liǎng +U+2E5B1: xié +U+2E64A: yǐn +U+2E64B: dú +U+2E774: gū +U+2E775: ér +U+2E778: chūn +U+2E779: huán,huàn +U+2E77A: gé +U+2E81E: qiāng +U+2E8F2: gāng +U+2E8F3: hóng +U+2E8F4: chán +U+2E8F5: zhuì +U+2E8F6: lǜ +U+2E8F7: jù +U+2E932: bì +U+2E9F4: chàng +U+2E9F5: wěi +U+2EA5B: bì +U+2EAA3: zōng +U+2EAA5: dūn +U+2EAC2: níng +U+2EB1C: yì +U+2EB1D: guì +U+2EB1E: cān +U+2EB1F: huò +U+2EB20: lù +U+2EB21: huá +U+2EB22: wēng +U+2EB23: xián +U+2EB24: zhēn +U+2EB65: gōng +U+2EB66: chén +U+2EB68: yàn +U+2EB6A: shuāng +U+2EB70: gǎng +U+2EBD9: kè,qiā U+2F835: huī +U+300F7: chuàng +U+305E3: zá +U+307D8: yàn +U+309C9: zhì +U+30C71: cí +U+30D5D: hé +U+30D74: chù +U+30DE0: yí,yì +U+30DE5: cóng U+30EDD: biáng U+30EDE: biáng +U+310A8: è +U+310AF: cuì +U+310B1: kǎn +U+310BB: qiáo +U+310FA: tiǎn +U+31148: bì +U+31254: jué +U+31288: yì diff --git a/src/pinyin.cc b/src/pinyin.cc index f4d2e3c..e63ab86 100644 --- a/src/pinyin.cc +++ b/src/pinyin.cc @@ -28,6 +28,11 @@ std::set PinYin::to_plain(const std::string &input) { } len = get_str_len((unsigned char)byte); if (len == 1) { + // Skip invisible byte + // Fix the issue in Windows https://github.com/wangfenjin/simple/pull/143 + if (std::isspace(byte) || std::iscntrl(byte)) { + continue; + } value.push_back(byte); continue; }