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