Sanskrit OCR in C# and .NET
IronOCR to komponent oprogramowania w C#, ktory pozwala koderom .NET na czytanie tekstu z obrazow i dokumentow PDF w 126 jezykach, w tym w sanskrycie.
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.Sanskrit
Ten pakiet zawiera 49 języków OCR dla .NET:
- Sanskrit
- SanskritBest
- SanskritFast
Pobieranie
Sanskrit Language Pack [ससकतम]
Instalacja
Pierwszym krokiem jest zainstalowanie pakietu OCR Sanskrit w swoim projekcie .NET.
Install-Package IronOcr.Languages.Sanskrit
Przyklad kodu
Ten przyklad kodu C# odczytuje tekst sanskrycki z obrazu lub dokumentu PDF.
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Create an instance of IronTesseract for OCR operations
var Ocr = new IronTesseract
{
// Set the OCR language to Sanskrit
Language = OcrLanguage.Sanskrit
};
// Define the input image or PDF file containing Sanskrit text
using (var Input = new OcrInput(@"images\Sanskrit.png"))
{
// Perform OCR to read the text from the Input
var Result = Ocr.Read(Input);
// Capture the extracted text
var AllText = Result.Text;
// Print the extracted text to the console
System.Console.WriteLine(AllText);
}
}
}
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Create an instance of IronTesseract for OCR operations
var Ocr = new IronTesseract
{
// Set the OCR language to Sanskrit
Language = OcrLanguage.Sanskrit
};
// Define the input image or PDF file containing Sanskrit text
using (var Input = new OcrInput(@"images\Sanskrit.png"))
{
// Perform OCR to read the text from the Input
var Result = Ocr.Read(Input);
// Capture the extracted text
var AllText = Result.Text;
// Print the extracted text to the console
System.Console.WriteLine(AllText);
}
}
}
' Import the IronOcr namespace
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Create an instance of IronTesseract for OCR operations
Dim Ocr = New IronTesseract With {.Language = OcrLanguage.Sanskrit}
' Define the input image or PDF file containing Sanskrit text
Using Input = New OcrInput("images\Sanskrit.png")
' Perform OCR to read the text from the Input
Dim Result = Ocr.Read(Input)
' Capture the extracted text
Dim AllText = Result.Text
' Print the extracted text to the console
System.Console.WriteLine(AllText)
End Using
End Sub
End Class
- Ten przyklad pokazuje, jak skonfigurowac IronTesseract do wykonania OCR na obrazie lub dokumencie PDF w sanskrycie.
- Metoda
Ocr.Read()przetwarza dane wejsciowe i wyciaga zawartosc tekstowa, ktora jest dostepna przez wlasciwoscResult.Text.

