From 8cb9edf42ea72a7fd5458beb176e3614f37037b1 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Fri, 31 Mar 2023 21:40:29 +0800 Subject: [PATCH] Add Wade-Giles pinyin input support. (#32) --- README.md | 8 +- Tekkon.Tests/Tekkon.Tests.csproj | 2 +- Tekkon.Tests/TekkonTests_Intermediate.cs | 56 ++++++++ Tekkon.sln | 2 +- Tekkon/Composer.cs | 109 ++++++---------- Tekkon/Enums.cs | 4 +- Tekkon/Shared.cs | 159 ++++++++++++++++++++++- Tekkon/Tekkon.csproj | 8 +- 8 files changed, 264 insertions(+), 84 deletions(-) diff --git a/README.md b/README.md index 2e79a09..afcd39c 100644 --- a/README.md +++ b/README.md @@ -15,13 +15,13 @@ Tekkon Engine is a module made for processing combo-composition of stroke-based Mandarin Chinese phonetics (i.e. Zhuyin / Bopomofo). This repository is part of Operation Longinus of The vChewing Project. -羅馬拼音輸入目前僅支援漢語拼音、國音二式、耶魯拼音、華羅拼音、通用拼音。 +羅馬拼音輸入目前僅支援漢語拼音、國音二式、耶魯拼音、華羅拼音、通用拼音、韋氏拼音(威妥瑪拼音)。 -- 因為**韋氏拼音(威妥瑪拼音)輔音清濁不分的問題非常嚴重**、無法與注音符號形成逐一對應,故鐵恨引擎在技術上無法實現對韋氏拼音的支援。 +- 因為**趙元任國語羅馬字拼音「無法製作通用的聲調確認鍵」**,故鐵恨引擎在技術上無法實現對趙元任國語羅馬字拼音的支援。 -Regarding pinyin input support, we only support: Hanyu Pinyin, Secondary Pinyin, Yale Pinyin, Hualuo Pinyin, and Universal Pinyin. +Regarding pinyin input support, we only support: Hanyu Pinyin, Secondary Pinyin, Yale Pinyin, Hualuo Pinyin, Wade-Giles Pinyin and Universal Pinyin. -- **Tekkon is unable to provide Wade–Giles Pinyin support** since it is impossible to make one-to-one mappings to all possible phonabet combinations (especially it cannot distinguish "k" and "g"). +- **Tekkon is unable to provide support for Zhao Yuan-Ren's Gwoyeu Romatzyh at this moment** because there is no consistent method to check whether the intonation key has been pressed. Tekkon is designed to confirm input with intonation keys. ## 著作權 (Credits) diff --git a/Tekkon.Tests/Tekkon.Tests.csproj b/Tekkon.Tests/Tekkon.Tests.csproj index 60ce9c1..05cdb91 100644 --- a/Tekkon.Tests/Tekkon.Tests.csproj +++ b/Tekkon.Tests/Tekkon.Tests.csproj @@ -4,7 +4,7 @@ net6.0 enable false - 1.3.2 + 1.4.0 diff --git a/Tekkon.Tests/TekkonTests_Intermediate.cs b/Tekkon.Tests/TekkonTests_Intermediate.cs index c5c72e4..0791599 100644 --- a/Tekkon.Tests/TekkonTests_Intermediate.cs +++ b/Tekkon.Tests/TekkonTests_Intermediate.cs @@ -350,5 +350,61 @@ public void TestUniversalPinyinKeyReceivingAndCompositions() { toneMarkerIndicator = composer.HasIntonation(withNothingElse: true); Assert.True(toneMarkerIndicator); } + + [Test] + public void TestWadeGilesPinyinKeyReceivingAndCompositions() { + Composer composer = new(arrange: MandarinParser.OfWadeGilesPinyin); + + // Test Key Receiving + composer.ReceiveKey(99); // c + composer.ReceiveKey("h"); + composer.ReceiveKey("'"); // 韋氏拼音清濁分辨鍵 + composer.ReceiveKey("i"); + composer.ReceiveKey("u"); + composer.ReceiveKey("n"); + composer.ReceiveKey("g"); + + // Testing missing tone markers + bool toneMarkerIndicator = composer.HasIntonation(); + Assert.True(!toneMarkerIndicator); + + composer.ReceiveKey("2"); // 陽平 + Assert.AreEqual(actual: composer.Value, expected: "ㄑㄩㄥˊ"); + composer.DoBackSpace(); + composer.ReceiveKey(" "); // 陰平 + Assert.AreEqual(actual: composer.Value, + expected: "ㄑㄩㄥ "); // 這裡回傳的結果的陰平是空格 + + // Test Getting Displayed Composition + Assert.AreEqual(actual: composer.GetComposition(), expected: "ㄑㄩㄥ"); + Assert.AreEqual(actual: composer.GetComposition(isHanyuPinyin: true), + expected: "qiong1"); + Assert.AreEqual(actual: composer.GetComposition(isHanyuPinyin: true, + isTextBookStyle: true), + expected: "qiōng"); + Assert.AreEqual( + actual: composer.GetInlineCompositionForDisplay(isHanyuPinyin: true), + expected: "ch'iung1"); + + // Test Tone 5 + composer.ReceiveKey("7"); // 輕聲 + Assert.AreEqual(actual: composer.GetComposition(), expected: "ㄑㄩㄥ˙"); + Assert.AreEqual(actual: composer.GetComposition(isTextBookStyle: true), + expected: "˙ㄑㄩㄥ"); + + // Testing having tone markers + toneMarkerIndicator = composer.HasIntonation(); + Assert.True(toneMarkerIndicator); + + // Testing having not-only tone markers + toneMarkerIndicator = composer.HasIntonation(withNothingElse: true); + Assert.True(!toneMarkerIndicator); + + // Testing having only tone markers + composer.Clear(); + composer.ReceiveKey("3"); // 上聲 + toneMarkerIndicator = composer.HasIntonation(withNothingElse: true); + Assert.True(toneMarkerIndicator); + } } } diff --git a/Tekkon.sln b/Tekkon.sln index af6df37..08a84e6 100644 --- a/Tekkon.sln +++ b/Tekkon.sln @@ -47,6 +47,6 @@ Global $0.DotNetNamingPolicy = $4 $4.DirectoryNamespaceAssociation = PrefixedHierarchical $0.StandardHeader = $5 - version = 1.3.2 + version = 1.4.0 EndGlobalSection EndGlobal diff --git a/Tekkon/Composer.cs b/Tekkon/Composer.cs index 99a7dea..5d5154d 100644 --- a/Tekkon/Composer.cs +++ b/Tekkon/Composer.cs @@ -97,11 +97,12 @@ public string GetInlineCompositionForDisplay(bool isHanyuPinyin = false) { case MandarinParser.OfYalePinyin: case MandarinParser.OfHualuoPinyin: case MandarinParser.OfUniversalPinyin: + case MandarinParser.OfWadeGilesPinyin: string toneReturned = Intonation.Value switch { " " => "1", "ˊ" => "2", "ˇ" => "3", "ˋ" => "4", "˙" => "5", _ => "" }; - return RomajiBuffer + toneReturned; + return RomajiBuffer.Replace("v", "ü") + toneReturned; case MandarinParser.OfDachen: case MandarinParser.OfDachen26: case MandarinParser.OfETen: @@ -127,6 +128,7 @@ public bool IsEmpty { case MandarinParser.OfYalePinyin: case MandarinParser.OfHualuoPinyin: case MandarinParser.OfUniversalPinyin: + case MandarinParser.OfWadeGilesPinyin: return Intonation.IsEmpty && RomajiBuffer == ""; case MandarinParser.OfDachen: case MandarinParser.OfDachen26: @@ -214,6 +216,8 @@ public bool InputValidityCheck(int inputCharCode) { return Shared.MapFakeSeigyou.ContainsKey(inputKey.ToString()); case MandarinParser.OfStarlight: return Shared.MapStarlightStaticKeys.ContainsKey(inputKey.ToString()); + case MandarinParser.OfWadeGilesPinyin: + return Shared.MapWadeGilesPinyinKeys.Contains(inputKey); case MandarinParser.OfHanyuPinyin: case MandarinParser.OfSecondaryPinyin: case MandarinParser.OfYalePinyin: @@ -247,13 +251,15 @@ public void ReceiveKey(string input) { case MandarinParser.OfYalePinyin: case MandarinParser.OfHualuoPinyin: case MandarinParser.OfUniversalPinyin: + case MandarinParser.OfWadeGilesPinyin: if (Shared.MapArayuruPinyinIntonation.ContainsKey(input)) { string theTone = Shared.MapArayuruPinyinIntonation[input]; Intonation = new(theTone); } else { // 為了防止 RomajiBuffer 越敲越長帶來算力負擔, // 這裡讓它在要溢出時自動丟掉最早輸入的音頭。 - if (RomajiBuffer.Length > 5) { + int maxCount = (Parser == MandarinParser.OfWadeGilesPinyin) ? 7 : 6; + if (RomajiBuffer.Length > maxCount - 1) { RomajiBuffer = RomajiBuffer.Skip(1).ToString(); } string romajiBufferBackup = RomajiBuffer + input; @@ -381,74 +387,38 @@ public void ReceiveSequence(string givenSequence = "", bool isRomaji = false) { Clear(); if (!isRomaji) { - foreach (char key in givenSequence) { - ReceiveKey(key); - } - } else { - switch (Parser) { - case MandarinParser.OfHanyuPinyin: - string dictResult1 = ""; - if (Shared.MapHanyuPinyin.ContainsKey(givenSequence)) - dictResult1 = Shared.MapHanyuPinyin[givenSequence]; - if (dictResult1 != "") { - foreach (char phonabet in dictResult1) { - ReceiveKeyFromPhonabet(phonabet.ToString()); - } - } - break; - case MandarinParser.OfSecondaryPinyin: - string dictResult2 = ""; - if (Shared.MapSecondaryPinyin.ContainsKey(givenSequence)) - dictResult2 = Shared.MapSecondaryPinyin[givenSequence]; - if (dictResult2 != "") { - foreach (char phonabet in dictResult2) { - ReceiveKeyFromPhonabet(phonabet.ToString()); - } - } - break; - case MandarinParser.OfYalePinyin: - string dictResult3 = ""; - if (Shared.MapYalePinyin.ContainsKey(givenSequence)) - dictResult3 = Shared.MapYalePinyin[givenSequence]; - if (dictResult3 != "") { - foreach (char phonabet in dictResult3) { - ReceiveKeyFromPhonabet(phonabet.ToString()); - } - } - break; - case MandarinParser.OfHualuoPinyin: - string dictResult4 = ""; - if (Shared.MapHualuoPinyin.ContainsKey(givenSequence)) - dictResult4 = Shared.MapHualuoPinyin[givenSequence]; - if (dictResult4 != "") { - foreach (char phonabet in dictResult4) { - ReceiveKeyFromPhonabet(phonabet.ToString()); - } - } - break; - case MandarinParser.OfUniversalPinyin: - string dictResult5 = ""; - if (Shared.MapUniversalPinyin.ContainsKey(givenSequence)) - dictResult5 = Shared.MapUniversalPinyin[givenSequence]; - if (dictResult5 != "") { - foreach (char phonabet in dictResult5) { - ReceiveKeyFromPhonabet(phonabet.ToString()); - } - } - break; - case MandarinParser.OfDachen: - case MandarinParser.OfDachen26: - case MandarinParser.OfETen: - case MandarinParser.OfETen26: - case MandarinParser.OfHsu: - case MandarinParser.OfIBM: - case MandarinParser.OfMiTAC: - case MandarinParser.OfSeigyou: - case MandarinParser.OfFakeSeigyou: - default: - break; - } + foreach (char key in givenSequence) ReceiveKey(key); + return; + } + string dictResult = ""; + switch (Parser) { + case MandarinParser.OfHanyuPinyin: + if (Shared.MapHanyuPinyin.ContainsKey(givenSequence)) + dictResult = Shared.MapHanyuPinyin[givenSequence]; + break; + case MandarinParser.OfSecondaryPinyin: + if (Shared.MapSecondaryPinyin.ContainsKey(givenSequence)) + dictResult = Shared.MapSecondaryPinyin[givenSequence]; + break; + case MandarinParser.OfYalePinyin: + if (Shared.MapYalePinyin.ContainsKey(givenSequence)) + dictResult = Shared.MapYalePinyin[givenSequence]; + break; + case MandarinParser.OfHualuoPinyin: + if (Shared.MapHualuoPinyin.ContainsKey(givenSequence)) + dictResult = Shared.MapHualuoPinyin[givenSequence]; + break; + case MandarinParser.OfUniversalPinyin: + if (Shared.MapUniversalPinyin.ContainsKey(givenSequence)) + dictResult = Shared.MapUniversalPinyin[givenSequence]; + break; + case MandarinParser.OfWadeGilesPinyin: + if (Shared.MapWadeGilesPinyin.ContainsKey(givenSequence)) + dictResult = Shared.MapWadeGilesPinyin[givenSequence]; + break; } + foreach (char phonabet in dictResult) + ReceiveKeyFromPhonabet(phonabet.ToString()); } /// @@ -549,6 +519,7 @@ private string Translate(string key) { case MandarinParser.OfYalePinyin: case MandarinParser.OfHualuoPinyin: case MandarinParser.OfUniversalPinyin: + case MandarinParser.OfWadeGilesPinyin: default: break; } diff --git a/Tekkon/Enums.cs b/Tekkon/Enums.cs index a0bb0e6..18b02ce 100644 --- a/Tekkon/Enums.cs +++ b/Tekkon/Enums.cs @@ -82,7 +82,9 @@ public enum MandarinParser { /// 拼音:華羅拼音排列。 OfHualuoPinyin = 103, /// 拼音:通用拼音排列。 - OfUniversalPinyin = 104 + OfUniversalPinyin = 104, + /// 拼音:韋氏拼音排列。 + OfWadeGilesPinyin = 105 // C# 似乎不支援在這裡直接給一個動態 var。 // 所以,針對每個輸入模式的 token 轉換需要寫在輸入法內。 } diff --git a/Tekkon/Shared.cs b/Tekkon/Shared.cs index 3acc904..2031604 100644 --- a/Tekkon/Shared.cs +++ b/Tekkon/Shared.cs @@ -316,11 +316,19 @@ public readonly static ( // MARK: - Maps for Keyboard-to-Pinyin parsers /// - /// 任何形式的拼音排列都會用到的陣列,用 Strings 反而省事一些。
+ /// 任何形式的拼音排列都會用到的陣列(韋氏拼音與趙元任國語羅馬字除外), + /// 用 Strings 反而省事一些。
/// 這裡同時兼容大千注音的調號數字,所以也將 6、7 號數字鍵放在允許範圍內。 ///
public const string MapArayuruPinyin = "abcdefghijklmnopqrstuvwxyz1234567 "; + /// + /// 任何形式的拼音排列都會用到的陣列(韋氏拼音與趙元任國語羅馬字除外), + /// 用 Strings 反而省事一些。
+ /// 這裡同時兼容大千注音的調號數字,所以也將 6、7 號數字鍵放在允許範圍內。 + ///
+ public const string MapWadeGilesPinyinKeys = MapArayuruPinyin + "'"; + /// /// 任何拼音都會用到的聲調鍵陣列 /// @@ -1065,6 +1073,149 @@ public readonly static ( ["o"] = "ㄛ", ["e"] = "ㄜ", ["a"] = "ㄚ" }; + /// + /// 韋氏拼音排列專用處理陣列 + /// + public readonly static Dictionary MapWadeGilesPinyin = new() { + ["a"] = "ㄚ", ["ai"] = "ㄞ", ["an"] = "ㄢ", + ["ang"] = "ㄤ", ["ao"] = "ㄠ", ["cha"] = "ㄓㄚ", + ["chai"] = "ㄓㄞ", ["chan"] = "ㄓㄢ", ["chang"] = "ㄓㄤ", + ["chao"] = "ㄓㄠ", ["che"] = "ㄓㄜ", ["chei"] = "ㄓㄟ", + ["chen"] = "ㄓㄣ", ["cheng"] = "ㄓㄥ", ["chi"] = "ㄐㄧ", + ["chia"] = "ㄐㄧㄚ", ["chiang"] = "ㄐㄧㄤ", ["chiao"] = "ㄐㄧㄠ", + ["chieh"] = "ㄐㄧㄝ", ["chien"] = "ㄐㄧㄢ", ["chih"] = "ㄓ", + ["chin"] = "ㄐㄧㄣ", ["ching"] = "ㄐㄧㄥ", ["chiu"] = "ㄐㄧㄡ", + ["chiung"] = "ㄐㄩㄥ", ["cho"] = "ㄓㄨㄛ", ["chou"] = "ㄓㄡ", + ["chu"] = "ㄓㄨ", ["chua"] = "ㄓㄨㄚ", ["chuai"] = "ㄓㄨㄞ", + ["chuan"] = "ㄓㄨㄢ", ["chuang"] = "ㄓㄨㄤ", ["chui"] = "ㄓㄨㄟ", + ["chun"] = "ㄓㄨㄣ", ["chung"] = "ㄓㄨㄥ", ["ch'a"] = "ㄔㄚ", + ["ch'ai"] = "ㄔㄞ", ["ch'an"] = "ㄔㄢ", ["ch'ang"] = "ㄔㄤ", + ["ch'ao"] = "ㄔㄠ", ["ch'e"] = "ㄔㄜ", ["ch'en"] = "ㄔㄣ", + ["ch'eng"] = "ㄔㄥ", ["ch'i"] = "ㄑㄧ", ["ch'ia"] = "ㄑㄧㄚ", + ["ch'iang"] = "ㄑㄧㄤ", ["ch'iao"] = "ㄑㄧㄠ", ["ch'ieh"] = "ㄑㄧㄝ", + ["ch'ien"] = "ㄑㄧㄢ", ["ch'ih"] = "ㄔ", ["ch'in"] = "ㄑㄧㄣ", + ["ch'ing"] = "ㄑㄧㄥ", ["ch'iu"] = "ㄑㄧㄡ", ["ch'iung"] = "ㄑㄩㄥ", + ["ch'o"] = "ㄔㄨㄛ", ["ch'ou"] = "ㄔㄡ", ["ch'u"] = "ㄔㄨ", + ["ch'ua"] = "ㄔㄨㄚ", ["ch'uai"] = "ㄔㄨㄞ", ["ch'uan"] = "ㄔㄨㄢ", + ["ch'uang"] = "ㄔㄨㄤ", ["ch'ui"] = "ㄔㄨㄟ", ["ch'un"] = "ㄔㄨㄣ", + ["ch'ung"] = "ㄔㄨㄥ", ["ch'v"] = "ㄑㄩ", ["ch'van"] = "ㄑㄩㄢ", + ["ch'veh"] = "ㄑㄩㄝ", ["ch'vn"] = "ㄑㄩㄣ", ["chv"] = "ㄐㄩ", + ["chvan"] = "ㄐㄩㄢ", ["chveh"] = "ㄐㄩㄝ", ["chvn"] = "ㄐㄩㄣ", + ["e"] = "ㄜ", ["ei"] = "ㄟ", ["en"] = "ㄣ", + ["erh"] = "ㄦ", ["fa"] = "ㄈㄚ", ["fan"] = "ㄈㄢ", + ["fang"] = "ㄈㄤ", ["fei"] = "ㄈㄟ", ["fen"] = "ㄈㄣ", + ["feng"] = "ㄈㄥ", ["fo"] = "ㄈㄛ", ["fou"] = "ㄈㄡ", + ["fu"] = "ㄈㄨ", ["ha"] = "ㄏㄚ", ["hai"] = "ㄏㄞ", + ["han"] = "ㄏㄢ", ["hang"] = "ㄏㄤ", ["hao"] = "ㄏㄠ", + ["hei"] = "ㄏㄟ", ["hen"] = "ㄏㄣ", ["heng"] = "ㄏㄥ", + ["ho"] = "ㄏㄜ", ["hou"] = "ㄏㄡ", ["hsi"] = "ㄒㄧ", + ["hsia"] = "ㄒㄧㄚ", ["hsiang"] = "ㄒㄧㄤ", ["hsiao"] = "ㄒㄧㄠ", + ["hsieh"] = "ㄒㄧㄝ", ["hsien"] = "ㄒㄧㄢ", ["hsin"] = "ㄒㄧㄣ", + ["hsing"] = "ㄒㄧㄥ", ["hsiu"] = "ㄒㄧㄡ", ["hsiung"] = "ㄒㄩㄥ", + ["hsv"] = "ㄒㄩ", ["hsvan"] = "ㄒㄩㄢ", ["hsveh"] = "ㄒㄩㄝ", + ["hsvn"] = "ㄒㄩㄣ", ["hu"] = "ㄏㄨ", ["hua"] = "ㄏㄨㄚ", + ["huai"] = "ㄏㄨㄞ", ["huan"] = "ㄏㄨㄢ", ["huang"] = "ㄏㄨㄤ", + ["hui"] = "ㄏㄨㄟ", ["hun"] = "ㄏㄨㄣ", ["hung"] = "ㄏㄨㄥ", + ["huo"] = "ㄏㄨㄛ", ["i"] = "ㄧ", ["jan"] = "ㄖㄢ", + ["jang"] = "ㄖㄤ", ["jao"] = "ㄖㄠ", ["je"] = "ㄖㄜ", + ["jen"] = "ㄖㄣ", ["jeng"] = "ㄖㄥ", ["jih"] = "ㄖ", + ["jo"] = "ㄖㄨㄛ", ["jou"] = "ㄖㄡ", ["ju"] = "ㄖㄨ", + ["juan"] = "ㄖㄨㄢ", ["jui"] = "ㄖㄨㄟ", ["jun"] = "ㄖㄨㄣ", + ["jung"] = "ㄖㄨㄥ", ["ka"] = "ㄍㄚ", ["kai"] = "ㄍㄞ", + ["kan"] = "ㄍㄢ", ["kang"] = "ㄍㄤ", ["kao"] = "ㄍㄠ", + ["kei"] = "ㄍㄟ", ["ken"] = "ㄍㄣ", ["keng"] = "ㄍㄥ", + ["ko"] = "ㄍㄜ", ["kou"] = "ㄍㄡ", ["ku"] = "ㄍㄨ", + ["kua"] = "ㄍㄨㄚ", ["kuai"] = "ㄍㄨㄞ", ["kuan"] = "ㄍㄨㄢ", + ["kuang"] = "ㄍㄨㄤ", ["kuei"] = "ㄍㄨㄟ", ["kun"] = "ㄍㄨㄣ", + ["kung"] = "ㄍㄨㄥ", ["kuo"] = "ㄍㄨㄛ", ["k'a"] = "ㄎㄚ", + ["k'ai"] = "ㄎㄞ", ["k'an"] = "ㄎㄢ", ["k'ang"] = "ㄎㄤ", + ["k'ao"] = "ㄎㄠ", ["k'en"] = "ㄎㄣ", ["k'eng"] = "ㄎㄥ", + ["k'o"] = "ㄎㄜ", ["k'ou"] = "ㄎㄡ", ["k'u"] = "ㄎㄨ", + ["k'ua"] = "ㄎㄨㄚ", ["k'uai"] = "ㄎㄨㄞ", ["k'uan"] = "ㄎㄨㄢ", + ["k'uang"] = "ㄎㄨㄤ", ["k'uei"] = "ㄎㄨㄟ", ["k'un"] = "ㄎㄨㄣ", + ["k'ung"] = "ㄎㄨㄥ", ["k'uo"] = "ㄎㄨㄛ", ["la"] = "ㄌㄚ", + ["lai"] = "ㄌㄞ", ["lan"] = "ㄌㄢ", ["lang"] = "ㄌㄤ", + ["lao"] = "ㄌㄠ", ["le"] = "ㄌㄜ", ["lei"] = "ㄌㄟ", + ["leng"] = "ㄌㄥ", ["li"] = "ㄌㄧ", ["lia"] = "ㄌㄧㄚ", + ["liang"] = "ㄌㄧㄤ", ["liao"] = "ㄌㄧㄠ", ["lieh"] = "ㄌㄧㄝ", + ["lien"] = "ㄌㄧㄢ", ["lin"] = "ㄌㄧㄣ", ["ling"] = "ㄌㄧㄥ", + ["liu"] = "ㄌㄧㄡ", ["lo"] = "ㄌㄨㄛ", ["lou"] = "ㄌㄡ", + ["lu"] = "ㄌㄨ", ["luan"] = "ㄌㄨㄢ", ["lun"] = "ㄌㄨㄣ", + ["lung"] = "ㄌㄨㄥ", ["lv"] = "ㄌㄩ", ["lveh"] = "ㄌㄩㄝ", + ["lvn"] = "ㄌㄩㄣ", ["ma"] = "ㄇㄚ", ["mai"] = "ㄇㄞ", + ["man"] = "ㄇㄢ", ["mang"] = "ㄇㄤ", ["mao"] = "ㄇㄠ", + ["me"] = "ㄇㄜ", ["mei"] = "ㄇㄟ", ["men"] = "ㄇㄣ", + ["meng"] = "ㄇㄥ", ["mi"] = "ㄇㄧ", ["miao"] = "ㄇㄧㄠ", + ["mieh"] = "ㄇㄧㄝ", ["mien"] = "ㄇㄧㄢ", ["min"] = "ㄇㄧㄣ", + ["ming"] = "ㄇㄧㄥ", ["miu"] = "ㄇㄧㄡ", ["mo"] = "ㄇㄛ", + ["mou"] = "ㄇㄡ", ["mu"] = "ㄇㄨ", ["na"] = "ㄋㄚ", + ["nai"] = "ㄋㄞ", ["nan"] = "ㄋㄢ", ["nang"] = "ㄋㄤ", + ["nao"] = "ㄋㄠ", ["ne"] = "ㄋㄜ", ["nei"] = "ㄋㄟ", + ["nen"] = "ㄋㄣ", ["neng"] = "ㄋㄥ", ["ni"] = "ㄋㄧ", + ["nia"] = "ㄋㄧㄚ", ["niang"] = "ㄋㄧㄤ", ["niao"] = "ㄋㄧㄠ", + ["nieh"] = "ㄋㄧㄝ", ["nien"] = "ㄋㄧㄢ", ["nin"] = "ㄋㄧㄣ", + ["ning"] = "ㄋㄧㄥ", ["niu"] = "ㄋㄧㄡ", ["no"] = "ㄋㄨㄛ", + ["nou"] = "ㄋㄡ", ["nu"] = "ㄋㄨ", ["nuan"] = "ㄋㄨㄢ", + ["nun"] = "ㄋㄨㄣ", ["nung"] = "ㄋㄨㄥ", ["nv"] = "ㄋㄩ", + ["nveh"] = "ㄋㄩㄝ", ["ou"] = "ㄡ", ["pa"] = "ㄅㄚ", + ["pai"] = "ㄅㄞ", ["pan"] = "ㄅㄢ", ["pang"] = "ㄅㄤ", + ["pao"] = "ㄅㄠ", ["pei"] = "ㄅㄟ", ["pen"] = "ㄅㄣ", + ["peng"] = "ㄅㄥ", ["pi"] = "ㄅㄧ", ["piao"] = "ㄅㄧㄠ", + ["pieh"] = "ㄅㄧㄝ", ["pien"] = "ㄅㄧㄢ", ["pin"] = "ㄅㄧㄣ", + ["ping"] = "ㄅㄧㄥ", ["po"] = "ㄅㄛ", ["pu"] = "ㄅㄨ", + ["p'a"] = "ㄆㄚ", ["p'ai"] = "ㄆㄞ", ["p'an"] = "ㄆㄢ", + ["p'ang"] = "ㄆㄤ", ["p'ao"] = "ㄆㄠ", ["p'ei"] = "ㄆㄟ", + ["p'en"] = "ㄆㄣ", ["p'eng"] = "ㄆㄥ", ["p'i"] = "ㄆㄧ", + ["p'iao"] = "ㄆㄧㄠ", ["p'ieh"] = "ㄆㄧㄝ", ["p'ien"] = "ㄆㄧㄢ", + ["p'in"] = "ㄆㄧㄣ", ["p'ing"] = "ㄆㄧㄥ", ["p'o"] = "ㄆㄛ", + ["p'ou"] = "ㄆㄡ", ["p'u"] = "ㄆㄨ", ["sa"] = "ㄙㄚ", + ["sai"] = "ㄙㄞ", ["san"] = "ㄙㄢ", ["sang"] = "ㄙㄤ", + ["sao"] = "ㄙㄠ", ["se"] = "ㄙㄜ", ["sei"] = "ㄙㄟ", + ["sen"] = "ㄙㄣ", ["seng"] = "ㄙㄥ", ["sha"] = "ㄕㄚ", + ["shai"] = "ㄕㄞ", ["shan"] = "ㄕㄢ", ["shang"] = "ㄕㄤ", + ["shao"] = "ㄕㄠ", ["she"] = "ㄕㄜ", ["shei"] = "ㄕㄟ", + ["shen"] = "ㄕㄣ", ["sheng"] = "ㄕㄥ", ["shih"] = "ㄕ", + ["shou"] = "ㄕㄡ", ["shu"] = "ㄕㄨ", ["shua"] = "ㄕㄨㄚ", + ["shuai"] = "ㄕㄨㄞ", ["shuan"] = "ㄕㄨㄢ", ["shuang"] = "ㄕㄨㄤ", + ["shui"] = "ㄕㄨㄟ", ["shun"] = "ㄕㄨㄣ", ["shung"] = "ㄕㄨㄥ", + ["shuo"] = "ㄕㄨㄛ", ["so"] = "ㄙㄨㄛ", ["sou"] = "ㄙㄡ", + ["ssu"] = "ㄙ", ["su"] = "ㄙㄨ", ["suan"] = "ㄙㄨㄢ", + ["sui"] = "ㄙㄨㄟ", ["sun"] = "ㄙㄨㄣ", ["sung"] = "ㄙㄨㄥ", + ["ta"] = "ㄉㄚ", ["tai"] = "ㄉㄞ", ["tan"] = "ㄉㄢ", + ["tang"] = "ㄉㄤ", ["tao"] = "ㄉㄠ", ["te"] = "ㄉㄜ", + ["tei"] = "ㄉㄟ", ["ten"] = "ㄉㄣ", ["teng"] = "ㄉㄥ", + ["ti"] = "ㄉㄧ", ["tiang"] = "ㄉㄧㄤ", ["tiao"] = "ㄉㄧㄠ", + ["tieh"] = "ㄉㄧㄝ", ["tien"] = "ㄉㄧㄢ", ["ting"] = "ㄉㄧㄥ", + ["tiu"] = "ㄉㄧㄡ", ["to"] = "ㄉㄨㄛ", ["tou"] = "ㄉㄡ", + ["tsa"] = "ㄗㄚ", ["tsai"] = "ㄗㄞ", ["tsan"] = "ㄗㄢ", + ["tsang"] = "ㄗㄤ", ["tsao"] = "ㄗㄠ", ["tse"] = "ㄗㄜ", + ["tsei"] = "ㄗㄟ", ["tsen"] = "ㄗㄣ", ["tseng"] = "ㄗㄥ", + ["tso"] = "ㄗㄨㄛ", ["tsou"] = "ㄗㄡ", ["tsu"] = "ㄗㄨ", + ["tsuan"] = "ㄗㄨㄢ", ["tsui"] = "ㄗㄨㄟ", ["tsun"] = "ㄗㄨㄣ", + ["tsung"] = "ㄗㄨㄥ", ["ts'a"] = "ㄘㄚ", ["ts'ai"] = "ㄘㄞ", + ["ts'an"] = "ㄘㄢ", ["ts'ang"] = "ㄘㄤ", ["ts'ao"] = "ㄘㄠ", + ["ts'e"] = "ㄘㄜ", ["ts'en"] = "ㄘㄣ", ["ts'eng"] = "ㄘㄥ", + ["ts'o"] = "ㄘㄨㄛ", ["ts'ou"] = "ㄘㄡ", ["ts'u"] = "ㄘㄨ", + ["ts'uan"] = "ㄘㄨㄢ", ["ts'ui"] = "ㄘㄨㄟ", ["ts'un"] = "ㄘㄨㄣ", + ["ts'ung"] = "ㄘㄨㄥ", ["tu"] = "ㄉㄨ", ["tuan"] = "ㄉㄨㄢ", + ["tui"] = "ㄉㄨㄟ", ["tun"] = "ㄉㄨㄣ", ["tung"] = "ㄉㄨㄥ", + ["tzu"] = "ㄗ", ["tz'u"] = "ㄘ", ["t'a"] = "ㄊㄚ", + ["t'ai"] = "ㄊㄞ", ["t'an"] = "ㄊㄢ", ["t'ang"] = "ㄊㄤ", + ["t'ao"] = "ㄊㄠ", ["t'e"] = "ㄊㄜ", ["t'eng"] = "ㄊㄥ", + ["t'i"] = "ㄊㄧ", ["t'iao"] = "ㄊㄧㄠ", ["t'ieh"] = "ㄊㄧㄝ", + ["t'ien"] = "ㄊㄧㄢ", ["t'ing"] = "ㄊㄧㄥ", ["t'o"] = "ㄊㄨㄛ", + ["t'ou"] = "ㄊㄡ", ["t'u"] = "ㄊㄨ", ["t'uan"] = "ㄊㄨㄢ", + ["t'ui"] = "ㄊㄨㄟ", ["t'un"] = "ㄊㄨㄣ", ["t'ung"] = "ㄊㄨㄥ", + ["wa"] = "ㄨㄚ", ["wai"] = "ㄨㄞ", ["wan"] = "ㄨㄢ", + ["wang"] = "ㄨㄤ", ["wei"] = "ㄨㄟ", ["wen"] = "ㄨㄣ", + ["weng"] = "ㄨㄥ", ["wo"] = "ㄨㄛ", ["wu"] = "ㄨ", + ["ya"] = "ㄧㄚ", ["yan"] = "ㄧㄢ", ["yang"] = "ㄧㄤ", + ["yao"] = "ㄧㄠ", ["yeh"] = "ㄧㄝ", ["yin"] = "ㄧㄣ", + ["ying"] = "ㄧㄥ", ["yu"] = "ㄧㄡ", ["yung"] = "ㄩㄥ", + ["yv"] = "ㄩ", ["yvan"] = "ㄩㄢ", ["yveh"] = "ㄩㄝ", + ["yvn"] = "ㄩㄣ" + }; + // MARK: - Maps for Keyboard-to-Phonabet parsers /// @@ -1229,9 +1380,9 @@ public readonly static ( /// 用以判定「是否是拼音鍵盤佈局」的集合。 /// public readonly static MandarinParser[] ArrPinyinParsers = { - MandarinParser.OfHanyuPinyin, MandarinParser.OfSecondaryPinyin, - MandarinParser.OfYalePinyin, MandarinParser.OfHualuoPinyin, - MandarinParser.OfUniversalPinyin + MandarinParser.OfHanyuPinyin, MandarinParser.OfSecondaryPinyin, + MandarinParser.OfYalePinyin, MandarinParser.OfHualuoPinyin, + MandarinParser.OfUniversalPinyin, MandarinParser.OfWadeGilesPinyin }; } } \ No newline at end of file diff --git a/Tekkon/Tekkon.csproj b/Tekkon/Tekkon.csproj index 3855fac..f6f8a77 100644 --- a/Tekkon/Tekkon.csproj +++ b/Tekkon/Tekkon.csproj @@ -3,16 +3,16 @@ net6.0 65001 - 1.3.2 + 1.4.0 vChewing.Tekkon Shiki Suen Atelier Inmu (c) 2022 and onwards The vChewing Project (MIT-NTL License). https://github.com/ShikiSuen/TekkonNT zh-TW - 1.3.2 - 1.3.2 - 1.3.2 + 1.4.0 + 1.4.0 + 1.4.0 Tekkon True README.md