Sanskrit OCR in C# and .NET
O IronOCR é um componente de software C# que permite aos programadores .NET ler texto de imagens e documentos PDF em 126 idiomas, incluindo o sânscrito.
Trata-se de uma versão avançada do Tesseract, criada exclusivamente para desenvolvedores .NET e que supera regularmente outros mecanismos do Tesseract em termos de velocidade e precisão.
Conteúdo de IronOcr.Languages.Sanskrit
Este pacote contém 49 idiomas de OCR for .NET:
- Sânscrito
- SânscritoBest
- SânscritoFast
Baixar
Pacote de Língua Sânscrita [ससकतम]
Instalação
O primeiro passo é instalar o pacote OCR de sânscrito em seu projeto .NET.
Install-Package IronOcr.Languages.Sanskrit
Exemplo de código
Este exemplo de código C# lê texto sânscrito de uma imagem ou documento 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
Este exemplo demonstra como configurar o IronTesseract para realizar OCR em uma imagem em sânscrito ou em um PDF.
- O método
Ocr.Read()processa a entrada e extrai o conteúdo de texto, que é acessível através da propriedadeResult.Text.

