Syriac OCR in C# and .NET
Curtis Chau
已更新: 2026年4月23日
IronOCR 是一個 C# 軟體元件,允許 .NET 程式設計師從圖像和 PDF 文件中讀取 126 種語言(包括敘利亞)的文字。
它是 Tesseract 的一個高級分支,專為 .NET 開發人員構建,在速度和準確性方面通常優於其他 Tesseract 引擎。
IronOcr.Languages.Syriac 的內容
此軟體包包含 108 種適用於 .NET 的 OCR 語言:
- Syriac
- SyriacBest
- SyriacFast
- SyriacAlphabet
- 敘利亞字母表最佳
- 敘利亞字母表快速
下載
敘利亞語語言包 [敘利亞語]
- 下載為 Zip
- 使用 NuGet 進行安裝
安裝
第一步是在您的 .NET 專案中安裝敘利亞語OCR 套件。
程式碼範例
這段 C# 程式碼範例從圖像或 PDF 文件中讀取敘利亞文。
// Import the IronOcr library
using IronOcr;
class Program
{
static void Main()
{
// Instantiate the IronTesseract object
var Ocr = new IronTesseract();
// Set the language to Syriac
Ocr.Language = OcrLanguage.Syriac;
// Create an OCR input from an image file
using (var Input = new OcrInput(@"images\Syriac.png"))
{
// Read the image and extract the text
var Result = Ocr.Read(Input);
// Retrieve the full recognized text
var AllText = Result.Text;
// Output the text to the console
Console.WriteLine(AllText);
}
}
}' Import the IronOcr library
Imports IronOcr
Module Program
Sub Main()
' Instantiate the IronTesseract object
Dim Ocr As New IronTesseract()
' Set the language to Syriac
Ocr.Language = OcrLanguage.Syriac
' Create an OCR input from an image file
Using Input As New OcrInput("images\Syriac.png")
' Read the image and extract the text
Dim Result = Ocr.Read(Input)
' Retrieve the full recognized text
Dim AllText = Result.Text
' Output the text to the console
Console.WriteLine(AllText)
End Using
End Sub
End Module' Import the IronOcr library
Imports IronOcr
Module Program
Sub Main()
' Instantiate the IronTesseract object
Dim Ocr As New IronTesseract()
' Set the language to Syriac
Ocr.Language = OcrLanguage.Syriac
' Create an OCR input from an image file
Using Input As New OcrInput("images\Syriac.png")
' Read the image and extract the text
Dim Result = Ocr.Read(Input)
' Retrieve the full recognized text
Dim AllText = Result.Text
' Output the text to the console
Console.WriteLine(AllText)
End Using
End Sub
End Module在這個範例中
- 我們創建一個
IronTesseract實例來處理OCR。 - 將
Syriac,以確保該語言的準確文本識別。 - 我們將包含敘利亞文字的圖像加載到
Ocr.Read進行處理。 - 然後將識別的文本存儲在
Result.Text中,您可以在應用程式中進一步使用它。
Curtis Chau 擁有卡爾頓大學計算機科學學士學位,專注於前端開發,擅長於 Node.js、TypeScript、JavaScript 和 React。Curtis 熱衷於創建直觀且美觀的用戶界面,喜歡使用現代框架並打造結構良好、視覺吸引人的手冊。