Repository: zh-lx/pinyin-pro (ts)

Issue:
polyphonic: 非中文字符表现与 pinyin api 不一致
## bug 描述

`polyphonic` 非中文字符返回结果为空，`pinyin` 会返回原字符

## 你预期的样子是？

`polyphonic` 非中文字符返回原字符

## pinyin-pro 版本号

`3.20.0`


Pull request description:
fix: 修复 polyphonic 对非中文字符的处理
close #225 

Patch:
diff --git a/lib/core/polyphonic/index.ts b/lib/core/polyphonic/index.ts
index d417ea3..70e6ef5 100644
--- a/lib/core/polyphonic/index.ts
+++ b/lib/core/polyphonic/index.ts
@@ -209,11 +209,11 @@ const getPolyphonicList = (text: string): SingleWordResult[] => {
   return text.split('').map((word) => {
     const wordCode = word.charCodeAt(0);
     const customPolyphonicDict = getCustomPolyphonicDict();
-    const pinyin = customPolyphonicDict[wordCode] || DICT1[wordCode] || '';
+    const pinyin = customPolyphonicDict[wordCode] || DICT1[wordCode] || word;
     return {
       origin: word,
       result: pinyin,
-      isZh: !!pinyin,
+      isZh: pinyin !== word,
       originPinyin: pinyin,
     };
   });


Test patch:
diff --git a/test/polyphonic.test.js b/test/polyphonic.test.js
index 0ce2b1c..114587a 100644
--- a/test/polyphonic.test.js
+++ b/test/polyphonic.test.js
@@ -122,7 +122,7 @@ describe('polyphonic', () => {
 
   it('[polyphonic]nonzh', () => {
     const result = polyphonic('好好学习s');
-    expect(result).to.deep.equal(['hǎo hào', 'hǎo hào', 'xué', 'xí', '']);
+    expect(result).to.deep.equal(['hǎo hào', 'hǎo hào', 'xué', 'xí', 's']);
   });
 
   it('[polyphonic]all&nonZh', () => {