Merge pull request #214 from azooKey/perf/parse_template_coarse_filer

This commit is contained in:
Miwa
2025-06-29 22:56:01 +09:00
committed by GitHub

View File

@ -107,6 +107,11 @@ public struct Candidate: Sendable {
///
public static func parseTemplate(_ text: String) -> String {
// MARK: Coarse Filtering: 調
guard text.contains("<") else {
return text
}
// MARK: Fine Filtering:
var newText = text
while let range = newText.range(of: Self.dateExpression, options: .regularExpression) {
let templateString = String(newText[range])