From daabc5f01ad7e482d84176f603b6f39fe61b0d1f Mon Sep 17 00:00:00 2001 From: hbybyyang <2451759073@qq.com> Date: Sun, 25 Oct 2020 01:34:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E3=80=87=E7=AC=A6=E5=8F=B7=E7=9A=84?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/GetChineseExpression.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/GetChineseExpression.js b/lib/GetChineseExpression.js index 06cef0d..7d38d95 100644 --- a/lib/GetChineseExpression.js +++ b/lib/GetChineseExpression.js @@ -10,7 +10,7 @@ module.exports = function 获得中文字符表示({ 表示方法, 文本, 选 } if (表示方法.indexOf('拼音')) { var 结果 = null - 结果 = 拼音(文本, { heteronym: true, style: 拼音.STYLE_NORMAL }) + 结果 = 拼音(文本.replace(/〇/g, '零'), { heteronym: true, style: 拼音.STYLE_NORMAL }) 结果 = 结果.map(a => a.map(a => 转换为大写(a[0]) + a.substring(1))) 结果 = 多重笛卡尔积(结果).map(a => a.join('')) if (表示方法 != "全拼") -- Gitee From c1a0831b22b50a4b929c71ec8f67140a9dcd8a63 Mon Sep 17 00:00:00 2001 From: hbybyyang <2451759073@qq.com> Date: Sun, 25 Oct 2020 01:52:08 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E3=80=87=E5=AD=97=E7=AC=A6=E7=9A=84?= =?UTF-8?q?=E5=A4=84=E7=90=86=20=E6=AD=A3=E5=88=99=E5=8C=B9=E9=85=8D?= =?UTF-8?q?=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/StringEx.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/StringEx.js b/lib/StringEx.js index 22962d8..ef8e636 100644 --- a/lib/StringEx.js +++ b/lib/StringEx.js @@ -1,6 +1,6 @@ exports.转换为大写 = 字符串 => 字符串.toLocaleUpperCase() exports.包含中文 = function 包含中文(str) { - return /.*[\u4e00-\u9fa5]+.*$/.test(str) + return /.*[\u4e00-\u9fa5 || \u3007]+.*$/.test(str) } exports.是纯字母 = function 是纯字母(str) { return /[A-Za-z]/.test(str) -- Gitee