Class OneOcrConfig
Typed configuration for OneOcrService.
Converts to the dictionary format expected by CreateSessionAsync.
Inherited Members
Namespace: Zaya.OCR.Impl.OneOcr.Models
Assembly: Zaya.OCR.Impl.OneOcr.dll
Syntax
public class OneOcrConfig
Remarks
Maps to the same keys as Settings:
source, directoryPath, downloadUrl, cacheDirectory, minConfidence.
Properties
| Edit this page View SourceCacheDirectory
Gets or sets the cache directory for extracted engine files. Default is %TEMP%\Zaya\OneOcr.
Declaration
public string? CacheDirectory { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
DirectoryPath
Gets or sets the local directory path containing the engine files. Required when Source is Directory.
Declaration
public string? DirectoryPath { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
DownloadUrl
Gets or sets the URL to download the engine from. Required when Source is Url; also used as fallback when Source is Auto.
Declaration
public string? DownloadUrl { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
MinConfidence
Gets or sets the minimum word confidence as a percentage (0–100).
Default is 70 to match Settings.
Declaration
public int MinConfidence { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Source
Gets or sets the engine source. Default is Auto.
Declaration
public OneOcrSource Source { get; set; }
Property Value
| Type | Description |
|---|---|
| OneOcrSource |
Methods
| Edit this page View SourceToDictionary()
Converts the typed configuration to the dictionary format accepted by CreateSessionAsync(IReadOnlyDictionary<string, object>, CancellationToken).
Declaration
public Dictionary<string, object?> ToDictionary()
Returns
| Type | Description |
|---|---|
| Dictionary<string, object> | A dictionary with string keys and object values. |