mirror of
https://github.com/mii443/AzooKeyKanaKanjiConverter.git
synced 2025-12-03 02:58:27 +00:00
remove print
This commit is contained in:
@@ -177,7 +177,7 @@ final class SwiftTrainer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
trie.save(path)
|
trie.save(path)
|
||||||
print("Saved \(path): \(encodedStrings.count) entries")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -202,7 +202,7 @@ final class SwiftTrainer {
|
|||||||
attributes: nil
|
attributes: nil
|
||||||
)
|
)
|
||||||
} catch {
|
} catch {
|
||||||
print("ディレクトリ作成エラー: \(error)")
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,9 +225,9 @@ final class SwiftTrainer {
|
|||||||
buildAndSaveTrie(from: r_xbx, to: paths[4])
|
buildAndSaveTrie(from: r_xbx, to: paths[4])
|
||||||
|
|
||||||
// **絶対パスでの出力**
|
// **絶対パスでの出力**
|
||||||
print("All saved files (absolute paths):")
|
|
||||||
for path in paths {
|
for path in paths {
|
||||||
print(path)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,7 +236,7 @@ final class SwiftTrainer {
|
|||||||
/// ファイルを読み込み、行ごとの文字列配列を返す関数
|
/// ファイルを読み込み、行ごとの文字列配列を返す関数
|
||||||
public func readLinesFromFile(filePath: String) -> [String]? {
|
public func readLinesFromFile(filePath: String) -> [String]? {
|
||||||
guard let fileHandle = FileHandle(forReadingAtPath: filePath) else {
|
guard let fileHandle = FileHandle(forReadingAtPath: filePath) else {
|
||||||
print("[Error] ファイルを開けませんでした: \(filePath)")
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
defer {
|
defer {
|
||||||
@@ -245,7 +245,7 @@ public func readLinesFromFile(filePath: String) -> [String]? {
|
|||||||
// UTF-8 でデータを読み込む
|
// UTF-8 でデータを読み込む
|
||||||
let data = fileHandle.readDataToEndOfFile()
|
let data = fileHandle.readDataToEndOfFile()
|
||||||
guard let text = String(data: data, encoding: .utf8) else {
|
guard let text = String(data: data, encoding: .utf8) else {
|
||||||
print("[Error] UTF-8 で読み込めませんでした: \(filePath)")
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
// 改行で分割し、空行を除去
|
// 改行で分割し、空行を除去
|
||||||
@@ -269,7 +269,7 @@ public func trainNGram(
|
|||||||
|
|
||||||
for (i, line) in lines.enumerated() {
|
for (i, line) in lines.enumerated() {
|
||||||
if i % 100 == 0 {
|
if i % 100 == 0 {
|
||||||
print(i, "/", lines.count)
|
|
||||||
}
|
}
|
||||||
let trimmed = line.trimmingCharacters(in: .whitespacesAndNewlines)
|
let trimmed = line.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||||
if !trimmed.isEmpty {
|
if !trimmed.isEmpty {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ private func debugLog(_ items: Any..., separator: String = " ", terminator: Stri
|
|||||||
let timestamp = ISO8601DateFormatter().string(from: Date())
|
let timestamp = ISO8601DateFormatter().string(from: Date())
|
||||||
let logEntry = "[\(timestamp)] \(message)"
|
let logEntry = "[\(timestamp)] \(message)"
|
||||||
|
|
||||||
print(logEntry, terminator: "")
|
|
||||||
debug(message)
|
debug(message)
|
||||||
|
|
||||||
let debugLogFile = URL(fileURLWithPath: "zenz.log")
|
let debugLogFile = URL(fileURLWithPath: "zenz.log")
|
||||||
|
|||||||
@@ -16,13 +16,13 @@ private func debugLog(_ items: Any..., separator: String = " ", terminator: Stri
|
|||||||
let timestamp = ISO8601DateFormatter().string(from: Date())
|
let timestamp = ISO8601DateFormatter().string(from: Date())
|
||||||
let logEntry = "[\(timestamp)] \(message)"
|
let logEntry = "[\(timestamp)] \(message)"
|
||||||
|
|
||||||
print(logEntry, terminator: "")
|
|
||||||
debug(message)
|
debug(message)
|
||||||
|
|
||||||
if let data = logEntry.data(using: .utf8) {
|
if let data = logEntry.data(using: .utf8) {
|
||||||
if !FileManager.default.fileExists(atPath: debugLogFile.path) {
|
if !FileManager.default.fileExists(atPath: debugLogFile.path) {
|
||||||
FileManager.default.createFile(atPath: debugLogFile.path, contents: data)
|
FileManager.default.createFile(atPath: debugLogFile.path, contents: data)
|
||||||
print("[DEBUG] Created log file at: \(debugLogFile.path)")
|
|
||||||
} else {
|
} else {
|
||||||
if let fileHandle = try? FileHandle(forWritingTo: debugLogFile) {
|
if let fileHandle = try? FileHandle(forWritingTo: debugLogFile) {
|
||||||
fileHandle.seekToEndOfFile()
|
fileHandle.seekToEndOfFile()
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ import EfficientNGram
|
|||||||
let timestamp = ISO8601DateFormatter().string(from: Date())
|
let timestamp = ISO8601DateFormatter().string(from: Date())
|
||||||
let logEntry = "[\(timestamp)] \(message)"
|
let logEntry = "[\(timestamp)] \(message)"
|
||||||
|
|
||||||
print(logEntry, terminator: "")
|
|
||||||
debug(message)
|
debug(message)
|
||||||
|
|
||||||
let debugLogFile = URL(fileURLWithPath: "zenz.log")
|
let debugLogFile = URL(fileURLWithPath: "zenz.log")
|
||||||
@@ -117,7 +117,7 @@ import EfficientNGram
|
|||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
guard options.zenzaiMode.versionDependentMode.version == .v2 else {
|
guard options.zenzaiMode.versionDependentMode.version == .v2 else {
|
||||||
print("next character prediction requires zenz-v2 models, not zenz-v1 nor zenz-v3 and later")
|
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
let results = zenz.predictNextCharacter(leftSideContext: leftSideContext, count: count)
|
let results = zenz.predictNextCharacter(leftSideContext: leftSideContext, count: count)
|
||||||
|
|||||||
@@ -646,7 +646,7 @@ public final class DicdataStore {
|
|||||||
/// - 入力全体をカタカナとかひらがなに変換するやつは、Converter側でやっているので注意。
|
/// - 入力全体をカタカナとかひらがなに変換するやつは、Converter側でやっているので注意。
|
||||||
func getWiseDicdata(convertTarget: String, inputData: ComposingText, surfaceRange: Range<Int>) -> [DicdataElement] {
|
func getWiseDicdata(convertTarget: String, inputData: ComposingText, surfaceRange: Range<Int>) -> [DicdataElement] {
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
print(#function, convertTarget, inputData, surfaceRange)
|
|
||||||
#endif
|
#endif
|
||||||
var result: [DicdataElement] = []
|
var result: [DicdataElement] = []
|
||||||
result.append(contentsOf: self.getJapaneseNumberDicdata(head: convertTarget))
|
result.append(contentsOf: self.getJapaneseNumberDicdata(head: convertTarget))
|
||||||
|
|||||||
Reference in New Issue
Block a user