mirror of
https://github.com/mii443/AzooKeyKanaKanjiConverter.git
synced 2025-08-22 15:05:26 +00:00
Merge pull request #121 from ensan-hcl/feat/support_extended_roman2kana_key_maps
feat: 「xn→ん」「ca→か」などを追加
This commit is contained in:
@ -394,7 +394,6 @@ extension ComposingText {
|
||||
return false
|
||||
}
|
||||
|
||||
// MARK: 利用されていないAPI
|
||||
static func isLeftSideValid(first firstElement: InputElement, of originalElements: [InputElement], from leftIndex: Int) -> Bool {
|
||||
// leftIndexの位置にある`el`のチェック
|
||||
// 許されるパターンは以下の通り
|
||||
@ -425,7 +424,7 @@ extension ComposingText {
|
||||
return true
|
||||
}
|
||||
let last_2 = originalElements[0 ..< leftIndex].suffix(2)
|
||||
if ["zl", "zk", "zj", "zh"].contains(last_2.reduce(into: "") {$0.append($1.character)}) {
|
||||
if ["zl", "zk", "zj", "zh", "xn"].contains(last_2.reduce(into: "") {$0.append($1.character)}) {
|
||||
return true
|
||||
}
|
||||
let n_suffix = originalElements[0 ..< leftIndex].suffix(while: {$0.inputStyle == .roman2kana && $0.character == "n"})
|
||||
@ -510,7 +509,7 @@ extension ComposingText {
|
||||
if let lastElement = convertTargetElements.last, lastElement.inputStyle == .roman2kana, rightIndex < originalElements.endIndex {
|
||||
let nextFirstElement = originalElements[rightIndex]
|
||||
|
||||
if !lastElement.string.hasSuffix("n") && lastElement.string.last == nextFirstElement.character {
|
||||
if !lastElement.string.hasSuffix("n") && lastElement.string.last == nextFirstElement.character && CharacterUtils.isRomanLetter(nextFirstElement.character) {
|
||||
// 書き換える
|
||||
convertTargetElements[convertTargetElements.endIndex - 1].string.removeLast()
|
||||
convertTargetElements.append(ConvertTargetElement(string: ["っ"], inputStyle: .direct))
|
||||
|
@ -28,28 +28,33 @@ enum Roman2Kana {
|
||||
"xo": "ぉ",
|
||||
"lo": "ぉ",
|
||||
"ka": "か",
|
||||
"ca": "か",
|
||||
"ga": "が",
|
||||
"xka": "ゕ",
|
||||
"lka": "ゕ",
|
||||
"ki": "き",
|
||||
"gi": "ぎ",
|
||||
"ku": "く",
|
||||
"cu": "く",
|
||||
"gu": "ぐ",
|
||||
"ke": "け",
|
||||
"ge": "げ",
|
||||
"xke": "ゖ",
|
||||
"lke": "ゖ",
|
||||
"ko": "こ",
|
||||
"co": "こ",
|
||||
"go": "ご",
|
||||
"sa": "さ",
|
||||
"za": "ざ",
|
||||
"si": "し",
|
||||
"ci": "し",
|
||||
"shi": "し",
|
||||
"zi": "じ",
|
||||
"ji": "じ",
|
||||
"su": "す",
|
||||
"zu": "ず",
|
||||
"se": "せ",
|
||||
"ce": "せ",
|
||||
"ze": "ぜ",
|
||||
"so": "そ",
|
||||
"zo": "ぞ",
|
||||
@ -268,6 +273,7 @@ enum Roman2Kana {
|
||||
"whu": "う",
|
||||
"whe": "うぇ",
|
||||
"who": "うぉ",
|
||||
"xn": "ん",
|
||||
"zh": "←",
|
||||
"zj": "↓",
|
||||
"zk": "↑",
|
||||
|
Reference in New Issue
Block a user