{"id":15929862,"url":"https://github.com/mainasuk/swifttesseract","last_synced_at":"2025-10-14T10:36:08.765Z","repository":{"id":89171912,"uuid":"264664710","full_name":"MainasuK/SwiftTesseract","owner":"MainasuK","description":null,"archived":false,"fork":false,"pushed_at":"2020-06-01T13:48:17.000Z","size":1953,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-01T00:12:29.779Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MainasuK.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-17T12:49:35.000Z","updated_at":"2020-06-01T13:48:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"f242afed-5170-4f8a-8230-9415b3fecce3","html_url":"https://github.com/MainasuK/SwiftTesseract","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"cbfe2b2d3e0c15608b5b4cd60e50adcd9344c1d5"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/MainasuK/SwiftTesseract","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MainasuK%2FSwiftTesseract","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MainasuK%2FSwiftTesseract/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MainasuK%2FSwiftTesseract/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MainasuK%2FSwiftTesseract/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MainasuK","download_url":"https://codeload.github.com/MainasuK/SwiftTesseract/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MainasuK%2FSwiftTesseract/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018778,"owners_count":26086452,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-07T00:21:38.907Z","updated_at":"2025-10-14T10:36:08.748Z","avatar_url":"https://github.com/MainasuK.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwiftTesseract\n\nSwiftPM wrapper for Tesseract on macOS.\n\n\n## Setup\n```zsh\n$ brew install tesseract\n\n```\n\n### Version\nSwiftPM system lib wrapper do not supports version control. Please install the correct Tesseract version from Homebrew to avoid potential API breaking.\n\n|Package Version|Tesseract Version|\n|:---:|:---:|\n|0.1.0|4.1.1|\n\n### Dependencies\n\n- libgif\n- libjpeg\n- liblept\n- libopenjp\n- libpng\n- libtesseract\n- libtiff\n- libwebp\n- libwebpmux\n\n\n## Usage\n```swift\n    let tesseract = Tesseract()\n    \n    // init\n    let datapath = \"path/to/tessdata\"\n    try tesseract.init3(datapath: datapath, language: .english)\n    \n    // set image\n    let image = NSImage(contentsOf: imageURL)!\n    try tesseract.setImage2(nsImage: image)\n    \n    // recognize\n    try tesseract.recognize()\n    \n    guard let iterator = tesseract.resultIterator() else {\n        return\n    }\n    \n    let level = Tesseract.PageIteratorLevel.word\n    repeat {\n        let text = iterator.text(level: level) ?? \"\u003cnil\u003e\"\n        let confidence = iterator.confidence(level: level)\n        let boundingBox = iterator.pageIterator().boundingBox(level: level)\n        print(\"\\(text) [\\(confidence)] - \\(boundingBox)\")\n    } while iterator.next(level: level) == true\n```\n\n### Input\n[sample image](./Tests/SwiftTesseractTests/testing/phototest.tif)\n\n### Result\n```\nThis [96.59077] - (36.0, 92.0, 60.0, 24.0)\nis [96.91542] - (109.0, 92.0, 20.0, 24.0)\na [96.33154] - (141.0, 98.0, 15.0, 18.0)\nlot [96.33154] - (169.0, 92.0, 32.0, 24.0)\nof [96.453545] - (212.0, 92.0, 28.0, 24.0)\n12 [96.453545] - (251.0, 92.0, 31.0, 24.0)\npoint [96.469635] - (296.0, 92.0, 68.0, 30.0)\ntext [96.469635] - (374.0, 93.0, 53.0, 23.0)\nto [96.88442] - (437.0, 93.0, 26.0, 23.0)\ntest [96.98443] - (474.0, 93.0, 52.0, 23.0)\nthe [96.370605] - (536.0, 92.0, 44.0, 24.0)\nocr [96.06626] - (36.0, 132.0, 45.0, 18.0)\ncode [96.06626] - (91.0, 126.0, 69.0, 24.0)\nand [96.62016] - (172.0, 126.0, 51.0, 24.0)\nsee [96.534645] - (236.0, 132.0, 50.0, 18.0)\nif [94.37445] - (299.0, 126.0, 15.0, 24.0)\nit [94.37445] - (325.0, 126.0, 14.0, 24.0)\nworks [95.95861] - (348.0, 126.0, 85.0, 24.0)\non [93.535866] - (445.0, 132.0, 33.0, 18.0)\nall [93.535866] - (500.0, 126.0, 29.0, 24.0)\ntypes [96.89812] - (541.0, 127.0, 77.0, 30.0)\nof [96.23404] - (36.0, 160.0, 28.0, 24.0)\nfile [95.72321] - (72.0, 160.0, 41.0, 24.0)\nformat. [95.67606] - (123.0, 160.0, 100.0, 24.0)\nThe [96.51174] - (36.0, 194.0, 55.0, 24.0)\nquick [96.62931] - (102.0, 194.0, 75.0, 30.0)\nbrown [96.81818] - (189.0, 194.0, 85.0, 24.0)\ndog [95.7896] - (287.0, 194.0, 52.0, 31.0)\njumped [95.7896] - (348.0, 194.0, 108.0, 31.0)\nover [96.59911] - (468.0, 200.0, 63.0, 18.0)\nthe [96.49475] - (540.0, 194.0, 45.0, 24.0)\nlazy [96.39718] - (37.0, 228.0, 55.0, 31.0)\nfox. [96.44215] - (103.0, 228.0, 50.0, 24.0)\nThe [96.70259] - (165.0, 228.0, 55.0, 24.0)\nquick [96.62862] - (232.0, 228.0, 75.0, 30.0)\nbrown [96.615715] - (319.0, 228.0, 85.0, 24.0)\ndog [95.79648] - (417.0, 228.0, 51.0, 31.0)\njumped [95.79648] - (478.0, 228.0, 107.0, 31.0)\nover [96.285324] - (36.0, 268.0, 63.0, 18.0)\nthe [96.28109] - (109.0, 262.0, 44.0, 24.0)\nlazy [96.50949] - (165.0, 262.0, 56.0, 31.0)\nfox. [96.30392] - (231.0, 262.0, 50.0, 24.0)\nThe [96.647934] - (294.0, 262.0, 55.0, 24.0)\nquick [96.60692] - (360.0, 262.0, 75.0, 30.0)\nbrown [96.11609] - (447.0, 262.0, 85.0, 24.0)\ndog [96.11609] - (545.0, 262.0, 52.0, 31.0)\njumped [96.72839] - (43.0, 296.0, 107.0, 31.0)\nover [96.37651] - (162.0, 302.0, 64.0, 18.0)\nthe [96.37651] - (235.0, 296.0, 44.0, 24.0)\nlazy [96.80211] - (292.0, 296.0, 55.0, 31.0)\nfox. [96.771866] - (357.0, 296.0, 50.0, 24.0)\nThe [96.17355] - (420.0, 296.0, 55.0, 24.0)\nquick [96.94925] - (486.0, 296.0, 75.0, 30.0)\nbrown [96.83297] - (37.0, 330.0, 85.0, 24.0)\ndog [96.32232] - (135.0, 330.0, 52.0, 31.0)\njumped [96.80239] - (196.0, 330.0, 108.0, 31.0)\nover [96.95346] - (316.0, 336.0, 63.0, 18.0)\nthe [96.56487] - (388.0, 330.0, 45.0, 24.0)\nlazy [95.99435] - (445.0, 330.0, 55.0, 31.0)\nfox. [96.61488] - (511.0, 330.0, 50.0, 24.0)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmainasuk%2Fswifttesseract","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmainasuk%2Fswifttesseract","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmainasuk%2Fswifttesseract/lists"}