From 84542f6bd75c1c24bc1f8a58ccc81f4fe6df9407 Mon Sep 17 00:00:00 2001 From: Peter Olson Date: Wed, 11 Dec 2019 12:28:50 +0600 Subject: [PATCH] =?UTF-8?q?update=20=E5=B9=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- spec/spec.js | 3 +++ src/pinyinDict.js | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) 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",