Divehi 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 divehi.
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.Idiomas.Divehi
Este pacote contém 43 linguagens OCR for .NET:
- Divehi
- DivehiBest
- DivehiFast
Baixar
Pacote de idioma Divehi [recolherarquante]
Instalação
A primeira coisa que precisamos fazer é instalar o pacote Divehi OCR no seu projeto .NET .
Install-Package IronOcr.Languages.Divehi
Exemplo de código
Este exemplo de código C# lê texto em divehi de uma imagem ou documento PDF.
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Create an instance of the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Set the OCR language to Divehi
Ocr.Language = OcrLanguage.Divehi;
// Load the image or PDF document into the OCR processor
using (var Input = new OcrInput(@"images\Divehi.png"))
{
// Perform OCR on the input document
var Result = Ocr.Read(Input);
// Extract all recognized text
var AllText = Result.Text;
// Output the extracted text to the console
Console.WriteLine(AllText);
}
}
}
// Import the IronOcr namespace
using IronOcr;
class Program
{
static void Main()
{
// Create an instance of the IronTesseract OCR engine
var Ocr = new IronTesseract();
// Set the OCR language to Divehi
Ocr.Language = OcrLanguage.Divehi;
// Load the image or PDF document into the OCR processor
using (var Input = new OcrInput(@"images\Divehi.png"))
{
// Perform OCR on the input document
var Result = Ocr.Read(Input);
// Extract all recognized text
var AllText = Result.Text;
// Output the extracted text to the console
Console.WriteLine(AllText);
}
}
}
' Import the IronOcr namespace
Imports IronOcr
Friend Class Program
Shared Sub Main()
' Create an instance of the IronTesseract OCR engine
Dim Ocr = New IronTesseract()
' Set the OCR language to Divehi
Ocr.Language = OcrLanguage.Divehi
' Load the image or PDF document into the OCR processor
Using Input = New OcrInput("images\Divehi.png")
' Perform OCR on the input document
Dim Result = Ocr.Read(Input)
' Extract all recognized text
Dim AllText = Result.Text
' Output the extracted text to the console
Console.WriteLine(AllText)
End Using
End Sub
End Class
Explicação
- Importando o IronOCR : O exemplo começa importando o namespace IronOCR necessário.
- Criando Motor OCR: Uma instância de
IronTesseract, o motor OCR, é criada. - Especificando o idioma : O idioma para processamento de OCR está definido como Divehi, garantindo um reconhecimento preciso e adaptado a esse idioma.
- Carregando Entrada: Uma imagem ou documento PDF é aberto usando
OcrInput, pronto para extração de texto. - Executando OCR: O método
Readprocessa a entrada e extrai o texto. - Extração de Texto: O texto reconhecido é armazenado em
AllTexte impresso no console.
Este código demonstra uma maneira simples, porém poderosa, de utilizar o IronOCR para ler a escrita Divehi em documentos digitais.

