Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

177
Visualizações
Tesseract.js doesn't recognize Arabic language

I'm using tesseract.js ORC library to read what is written on an image and write it in console or on a text file so I found this library and it's working find with English word or characters but when I tried to read what is written on the image in Arabic language it doesn't work so this is the image that I'm trying to read

enter image description here

and this is my code :-

Head Tag:-

<script src='https://unpkg.com/tesseract.js@v2.1.0/dist/tesseract.min.js'</script>

Body Tag:-

    <script>
        Tesseract.recognize(
        'image.png',
        'ara',
  { logger: m => console.log(m) }
).then(({ data: { text } }) => {

})
</script>
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You need to handle the result inside the .then() block.

Here's a working example :

<!DOCTYPE html>
<meta charset="utf-8">
<title> OCR TEST </title>
<script src="https://unpkg.com/tesseract.js@v2.1.0/dist/tesseract.min.js"></script>
<output id="result">Processing...</output>
<script>
  const output = document.querySelector('output#result');
  Tesseract.recognize(
    'https://i.imgur.com/mdzmK4w.png', 'ara'
  ).then(result => {
    output.value = result.data.text;
  }).catch(err => {
    output.value = 'Processing Failed';
    console.log(err);
  });
</script>

It can take some time to process, especially on the first load because the WASM module and OCR training data will be fetched in the background first. You can see this happening in the Network tab of your Dev Tools.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda