Skip to content

Commit

Permalink
Fix: ocr command by updating recognitionlangues params
Browse files Browse the repository at this point in the history
To recognize traditional and simplified Chinese, specify zh-Hant and zh-Hans as the first elements in the request’s recognitionLanguages property. English is the only other language that you can pair with Chinese.
https://developer.apple.com/documentation/vision/original_objective-c_and_swift_api/recognizing_text_in_images
  • Loading branch information
sivagao authored and dehesa committed Jun 24, 2024
1 parent 40ebc89 commit 58b1f65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion commands/system/ocr.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import Cocoa
import Vision

let screenCapturePath = "/tmp/ocr.png"
let recognitionLanguages = ["en-US", "zh-CN"]
let recognitionLanguages = ["zh-Hans", "en-US"]
let joiner = " "

@discardableResult
Expand Down

0 comments on commit 58b1f65

Please sign in to comment.