diff --git a/package.json b/package.json index 49f44b9..c00be17 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hanzi-tools", - "version": "1.2.12", + "version": "1.2.13", "author": "Peter Olson ", "description": "Converts from Chinese characters to pinyin, between simplified and traditional, and does word segmentation.", "license": "Unlicense", diff --git a/spec/spec.js b/spec/spec.js index 01c8a3e..281c729 100644 --- a/spec/spec.js +++ b/spec/spec.js @@ -141,4 +141,7 @@ describe("Traditionalize", () => { expect(traditionalize("又在梦里见到你")).toEqual("又在夢裡見到你"); expect(traditionalize("我只有三只狗。")).toEqual("我只有三隻狗。"); }); + it("chooses right ambiguous character", () => { + expect(traditionalize(`你对那个女的干了什么?`)).toEqual("你對那個女的幹了什麼?"); + }); }); \ No newline at end of file diff --git a/src/pinyinDict.js b/src/pinyinDict.js index 540b3ae..b3dfd5c 100644 --- a/src/pinyinDict.js +++ b/src/pinyinDict.js @@ -4016,7 +4016,7 @@ let dict = [ "乷|||乷|xx", "乸|||乸|nǎ", "乾|||乾||乹||亁|gān", - "干|||乾||幹||干||乹||亁|gàn", + "干|||幹||乾||干||乹||亁|gàn", "乺|||乺|xx", "乼|||乼|xx", "干俸|||乾俸|gān​fèng",