UPE // Remove Hanyu-Pinyin conversion.
This commit is contained in:
parent
c0580c5917
commit
5b4ca64505
|
@ -78,7 +78,7 @@ class Document: NSDocument {
|
|||
/// - Tag: readExample
|
||||
override func read(from data: Data, ofType _: String) throws {
|
||||
var strToDealWith = String(decoding: data, as: UTF8.self)
|
||||
strToDealWith.formatConsolidate(cnvHYPYtoBPMF: false)
|
||||
strToDealWith.formatConsolidate()
|
||||
let processedIncomingData = Data(strToDealWith.utf8)
|
||||
content.read(from: processedIncomingData)
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ class Document: NSDocument {
|
|||
/// - Tag: writeExample
|
||||
override func data(ofType _: String) throws -> Data {
|
||||
var strToDealWith = content.contentString
|
||||
strToDealWith.formatConsolidate(cnvHYPYtoBPMF: true)
|
||||
strToDealWith.formatConsolidate()
|
||||
let outputData = Data(strToDealWith.utf8)
|
||||
return outputData
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ extension String {
|
|||
self = replacingOccurrences(of: strOf, with: strWith)
|
||||
}
|
||||
|
||||
mutating func formatConsolidate(cnvHYPYtoBPMF: Bool) {
|
||||
mutating func formatConsolidate() {
|
||||
// Step 1: Consolidating formats per line.
|
||||
var strProcessed = self
|
||||
// 預處理格式
|
||||
|
@ -64,442 +64,6 @@ extension String {
|
|||
strProcessed.removeLast()
|
||||
}
|
||||
|
||||
if cnvHYPYtoBPMF {
|
||||
// Step 2: Convert HanyuPinyin to Bopomofo.
|
||||
// 漢語拼音轉注音,得先從最長的可能的拼音組合開始轉起,
|
||||
// 這樣等轉換到更短的可能的漢語拼音組合時就不會出錯。
|
||||
// 依此類推,聲調放在最後來轉換。
|
||||
strProcessed.selfReplace("chuang", "ㄔㄨㄤ")
|
||||
strProcessed.selfReplace("shuang", "ㄕㄨㄤ")
|
||||
strProcessed.selfReplace("zhuang", "ㄓㄨㄤ")
|
||||
strProcessed.selfReplace("chang", "ㄔㄤ")
|
||||
strProcessed.selfReplace("cheng", "ㄔㄥ")
|
||||
strProcessed.selfReplace("chong", "ㄔㄨㄥ")
|
||||
strProcessed.selfReplace("chuai", "ㄔㄨㄞ")
|
||||
strProcessed.selfReplace("chuan", "ㄔㄨㄢ")
|
||||
strProcessed.selfReplace("guang", "ㄍㄨㄤ")
|
||||
strProcessed.selfReplace("huang", "ㄏㄨㄤ")
|
||||
strProcessed.selfReplace("jiang", "ㄐㄧㄤ")
|
||||
strProcessed.selfReplace("jiong", "ㄐㄩㄥ")
|
||||
strProcessed.selfReplace("kuang", "ㄎㄨㄤ")
|
||||
strProcessed.selfReplace("liang", "ㄌㄧㄤ")
|
||||
strProcessed.selfReplace("niang", "ㄋㄧㄤ")
|
||||
strProcessed.selfReplace("qiang", "ㄑㄧㄤ")
|
||||
strProcessed.selfReplace("qiong", "ㄑㄩㄥ")
|
||||
strProcessed.selfReplace("shang", "ㄕㄤ")
|
||||
strProcessed.selfReplace("sheng", "ㄕㄥ")
|
||||
strProcessed.selfReplace("shuai", "ㄕㄨㄞ")
|
||||
strProcessed.selfReplace("shuan", "ㄕㄨㄢ")
|
||||
strProcessed.selfReplace("xiang", "ㄒㄧㄤ")
|
||||
strProcessed.selfReplace("xiong", "ㄒㄩㄥ")
|
||||
strProcessed.selfReplace("zhang", "ㄓㄤ")
|
||||
strProcessed.selfReplace("zheng", "ㄓㄥ")
|
||||
strProcessed.selfReplace("zhong", "ㄓㄨㄥ")
|
||||
strProcessed.selfReplace("zhuai", "ㄓㄨㄞ")
|
||||
strProcessed.selfReplace("zhuan", "ㄓㄨㄢ")
|
||||
strProcessed.selfReplace("bang", "ㄅㄤ")
|
||||
strProcessed.selfReplace("beng", "ㄅㄥ")
|
||||
strProcessed.selfReplace("bian", "ㄅㄧㄢ")
|
||||
strProcessed.selfReplace("biao", "ㄅㄧㄠ")
|
||||
strProcessed.selfReplace("bing", "ㄅㄧㄥ")
|
||||
strProcessed.selfReplace("cang", "ㄘㄤ")
|
||||
strProcessed.selfReplace("ceng", "ㄘㄥ")
|
||||
strProcessed.selfReplace("chai", "ㄔㄞ")
|
||||
strProcessed.selfReplace("chan", "ㄔㄢ")
|
||||
strProcessed.selfReplace("chao", "ㄔㄠ")
|
||||
strProcessed.selfReplace("chen", "ㄔㄣ")
|
||||
strProcessed.selfReplace("chou", "ㄔㄡ")
|
||||
strProcessed.selfReplace("chua", "ㄔㄨㄚ")
|
||||
strProcessed.selfReplace("chui", "ㄔㄨㄟ")
|
||||
strProcessed.selfReplace("chun", "ㄔㄨㄣ")
|
||||
strProcessed.selfReplace("chuo", "ㄔㄨㄛ")
|
||||
strProcessed.selfReplace("cong", "ㄘㄨㄥ")
|
||||
strProcessed.selfReplace("cuan", "ㄘㄨㄢ")
|
||||
strProcessed.selfReplace("dang", "ㄉㄤ")
|
||||
strProcessed.selfReplace("deng", "ㄉㄥ")
|
||||
strProcessed.selfReplace("dian", "ㄉㄧㄢ")
|
||||
strProcessed.selfReplace("diao", "ㄉㄧㄠ")
|
||||
strProcessed.selfReplace("ding", "ㄉㄧㄥ")
|
||||
strProcessed.selfReplace("dong", "ㄉㄨㄥ")
|
||||
strProcessed.selfReplace("duan", "ㄉㄨㄢ")
|
||||
strProcessed.selfReplace("fang", "ㄈㄤ")
|
||||
strProcessed.selfReplace("feng", "ㄈㄥ")
|
||||
strProcessed.selfReplace("fiao", "ㄈㄧㄠ")
|
||||
strProcessed.selfReplace("fong", "ㄈㄨㄥ")
|
||||
strProcessed.selfReplace("gang", "ㄍㄤ")
|
||||
strProcessed.selfReplace("geng", "ㄍㄥ")
|
||||
strProcessed.selfReplace("giao", "ㄍㄧㄠ")
|
||||
strProcessed.selfReplace("gong", "ㄍㄨㄥ")
|
||||
strProcessed.selfReplace("guai", "ㄍㄨㄞ")
|
||||
strProcessed.selfReplace("guan", "ㄍㄨㄢ")
|
||||
strProcessed.selfReplace("hang", "ㄏㄤ")
|
||||
strProcessed.selfReplace("heng", "ㄏㄥ")
|
||||
strProcessed.selfReplace("hong", "ㄏㄨㄥ")
|
||||
strProcessed.selfReplace("huai", "ㄏㄨㄞ")
|
||||
strProcessed.selfReplace("huan", "ㄏㄨㄢ")
|
||||
strProcessed.selfReplace("jian", "ㄐㄧㄢ")
|
||||
strProcessed.selfReplace("jiao", "ㄐㄧㄠ")
|
||||
strProcessed.selfReplace("jing", "ㄐㄧㄥ")
|
||||
strProcessed.selfReplace("juan", "ㄐㄩㄢ")
|
||||
strProcessed.selfReplace("kang", "ㄎㄤ")
|
||||
strProcessed.selfReplace("keng", "ㄎㄥ")
|
||||
strProcessed.selfReplace("kong", "ㄎㄨㄥ")
|
||||
strProcessed.selfReplace("kuai", "ㄎㄨㄞ")
|
||||
strProcessed.selfReplace("kuan", "ㄎㄨㄢ")
|
||||
strProcessed.selfReplace("lang", "ㄌㄤ")
|
||||
strProcessed.selfReplace("leng", "ㄌㄥ")
|
||||
strProcessed.selfReplace("lian", "ㄌㄧㄢ")
|
||||
strProcessed.selfReplace("liao", "ㄌㄧㄠ")
|
||||
strProcessed.selfReplace("ling", "ㄌㄧㄥ")
|
||||
strProcessed.selfReplace("long", "ㄌㄨㄥ")
|
||||
strProcessed.selfReplace("luan", "ㄌㄨㄢ")
|
||||
strProcessed.selfReplace("lvan", "ㄌㄩㄢ")
|
||||
strProcessed.selfReplace("mang", "ㄇㄤ")
|
||||
strProcessed.selfReplace("meng", "ㄇㄥ")
|
||||
strProcessed.selfReplace("mian", "ㄇㄧㄢ")
|
||||
strProcessed.selfReplace("miao", "ㄇㄧㄠ")
|
||||
strProcessed.selfReplace("ming", "ㄇㄧㄥ")
|
||||
strProcessed.selfReplace("nang", "ㄋㄤ")
|
||||
strProcessed.selfReplace("neng", "ㄋㄥ")
|
||||
strProcessed.selfReplace("nian", "ㄋㄧㄢ")
|
||||
strProcessed.selfReplace("niao", "ㄋㄧㄠ")
|
||||
strProcessed.selfReplace("ning", "ㄋㄧㄥ")
|
||||
strProcessed.selfReplace("nong", "ㄋㄨㄥ")
|
||||
strProcessed.selfReplace("nuan", "ㄋㄨㄢ")
|
||||
strProcessed.selfReplace("pang", "ㄆㄤ")
|
||||
strProcessed.selfReplace("peng", "ㄆㄥ")
|
||||
strProcessed.selfReplace("pian", "ㄆㄧㄢ")
|
||||
strProcessed.selfReplace("piao", "ㄆㄧㄠ")
|
||||
strProcessed.selfReplace("ping", "ㄆㄧㄥ")
|
||||
strProcessed.selfReplace("qian", "ㄑㄧㄢ")
|
||||
strProcessed.selfReplace("qiao", "ㄑㄧㄠ")
|
||||
strProcessed.selfReplace("qing", "ㄑㄧㄥ")
|
||||
strProcessed.selfReplace("quan", "ㄑㄩㄢ")
|
||||
strProcessed.selfReplace("rang", "ㄖㄤ")
|
||||
strProcessed.selfReplace("reng", "ㄖㄥ")
|
||||
strProcessed.selfReplace("rong", "ㄖㄨㄥ")
|
||||
strProcessed.selfReplace("ruan", "ㄖㄨㄢ")
|
||||
strProcessed.selfReplace("sang", "ㄙㄤ")
|
||||
strProcessed.selfReplace("seng", "ㄙㄥ")
|
||||
strProcessed.selfReplace("shai", "ㄕㄞ")
|
||||
strProcessed.selfReplace("shan", "ㄕㄢ")
|
||||
strProcessed.selfReplace("shao", "ㄕㄠ")
|
||||
strProcessed.selfReplace("shei", "ㄕㄟ")
|
||||
strProcessed.selfReplace("shen", "ㄕㄣ")
|
||||
strProcessed.selfReplace("shou", "ㄕㄡ")
|
||||
strProcessed.selfReplace("shua", "ㄕㄨㄚ")
|
||||
strProcessed.selfReplace("shui", "ㄕㄨㄟ")
|
||||
strProcessed.selfReplace("shun", "ㄕㄨㄣ")
|
||||
strProcessed.selfReplace("shuo", "ㄕㄨㄛ")
|
||||
strProcessed.selfReplace("song", "ㄙㄨㄥ")
|
||||
strProcessed.selfReplace("suan", "ㄙㄨㄢ")
|
||||
strProcessed.selfReplace("tang", "ㄊㄤ")
|
||||
strProcessed.selfReplace("teng", "ㄊㄥ")
|
||||
strProcessed.selfReplace("tian", "ㄊㄧㄢ")
|
||||
strProcessed.selfReplace("tiao", "ㄊㄧㄠ")
|
||||
strProcessed.selfReplace("ting", "ㄊㄧㄥ")
|
||||
strProcessed.selfReplace("tong", "ㄊㄨㄥ")
|
||||
strProcessed.selfReplace("tuan", "ㄊㄨㄢ")
|
||||
strProcessed.selfReplace("wang", "ㄨㄤ")
|
||||
strProcessed.selfReplace("weng", "ㄨㄥ")
|
||||
strProcessed.selfReplace("xian", "ㄒㄧㄢ")
|
||||
strProcessed.selfReplace("xiao", "ㄒㄧㄠ")
|
||||
strProcessed.selfReplace("xing", "ㄒㄧㄥ")
|
||||
strProcessed.selfReplace("xuan", "ㄒㄩㄢ")
|
||||
strProcessed.selfReplace("yang", "ㄧㄤ")
|
||||
strProcessed.selfReplace("ying", "ㄧㄥ")
|
||||
strProcessed.selfReplace("yong", "ㄩㄥ")
|
||||
strProcessed.selfReplace("yuan", "ㄩㄢ")
|
||||
strProcessed.selfReplace("zang", "ㄗㄤ")
|
||||
strProcessed.selfReplace("zeng", "ㄗㄥ")
|
||||
strProcessed.selfReplace("zhai", "ㄓㄞ")
|
||||
strProcessed.selfReplace("zhan", "ㄓㄢ")
|
||||
strProcessed.selfReplace("zhao", "ㄓㄠ")
|
||||
strProcessed.selfReplace("zhei", "ㄓㄟ")
|
||||
strProcessed.selfReplace("zhen", "ㄓㄣ")
|
||||
strProcessed.selfReplace("zhou", "ㄓㄡ")
|
||||
strProcessed.selfReplace("zhua", "ㄓㄨㄚ")
|
||||
strProcessed.selfReplace("zhui", "ㄓㄨㄟ")
|
||||
strProcessed.selfReplace("zhun", "ㄓㄨㄣ")
|
||||
strProcessed.selfReplace("zhuo", "ㄓㄨㄛ")
|
||||
strProcessed.selfReplace("zong", "ㄗㄨㄥ")
|
||||
strProcessed.selfReplace("zuan", "ㄗㄨㄢ")
|
||||
strProcessed.selfReplace("jun", "ㄐㄩㄣ")
|
||||
strProcessed.selfReplace("ang", "ㄤ")
|
||||
strProcessed.selfReplace("bai", "ㄅㄞ")
|
||||
strProcessed.selfReplace("ban", "ㄅㄢ")
|
||||
strProcessed.selfReplace("bao", "ㄅㄠ")
|
||||
strProcessed.selfReplace("bei", "ㄅㄟ")
|
||||
strProcessed.selfReplace("ben", "ㄅㄣ")
|
||||
strProcessed.selfReplace("bie", "ㄅㄧㄝ")
|
||||
strProcessed.selfReplace("bin", "ㄅㄧㄣ")
|
||||
strProcessed.selfReplace("cai", "ㄘㄞ")
|
||||
strProcessed.selfReplace("can", "ㄘㄢ")
|
||||
strProcessed.selfReplace("cao", "ㄘㄠ")
|
||||
strProcessed.selfReplace("cei", "ㄘㄟ")
|
||||
strProcessed.selfReplace("cen", "ㄘㄣ")
|
||||
strProcessed.selfReplace("cha", "ㄔㄚ")
|
||||
strProcessed.selfReplace("che", "ㄔㄜ")
|
||||
strProcessed.selfReplace("chi", "ㄔ")
|
||||
strProcessed.selfReplace("chu", "ㄔㄨ")
|
||||
strProcessed.selfReplace("cou", "ㄘㄡ")
|
||||
strProcessed.selfReplace("cui", "ㄘㄨㄟ")
|
||||
strProcessed.selfReplace("cun", "ㄘㄨㄣ")
|
||||
strProcessed.selfReplace("cuo", "ㄘㄨㄛ")
|
||||
strProcessed.selfReplace("dai", "ㄉㄞ")
|
||||
strProcessed.selfReplace("dan", "ㄉㄢ")
|
||||
strProcessed.selfReplace("dao", "ㄉㄠ")
|
||||
strProcessed.selfReplace("dei", "ㄉㄟ")
|
||||
strProcessed.selfReplace("den", "ㄉㄣ")
|
||||
strProcessed.selfReplace("dia", "ㄉㄧㄚ")
|
||||
strProcessed.selfReplace("die", "ㄉㄧㄝ")
|
||||
strProcessed.selfReplace("diu", "ㄉㄧㄡ")
|
||||
strProcessed.selfReplace("dou", "ㄉㄡ")
|
||||
strProcessed.selfReplace("dui", "ㄉㄨㄟ")
|
||||
strProcessed.selfReplace("dun", "ㄉㄨㄣ")
|
||||
strProcessed.selfReplace("duo", "ㄉㄨㄛ")
|
||||
strProcessed.selfReplace("eng", "ㄥ")
|
||||
strProcessed.selfReplace("fan", "ㄈㄢ")
|
||||
strProcessed.selfReplace("fei", "ㄈㄟ")
|
||||
strProcessed.selfReplace("fen", "ㄈㄣ")
|
||||
strProcessed.selfReplace("fou", "ㄈㄡ")
|
||||
strProcessed.selfReplace("gai", "ㄍㄞ")
|
||||
strProcessed.selfReplace("gan", "ㄍㄢ")
|
||||
strProcessed.selfReplace("gao", "ㄍㄠ")
|
||||
strProcessed.selfReplace("gei", "ㄍㄟ")
|
||||
strProcessed.selfReplace("gin", "ㄍㄧㄣ")
|
||||
strProcessed.selfReplace("gen", "ㄍㄣ")
|
||||
strProcessed.selfReplace("gou", "ㄍㄡ")
|
||||
strProcessed.selfReplace("gua", "ㄍㄨㄚ")
|
||||
strProcessed.selfReplace("gue", "ㄍㄨㄜ")
|
||||
strProcessed.selfReplace("gui", "ㄍㄨㄟ")
|
||||
strProcessed.selfReplace("gun", "ㄍㄨㄣ")
|
||||
strProcessed.selfReplace("guo", "ㄍㄨㄛ")
|
||||
strProcessed.selfReplace("hai", "ㄏㄞ")
|
||||
strProcessed.selfReplace("han", "ㄏㄢ")
|
||||
strProcessed.selfReplace("hao", "ㄏㄠ")
|
||||
strProcessed.selfReplace("hei", "ㄏㄟ")
|
||||
strProcessed.selfReplace("hen", "ㄏㄣ")
|
||||
strProcessed.selfReplace("hou", "ㄏㄡ")
|
||||
strProcessed.selfReplace("hua", "ㄏㄨㄚ")
|
||||
strProcessed.selfReplace("hui", "ㄏㄨㄟ")
|
||||
strProcessed.selfReplace("hun", "ㄏㄨㄣ")
|
||||
strProcessed.selfReplace("huo", "ㄏㄨㄛ")
|
||||
strProcessed.selfReplace("jia", "ㄐㄧㄚ")
|
||||
strProcessed.selfReplace("jie", "ㄐㄧㄝ")
|
||||
strProcessed.selfReplace("jin", "ㄐㄧㄣ")
|
||||
strProcessed.selfReplace("jiu", "ㄐㄧㄡ")
|
||||
strProcessed.selfReplace("jue", "ㄐㄩㄝ")
|
||||
strProcessed.selfReplace("kai", "ㄎㄞ")
|
||||
strProcessed.selfReplace("kan", "ㄎㄢ")
|
||||
strProcessed.selfReplace("kao", "ㄎㄠ")
|
||||
strProcessed.selfReplace("ken", "ㄎㄣ")
|
||||
strProcessed.selfReplace("kiu", "ㄎㄧㄡ")
|
||||
strProcessed.selfReplace("kou", "ㄎㄡ")
|
||||
strProcessed.selfReplace("kua", "ㄎㄨㄚ")
|
||||
strProcessed.selfReplace("kui", "ㄎㄨㄟ")
|
||||
strProcessed.selfReplace("kun", "ㄎㄨㄣ")
|
||||
strProcessed.selfReplace("kuo", "ㄎㄨㄛ")
|
||||
strProcessed.selfReplace("lai", "ㄌㄞ")
|
||||
strProcessed.selfReplace("lan", "ㄌㄢ")
|
||||
strProcessed.selfReplace("lao", "ㄌㄠ")
|
||||
strProcessed.selfReplace("lei", "ㄌㄟ")
|
||||
strProcessed.selfReplace("lia", "ㄌㄧㄚ")
|
||||
strProcessed.selfReplace("lie", "ㄌㄧㄝ")
|
||||
strProcessed.selfReplace("lin", "ㄌㄧㄣ")
|
||||
strProcessed.selfReplace("liu", "ㄌㄧㄡ")
|
||||
strProcessed.selfReplace("lou", "ㄌㄡ")
|
||||
strProcessed.selfReplace("lun", "ㄌㄨㄣ")
|
||||
strProcessed.selfReplace("luo", "ㄌㄨㄛ")
|
||||
strProcessed.selfReplace("lve", "ㄌㄩㄝ")
|
||||
strProcessed.selfReplace("mai", "ㄇㄞ")
|
||||
strProcessed.selfReplace("man", "ㄇㄢ")
|
||||
strProcessed.selfReplace("mao", "ㄇㄠ")
|
||||
strProcessed.selfReplace("mei", "ㄇㄟ")
|
||||
strProcessed.selfReplace("men", "ㄇㄣ")
|
||||
strProcessed.selfReplace("mie", "ㄇㄧㄝ")
|
||||
strProcessed.selfReplace("min", "ㄇㄧㄣ")
|
||||
strProcessed.selfReplace("miu", "ㄇㄧㄡ")
|
||||
strProcessed.selfReplace("mou", "ㄇㄡ")
|
||||
strProcessed.selfReplace("nai", "ㄋㄞ")
|
||||
strProcessed.selfReplace("nan", "ㄋㄢ")
|
||||
strProcessed.selfReplace("nao", "ㄋㄠ")
|
||||
strProcessed.selfReplace("nei", "ㄋㄟ")
|
||||
strProcessed.selfReplace("nen", "ㄋㄣ")
|
||||
strProcessed.selfReplace("nie", "ㄋㄧㄝ")
|
||||
strProcessed.selfReplace("nin", "ㄋㄧㄣ")
|
||||
strProcessed.selfReplace("niu", "ㄋㄧㄡ")
|
||||
strProcessed.selfReplace("nou", "ㄋㄡ")
|
||||
strProcessed.selfReplace("nui", "ㄋㄨㄟ")
|
||||
strProcessed.selfReplace("nun", "ㄋㄨㄣ")
|
||||
strProcessed.selfReplace("nuo", "ㄋㄨㄛ")
|
||||
strProcessed.selfReplace("nve", "ㄋㄩㄝ")
|
||||
strProcessed.selfReplace("pai", "ㄆㄞ")
|
||||
strProcessed.selfReplace("pan", "ㄆㄢ")
|
||||
strProcessed.selfReplace("pao", "ㄆㄠ")
|
||||
strProcessed.selfReplace("pei", "ㄆㄟ")
|
||||
strProcessed.selfReplace("pen", "ㄆㄣ")
|
||||
strProcessed.selfReplace("pia", "ㄆㄧㄚ")
|
||||
strProcessed.selfReplace("pie", "ㄆㄧㄝ")
|
||||
strProcessed.selfReplace("pin", "ㄆㄧㄣ")
|
||||
strProcessed.selfReplace("pou", "ㄆㄡ")
|
||||
strProcessed.selfReplace("qia", "ㄑㄧㄚ")
|
||||
strProcessed.selfReplace("qie", "ㄑㄧㄝ")
|
||||
strProcessed.selfReplace("qin", "ㄑㄧㄣ")
|
||||
strProcessed.selfReplace("qiu", "ㄑㄧㄡ")
|
||||
strProcessed.selfReplace("que", "ㄑㄩㄝ")
|
||||
strProcessed.selfReplace("qun", "ㄑㄩㄣ")
|
||||
strProcessed.selfReplace("ran", "ㄖㄢ")
|
||||
strProcessed.selfReplace("rao", "ㄖㄠ")
|
||||
strProcessed.selfReplace("ren", "ㄖㄣ")
|
||||
strProcessed.selfReplace("rou", "ㄖㄡ")
|
||||
strProcessed.selfReplace("rui", "ㄖㄨㄟ")
|
||||
strProcessed.selfReplace("run", "ㄖㄨㄣ")
|
||||
strProcessed.selfReplace("ruo", "ㄖㄨㄛ")
|
||||
strProcessed.selfReplace("sai", "ㄙㄞ")
|
||||
strProcessed.selfReplace("san", "ㄙㄢ")
|
||||
strProcessed.selfReplace("sao", "ㄙㄠ")
|
||||
strProcessed.selfReplace("sei", "ㄙㄟ")
|
||||
strProcessed.selfReplace("sen", "ㄙㄣ")
|
||||
strProcessed.selfReplace("sha", "ㄕㄚ")
|
||||
strProcessed.selfReplace("she", "ㄕㄜ")
|
||||
strProcessed.selfReplace("shi", "ㄕ")
|
||||
strProcessed.selfReplace("shu", "ㄕㄨ")
|
||||
strProcessed.selfReplace("sou", "ㄙㄡ")
|
||||
strProcessed.selfReplace("sui", "ㄙㄨㄟ")
|
||||
strProcessed.selfReplace("sun", "ㄙㄨㄣ")
|
||||
strProcessed.selfReplace("suo", "ㄙㄨㄛ")
|
||||
strProcessed.selfReplace("tai", "ㄊㄞ")
|
||||
strProcessed.selfReplace("tan", "ㄊㄢ")
|
||||
strProcessed.selfReplace("tao", "ㄊㄠ")
|
||||
strProcessed.selfReplace("tie", "ㄊㄧㄝ")
|
||||
strProcessed.selfReplace("tou", "ㄊㄡ")
|
||||
strProcessed.selfReplace("tui", "ㄊㄨㄟ")
|
||||
strProcessed.selfReplace("tun", "ㄊㄨㄣ")
|
||||
strProcessed.selfReplace("tuo", "ㄊㄨㄛ")
|
||||
strProcessed.selfReplace("wai", "ㄨㄞ")
|
||||
strProcessed.selfReplace("wan", "ㄨㄢ")
|
||||
strProcessed.selfReplace("wei", "ㄨㄟ")
|
||||
strProcessed.selfReplace("wen", "ㄨㄣ")
|
||||
strProcessed.selfReplace("xia", "ㄒㄧㄚ")
|
||||
strProcessed.selfReplace("xie", "ㄒㄧㄝ")
|
||||
strProcessed.selfReplace("xin", "ㄒㄧㄣ")
|
||||
strProcessed.selfReplace("xiu", "ㄒㄧㄡ")
|
||||
strProcessed.selfReplace("xue", "ㄒㄩㄝ")
|
||||
strProcessed.selfReplace("xun", "ㄒㄩㄣ")
|
||||
strProcessed.selfReplace("yai", "ㄧㄞ")
|
||||
strProcessed.selfReplace("yan", "ㄧㄢ")
|
||||
strProcessed.selfReplace("yao", "ㄧㄠ")
|
||||
strProcessed.selfReplace("yin", "ㄧㄣ")
|
||||
strProcessed.selfReplace("you", "ㄧㄡ")
|
||||
strProcessed.selfReplace("yue", "ㄩㄝ")
|
||||
strProcessed.selfReplace("yun", "ㄩㄣ")
|
||||
strProcessed.selfReplace("zai", "ㄗㄞ")
|
||||
strProcessed.selfReplace("zan", "ㄗㄢ")
|
||||
strProcessed.selfReplace("zao", "ㄗㄠ")
|
||||
strProcessed.selfReplace("zei", "ㄗㄟ")
|
||||
strProcessed.selfReplace("zen", "ㄗㄣ")
|
||||
strProcessed.selfReplace("zha", "ㄓㄚ")
|
||||
strProcessed.selfReplace("zhe", "ㄓㄜ")
|
||||
strProcessed.selfReplace("zhi", "ㄓ")
|
||||
strProcessed.selfReplace("zhu", "ㄓㄨ")
|
||||
strProcessed.selfReplace("zou", "ㄗㄡ")
|
||||
strProcessed.selfReplace("zui", "ㄗㄨㄟ")
|
||||
strProcessed.selfReplace("zun", "ㄗㄨㄣ")
|
||||
strProcessed.selfReplace("zuo", "ㄗㄨㄛ")
|
||||
strProcessed.selfReplace("ai", "ㄞ")
|
||||
strProcessed.selfReplace("an", "ㄢ")
|
||||
strProcessed.selfReplace("ao", "ㄠ")
|
||||
strProcessed.selfReplace("ba", "ㄅㄚ")
|
||||
strProcessed.selfReplace("bi", "ㄅㄧ")
|
||||
strProcessed.selfReplace("bo", "ㄅㄛ")
|
||||
strProcessed.selfReplace("bu", "ㄅㄨ")
|
||||
strProcessed.selfReplace("ca", "ㄘㄚ")
|
||||
strProcessed.selfReplace("ce", "ㄘㄜ")
|
||||
strProcessed.selfReplace("ci", "ㄘ")
|
||||
strProcessed.selfReplace("cu", "ㄘㄨ")
|
||||
strProcessed.selfReplace("da", "ㄉㄚ")
|
||||
strProcessed.selfReplace("de", "ㄉㄜ")
|
||||
strProcessed.selfReplace("di", "ㄉㄧ")
|
||||
strProcessed.selfReplace("du", "ㄉㄨ")
|
||||
strProcessed.selfReplace("eh", "ㄝ")
|
||||
strProcessed.selfReplace("ei", "ㄟ")
|
||||
strProcessed.selfReplace("en", "ㄣ")
|
||||
strProcessed.selfReplace("er", "ㄦ")
|
||||
strProcessed.selfReplace("fa", "ㄈㄚ")
|
||||
strProcessed.selfReplace("fo", "ㄈㄛ")
|
||||
strProcessed.selfReplace("fu", "ㄈㄨ")
|
||||
strProcessed.selfReplace("ga", "ㄍㄚ")
|
||||
strProcessed.selfReplace("ge", "ㄍㄜ")
|
||||
strProcessed.selfReplace("gi", "ㄍㄧ")
|
||||
strProcessed.selfReplace("gu", "ㄍㄨ")
|
||||
strProcessed.selfReplace("ha", "ㄏㄚ")
|
||||
strProcessed.selfReplace("he", "ㄏㄜ")
|
||||
strProcessed.selfReplace("hu", "ㄏㄨ")
|
||||
strProcessed.selfReplace("ji", "ㄐㄧ")
|
||||
strProcessed.selfReplace("ju", "ㄐㄩ")
|
||||
strProcessed.selfReplace("ka", "ㄎㄚ")
|
||||
strProcessed.selfReplace("ke", "ㄎㄜ")
|
||||
strProcessed.selfReplace("ku", "ㄎㄨ")
|
||||
strProcessed.selfReplace("la", "ㄌㄚ")
|
||||
strProcessed.selfReplace("le", "ㄌㄜ")
|
||||
strProcessed.selfReplace("li", "ㄌㄧ")
|
||||
strProcessed.selfReplace("lo", "ㄌㄛ")
|
||||
strProcessed.selfReplace("lu", "ㄌㄨ")
|
||||
strProcessed.selfReplace("lv", "ㄌㄩ")
|
||||
strProcessed.selfReplace("ma", "ㄇㄚ")
|
||||
strProcessed.selfReplace("me", "ㄇㄜ")
|
||||
strProcessed.selfReplace("mi", "ㄇㄧ")
|
||||
strProcessed.selfReplace("mo", "ㄇㄛ")
|
||||
strProcessed.selfReplace("mu", "ㄇㄨ")
|
||||
strProcessed.selfReplace("na", "ㄋㄚ")
|
||||
strProcessed.selfReplace("ne", "ㄋㄜ")
|
||||
strProcessed.selfReplace("ni", "ㄋㄧ")
|
||||
strProcessed.selfReplace("nu", "ㄋㄨ")
|
||||
strProcessed.selfReplace("nv", "ㄋㄩ")
|
||||
strProcessed.selfReplace("ou", "ㄡ")
|
||||
strProcessed.selfReplace("pa", "ㄆㄚ")
|
||||
strProcessed.selfReplace("pi", "ㄆㄧ")
|
||||
strProcessed.selfReplace("po", "ㄆㄛ")
|
||||
strProcessed.selfReplace("pu", "ㄆㄨ")
|
||||
strProcessed.selfReplace("qi", "ㄑㄧ")
|
||||
strProcessed.selfReplace("qu", "ㄑㄩ")
|
||||
strProcessed.selfReplace("re", "ㄖㄜ")
|
||||
strProcessed.selfReplace("ri", "ㄖ")
|
||||
strProcessed.selfReplace("ru", "ㄖㄨ")
|
||||
strProcessed.selfReplace("sa", "ㄙㄚ")
|
||||
strProcessed.selfReplace("se", "ㄙㄜ")
|
||||
strProcessed.selfReplace("si", "ㄙ")
|
||||
strProcessed.selfReplace("su", "ㄙㄨ")
|
||||
strProcessed.selfReplace("ta", "ㄊㄚ")
|
||||
strProcessed.selfReplace("te", "ㄊㄜ")
|
||||
strProcessed.selfReplace("ti", "ㄊㄧ")
|
||||
strProcessed.selfReplace("tu", "ㄊㄨ")
|
||||
strProcessed.selfReplace("wa", "ㄨㄚ")
|
||||
strProcessed.selfReplace("wo", "ㄨㄛ")
|
||||
strProcessed.selfReplace("wu", "ㄨ")
|
||||
strProcessed.selfReplace("xi", "ㄒㄧ")
|
||||
strProcessed.selfReplace("xu", "ㄒㄩ")
|
||||
strProcessed.selfReplace("ya", "ㄧㄚ")
|
||||
strProcessed.selfReplace("ye", "ㄧㄝ")
|
||||
strProcessed.selfReplace("yi", "ㄧ")
|
||||
strProcessed.selfReplace("yo", "ㄧㄛ")
|
||||
strProcessed.selfReplace("yu", "ㄩ")
|
||||
strProcessed.selfReplace("za", "ㄗㄚ")
|
||||
strProcessed.selfReplace("ze", "ㄗㄜ")
|
||||
strProcessed.selfReplace("zi", "ㄗ")
|
||||
strProcessed.selfReplace("zu", "ㄗㄨ")
|
||||
strProcessed.selfReplace("a", "ㄚ")
|
||||
strProcessed.selfReplace("e", "ㄜ")
|
||||
strProcessed.selfReplace("o", "ㄛ")
|
||||
strProcessed.selfReplace("q", "ㄑ")
|
||||
strProcessed.selfReplace("2", "ˊ")
|
||||
strProcessed.selfReplace("3", "ˇ")
|
||||
strProcessed.selfReplace("4", "ˋ")
|
||||
strProcessed.selfReplace("5", "˙")
|
||||
strProcessed.selfReplace("1", "")
|
||||
}
|
||||
|
||||
// Step 3: Add Formatted Pragma, the Sorted Header:
|
||||
let hdrFormatted = "# 𝙵𝙾𝚁𝙼𝙰𝚃 𝚘𝚛𝚐.𝚊𝚝𝚎𝚕𝚒𝚎𝚛𝙸𝚗𝚖𝚞.𝚟𝚌𝚑𝚎𝚠𝚒𝚗𝚐.𝚞𝚜𝚎𝚛𝙻𝚊𝚗𝚐𝚞𝚊𝚐𝚎𝙼𝚘𝚍𝚎𝚕𝙳𝚊𝚝𝚊.𝚏𝚘𝚛𝚖𝚊𝚝𝚝𝚎𝚍\n"
|
||||
strProcessed = hdrFormatted + strProcessed // Add Sorted Header
|
||||
|
|
Loading…
Reference in New Issue