Syriac OCR in C# and .NET
IronOCR jest komponentem oprogramowania C# pozwalajacym programistom .NET czytac tekst z obrazow i dokumentow PDF w 126 jezykach, w tym po syryjsku.
Jest to zaawansowany fork Tesseract, stworzony wyłącznie dla programistów .NET i regularnie przewyższa inne silniki Tesseract zarówno pod względem szybkości, jak i dokładności.
Zawartosc IronOcr.Languages.Syriac
Pakiet ten zawiera 108 języków OCR dla .NET:
- Syryjski
- SyryjskiNajlepszy
- SyryjskiSzybki
- AlfabetSyryjski
- AlfabetSyryjskiNajlepszy
- AlfabetSyryjskiSzybki
Pobieranie
Pakiet jezyka syryjskiego [Syryjski]
Instalacja
Pierwszym krokiem jest zainstalowanie pakietu OCR Syriac w twoim projekcie .NET.
Install-Package IronOcr.Languages.Syriac
Przyklad kodu
Ten przyklad kodu C# czyta tekst syryjski z obrazu lub dokumentu 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
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
Friend Class Program
Shared Sub Main()
' Instantiate the IronTesseract object
Dim Ocr = New IronTesseract()
' Set the language to Syriac
Ocr.Language = OcrLanguage.Syriac
' Create an OCR input from an image file
Using Input = 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 Class
W tym przykładzie:
- Tworzymy instancje
IronTesseractdo przetwarzania OCR. Ocr.Languagejest ustawiony naSyriac, aby zapewnic dokladne rozpoznawanie tekstu w tym jezyku.- Wczytujemy obraz zawierajacy tekst syryjski do
OcrInputi przetwarzamy go za pomocaOcr.Read. - Rozpoznany tekst jest nastepnie przechowywany w
Result.Text, co moze byc wykorzystane dalej w twojej aplikacji.

