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 językach, 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:
- Sanskryt
- SanskrytBest
- SanskrytFast
Pobieranie
Sanskrit Language Pack [ससकतम]
Instalacja
Pierwszym krokiem jest zainstalowanie pakietu OCR Sanskrit w swoim projekcie .NET.
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
Imports IronOcr
Class Program
Shared Sub Main()
' Create an instance of IronTesseract for OCR operations
Dim Ocr As New IronTesseract With {
' Set the OCR language to Sanskrit
.Language = OcrLanguage.Sanskrit
}
' Define the input image or PDF file containing Sanskrit text
Using Input As 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 wejściowe i wyodrębnia treść tekstową, którą można uzyskać za pomocą właściwościResult.Text.

Curtis Chau posiada tytuł licencjata z informatyki (Uniwersytet Carleton) i specjalizuje się w front-endowym rozwoju, z ekspertką w Node.js, TypeScript, JavaScript i React. Pasjonuje się tworzeniem intuicyjnych i estetycznie przyjemnych interfejsów użytkownika, Curtis cieszy się pracą z nowoczesnymi frameworkami i tworzeniem dobrze zorganizowanych, atrakcyjnych wizualnie podręczników.