Skip to content

Commit f2de22f

Browse files
committed
Fix minor casing issue + update seconv help
1 parent 08e2607 commit f2de22f

5 files changed

Lines changed: 16 additions & 8 deletions

File tree

src/seconv/Core/BinaryOcrOcrEngine.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace SeConv.Core;
55

66
/// <summary>
77
/// In-process OCR via Subtitle Edit's BinaryOCR matcher. Requires a <c>.db</c>
8-
/// database file (typically shipped with SE under <c>%AppData%\Subtitle Edit\Ocr\</c>;
8+
/// database file (typically shipped with SE under <c>%AppData%\Subtitle Edit\OCR\</c>;
99
/// pass the path via <c>--ocrdb</c>). BinaryOCR uses fast bitmap-hash matching and
1010
/// is a useful alternative to nOCR — different accuracy profile, similar speed.
1111
/// </summary>
@@ -24,7 +24,7 @@ public BinaryOcrOcrEngine(string dbPath)
2424
{
2525
throw new FileNotFoundException(
2626
$"BinaryOCR database not found: {dbPath}. Use --ocrdb to point to a .db file " +
27-
"(typically %AppData%\\Subtitle Edit\\Ocr\\Latin.db or similar).", dbPath);
27+
"(typically %AppData%\\Subtitle Edit\\OCR\\Latin.db or similar).", dbPath);
2828
}
2929
_db = new BinaryOcrDb(dbPath, loadCompareImages: true);
3030
if (_db.AllCompareImages.Count == 0)

src/seconv/Core/ListHelpers.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ public static void PrintOcrEngines()
8888
table.AddRow(
8989
"[green]nocr[/]",
9090
"in-process",
91-
"Pass --ocrdb=<path-to-Latin.nocr> (find under %AppData%\\\\Subtitle Edit\\\\Ocr\\\\)");
91+
"Pass --ocrdb=<path-to-Latin.nocr> (find under %AppData%\\\\Subtitle Edit\\\\OCR\\\\)");
9292
table.AddRow(
9393
"[green]binaryocr[/]",
9494
"in-process",
95-
"Pass --ocrdb=<path-to-Latin.db> (find under %AppData%\\\\Subtitle Edit\\\\Ocr\\\\)");
95+
"Pass --ocrdb=<path-to-Latin.db> (find under %AppData%\\\\Subtitle Edit\\\\OCR\\\\)");
9696
table.AddRow(
9797
"[green]ollama[/]",
9898
"HTTP",

src/seconv/Core/NOcrOcrEngine.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace SeConv.Core;
55

66
/// <summary>
77
/// In-process OCR via Subtitle Edit's nOCR matcher. Requires a <c>.nocr</c> database file
8-
/// (typically shipped with SE under <c>%AppData%\Subtitle Edit\Ocr\</c>; pass the path
8+
/// (typically shipped with SE under <c>%AppData%\Subtitle Edit\OCR\</c>; pass the path
99
/// via <c>--ocrdb</c>).
1010
/// </summary>
1111
internal sealed class NOcrOcrEngine : IOcrEngine
@@ -22,7 +22,7 @@ public NOcrOcrEngine(string nOcrDbPath)
2222
{
2323
throw new FileNotFoundException(
2424
$"nOCR database not found: {nOcrDbPath}. Use --ocrdb to point to a .nocr file " +
25-
"(typically %AppData%\\Subtitle Edit\\Ocr\\Latin.nocr or similar).", nOcrDbPath);
25+
"(typically %AppData%\\Subtitle Edit\\OCR\\Latin.nocr or similar).", nOcrDbPath);
2626
}
2727
_db = new NOcrDb(nOcrDbPath);
2828
if (_db.TotalCharacterCount == 0)

src/seconv/Core/OcrEngineFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ private static string ResolveOcrDbPath(ConversionOptions options, string engineN
2929
var displayExt = requiredExtension.TrimStart('.');
3030
throw new InvalidOperationException(
3131
$"{engineName} engine requires --ocrdb=<path-to-Latin{requiredExtension}> (or another {requiredExtension} file). " +
32-
$"Find them in `%AppData%\\Subtitle Edit\\Ocr\\` or download from the SE UI.");
32+
$"Find them in `%AppData%\\Subtitle Edit\\OCR\\` or download from the SE UI.");
3333
}
3434
var path = options.OcrDb;
3535
if (!path.EndsWith(requiredExtension, StringComparison.OrdinalIgnoreCase))

src/seconv/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,18 @@ seconv --help # show help
103103
|---|---|
104104
| `--ocrengine:<engine>` | `tesseract` (default) \| `nocr` \| `binaryocr` \| `ollama` \| `paddle` |
105105
| `--ocrlanguage:<lang>` | Tesseract: ISO 639-2 (`eng`, `deu`); Paddle: short (`en`); Ollama: human (`English`) |
106-
| `--ocrdb:<path.nocr>` | nOCR database file (required for `--ocrengine=nocr`) |
106+
| `--ocrdb:<path>` | OCR database file: `.nocr` for `nocr`, `.db` for `binaryocr` (required for both) |
107107
| `--ollama-url:<url>` | Default `http://localhost:11434/api/chat` |
108108
| `--ollama-model:<model>` | Default `llama3.2-vision` |
109109

110+
> **OCR database files are not bundled with `seconv`.** The `nocr` and `binaryocr` engines
111+
> need a `.nocr` or `.db` file passed via `--ocrdb`. Sources:
112+
> - If you have the desktop UI installed: `%AppData%\Subtitle Edit\OCR\` (Windows) or
113+
> `~/.config/Subtitle Edit/OCR/` (Linux/macOS).
114+
> - From the repo: [`Ocr/Latin.nocr`](https://github.com/SubtitleEdit/subtitleedit/raw/main/Ocr/Latin.nocr)
115+
> and [`Ocr/Latin.db`](https://github.com/SubtitleEdit/subtitleedit/raw/main/Ocr/Latin.db).
116+
> - Other languages: download from the SE UI (Tools → "OCR with nOCR" / BinaryOCR → download).
117+
110118
### Templates / replacements
111119
| Option | Description |
112120
|---|---|

0 commit comments

Comments
 (0)