From da8d04f82a20f99c3a295d2a140c0c5da1f0a919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <1173718158@qq.com> Date: Tue, 31 Dec 2024 22:35:13 +0800 Subject: [PATCH] . --- docs/en/useapis/ocrapi.md | 44 ++++++++++++++++++++++++++++++------ docs/index.html | 2 +- docs/ja/useapis/ocrapi.md | 45 +++++++++++++++++++++++++++++++------ docs/main.js | 5 +++-- docs/zh/useapis/ocrapi.md | 47 ++++++++++++++++++++++++++++++++------- 5 files changed, 118 insertions(+), 25 deletions(-) diff --git a/docs/en/useapis/ocrapi.md b/docs/en/useapis/ocrapi.md index 5ddb227d..416084cf 100644 --- a/docs/en/useapis/ocrapi.md +++ b/docs/en/useapis/ocrapi.md @@ -200,19 +200,49 @@ Requires installation of WeChat or the latest version of QQ > WindowsOCR only supports Windows 10 and Windows 11 operating systems. -1. Open Settings. +### How to query for OCR language packs -2. Open "Time & Language." +To return the list of all supported language packs, open PowerShell as an Administrator (right-click, then select "Run as Administrator") and enter the following command: - ![img](https://image.lunatranslator.org/zh/windowsocr/3.png) +`Get-WindowsCapability -Online | Where-Object { $_.Name -Like 'Language.OCR*' }` -3. Open "Language & Region", click on "Preferred Languages" -> "Add a language" +An example output: - ![img](https://image.lunatranslator.org/zh/windowsocr/2.png) +``` +Name : Language.OCR~~~el-GR~0.0.1.0 +State : NotPresent -4. Install the required language. +Name : Language.OCR~~~en-GB~0.0.1.0 +State : NotPresent - ![img](https://image.lunatranslator.org/zh/windowsocr/1.png) +Name : Language.OCR~~~en-US~0.0.1.0 +State : Installed +Name : Language.OCR~~~es-ES~0.0.1.0 +State : NotPresent + +Name : Language.OCR~~~es-MX~0.0.1.0 +State : NotPresent +``` + +The language and location is abbreviated, so "en-US" would be "English-United States" and "en-GB" would be "English-Great Britain". If a language is not available in the output, then it's not supported by OCR. `State: NotPresent` languages must be installed first. + +### How to install an OCR language pack + +The following commands install the OCR pack for "en-US": + +`$Capability = Get-WindowsCapability -Online | Where-Object { $_.Name -Like 'Language.OCR*en-US*' }` + +`$Capability | Add-WindowsCapability -Online` + +### How to remove an OCR language pack + +The following commands remove the OCR pack for "en-US": + +`$Capability = Get-WindowsCapability -Online | Where-Object { $_.Name -Like 'Language.OCR*en-US*' }` + +`$Capability | Remove-WindowsCapability -Online` + +https://learn.microsoft.com/en-us/windows/powertoys/text-extractor#supported-languages \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index b8b04c59..6cdb2882 100644 --- a/docs/index.html +++ b/docs/index.html @@ -78,7 +78,7 @@ - + diff --git a/docs/ja/useapis/ocrapi.md b/docs/ja/useapis/ocrapi.md index ef323fc4..21eb79a2 100644 --- a/docs/ja/useapis/ocrapi.md +++ b/docs/ja/useapis/ocrapi.md @@ -201,18 +201,49 @@ WeChatまたは最新バージョンのQQのインストールが必要です > WindowsOCRはWindows 10およびWindows 11オペレーティングシステムのみをサポートしています。 -1. 設定を開きます。 +### OCR 言語パックのクエリを実行する方法 -1. 「時刻と言語」を開きます。 +サポートされているすべての言語パックの一覧を返すには、管理者として PowerShell を開き (右クリックし、[管理者として実行] を選択します)、次のコマンドを入力します。 - ![img](https://image.lunatranslator.org/zh/windowsocr/3.png) +`Get-WindowsCapability -Online | Where-Object { $_.Name -Like 'Language.OCR*' }` -1. 「言語と地域」を開き、「優先する言語」->「言語を追加」をクリックします。 +出力例: - ![img](https://image.lunatranslator.org/zh/windowsocr/2.png) +``` +Name : Language.OCR~~~el-GR~0.0.1.0 +State : NotPresent -1. 必要な言語をインストールします。 +Name : Language.OCR~~~en-GB~0.0.1.0 +State : NotPresent - ![img](https://image.lunatranslator.org/zh/windowsocr/1.png) +Name : Language.OCR~~~en-US~0.0.1.0 +State : Installed + +Name : Language.OCR~~~es-ES~0.0.1.0 +State : NotPresent + +Name : Language.OCR~~~es-MX~0.0.1.0 +State : NotPresent +``` + +言語と場所は省略されているため、"en-US" は "English-United States" になり、"en-GB" は "English-Great Britain" になります。 出力で使用できない言語は、OCR ではサポートされません。 `State: NotPresent` 言語を最初にインストールする必要があります。 + +### OCR 言語パックをインストールする方法 + +次のコマンドは、"en-US" 用の OCR パックをインストールします: + +`$Capability = Get-WindowsCapability -Online | Where-Object { $_.Name -Like 'Language.OCR*en-US*' }` + +`$Capability | Add-WindowsCapability -Online` + +### OCR 言語パックを削除する方法 + +次のコマンドは、"en-US" の OCR パックを削除します: + +`$Capability = Get-WindowsCapability -Online | Where-Object { $_.Name -Like 'Language.OCR*en-US*' }` + +`$Capability | Remove-WindowsCapability -Online` + +https://learn.microsoft.com/ja-jp/windows/powertoys/text-extractor#supported-languages diff --git a/docs/main.js b/docs/main.js index cfd52869..a7ecd43a 100644 --- a/docs/main.js +++ b/docs/main.js @@ -138,9 +138,10 @@ window.$docsify = { hook.doneEach(() => { var elements = document.querySelectorAll('code'); elements.forEach(function (element) { - if (!(window.location.href.endsWith('guochandamoxing') || window.location.href.endsWith('baipiaojiekou'))) return + if (!(window.location.href.includes('guochandamoxing') || window.location.href.includes('ocrapi'))) return element.addEventListener('click', function () { - copyToClipboard(element.innerText) + if (element.innerText.split('\n').length == 1) + copyToClipboard(element.innerText) }); }); }) diff --git a/docs/zh/useapis/ocrapi.md b/docs/zh/useapis/ocrapi.md index 2df7a95b..1ae1765a 100644 --- a/docs/zh/useapis/ocrapi.md +++ b/docs/zh/useapis/ocrapi.md @@ -236,19 +236,50 @@ GPU整合包 https://lunatranslator.org/Resource/IntegrationPack/manga_ocr/gpu > WindowsOCR仅支持win10-win11操作系统 -1. 打开设置 +### 如何查询 OCR 语言包 -1. 打开“时间和语言” +若要返回所有支持的语言包的列表,请以管理员身份打开 PowerShell(右键单击,然后选择“以管理员身份运行”),并输入以下命令: - ![img](https://image.lunatranslator.org/zh/windowsocr/3.png) +`Get-WindowsCapability -Online | Where-Object { $_.Name -Like 'Language.OCR*' }` -1. 打开“语言和区域”,点击“首选语言”->“添加语言” +示例输出: - ![img](https://image.lunatranslator.org/zh/windowsocr/2.png) +``` +Name : Language.OCR~~~el-GR~0.0.1.0 +State : NotPresent -1. 安装所需语言 +Name : Language.OCR~~~en-GB~0.0.1.0 +State : NotPresent - ![img](https://image.lunatranslator.org/zh/windowsocr/1.png) +Name : Language.OCR~~~en-US~0.0.1.0 +State : Installed +Name : Language.OCR~~~es-ES~0.0.1.0 +State : NotPresent + +Name : Language.OCR~~~es-MX~0.0.1.0 +State : NotPresent +``` + +语言和位置为缩写形式,因此“en-US”表示“英语-美国”,“en-GB”则表示“英语-英国”。 如果某个语言在输出中不可用,则 OCR 不支持该语言。 必须先安装 `State: NotPresent` 语言。 + +### 如何安装 OCR 语言包 + +以下为安装“en-US”OCR 包的命令: + +`$Capability = Get-WindowsCapability -Online | Where-Object { $_.Name -Like 'Language.OCR*en-US*' }` + +`$Capability | Add-WindowsCapability -Online` + +### 如何移除 OCR 语言包 + +以下为移除“en-US”OCR 包的命令: + +`$Capability = Get-WindowsCapability -Online | Where-Object { $_.Name -Like 'Language.OCR*en-US*' }` + +`$Capability | Remove-WindowsCapability -Online` + +https://learn.microsoft.com/zh-cn/windows/powertoys/text-extractor#supported-languages + + - \ No newline at end of file