mirror of
https://github.com/mii443/AzooKeyKanaKanjiConverter.git
synced 2025-08-22 15:05:26 +00:00
Update KanaKanjiConverter to handle time expression conversion
* Rename `toTimeExpressionCandidates` function to `convertToTimeExpression` * Remove `toTimeExpressionCandidates` function and integrate its logic into `convertToTimeExpression` * Call `convertToTimeExpression` function in `getWiseCandidate` function
This commit is contained in:
@ -1,7 +1,14 @@
|
||||
//
|
||||
// KanaKanjiConverter.swift
|
||||
// AzooKeyKanaKanjiConverter
|
||||
//
|
||||
// Created by ensan on 2020/09/03.
|
||||
// Copyright © 2020 ensan. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import SwiftUtils
|
||||
import EfficientNGram
|
||||
import TimeExpression
|
||||
|
||||
/// かな漢字変換の管理を受け持つクラス
|
||||
@MainActor public final class KanaKanjiConverter {
|
||||
@ -149,7 +156,7 @@ import TimeExpression
|
||||
result.append(contentsOf: self.unicodeCandidates(inputData))
|
||||
}
|
||||
result.append(contentsOf: self.toVersionCandidate(inputData, options: options))
|
||||
result.append(contentsOf: self.toTimeExpressionCandidates(inputData))
|
||||
result.append(contentsOf: self.convertToTimeExpression(inputData))
|
||||
return result
|
||||
}
|
||||
|
||||
@ -780,11 +787,4 @@ import TimeExpression
|
||||
results.append(contentsOf: zeroHints.min(count: 10 - results.count, sortedBy: {$0.value > $1.value}))
|
||||
return results
|
||||
}
|
||||
|
||||
private func toTimeExpressionCandidates(_ inputData: ComposingText) -> [Candidate] {
|
||||
guard let number = Int(inputData.convertTarget) else {
|
||||
return []
|
||||
}
|
||||
return self.convertToTimeExpression(number)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user