From a4272600b009d2fbe064e2931b89a74c4a65ded7 Mon Sep 17 00:00:00 2001 From: Pylogmon Date: Thu, 27 Jul 2023 09:35:33 +0800 Subject: [PATCH] Update --- main.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main.swift b/main.swift index 1478044..8aeef41 100644 --- a/main.swift +++ b/main.swift @@ -41,7 +41,7 @@ func recognizeTextHandler(request: VNRequest, error: Error?) { } -func detectText(fileName : URL, lang : string) -> [CIFeature]? { +func detectText(fileName : URL, lang : String) -> [CIFeature]? { if let ciImage = CIImage(contentsOf: fileName){ guard let img = convertCIImageToCGImage(inputImage: ciImage) else { return nil} @@ -65,13 +65,12 @@ func detectText(fileName : URL, lang : string) -> [CIFeature]? { return nil } -supportedLanguages() if CommandLine.argc < 2 { print("Please provide an image path.") } else { let inputURL = URL(fileURLWithPath: CommandLine.arguments[1]) let language = CommandLine.arguments[2] - if let features = detectText(fileName : inputURL, lang : string), !features.isEmpty{} + if let features = detectText(fileName : inputURL, lang : String), !features.isEmpty{} } exit(EXIT_SUCCESS)