arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

Add more languages

This page explains how to install language packages to support Optical Character Recognition (OCR) on more languages.

To be able to perform OCR, Datashare uses an open source technology called Apache Tesseract. When Tesseract extracts text from images, it uses 'language packages' especially trained for each specific languages. Unfortunately, those packages can be heavy and to ensure a lightweight installation of Datashare, the installer doesn't use them all by default. In the case Datashare informs you of a missing package, this guide explains you how to manually install it on your system.

hashtag
Install packages on Linux

To add OCR languages on Linux, simply use the following command:

Where `[lang]` is can be :

  • all if you want to install all languages

  • a language code (ex: fra, for French), the list of languages is available

hashtag
Install packages on Mac

The Datashare Installer for Mac checks for the existence of either or , which package managers are used for the installation of Tesseract. If none of those two package managers is present, the Datashare Installer will install MacPorts by default.

hashtag
With MacPorts (default)

First, you must check that MacPort is installed on your computer. Please run in a Terminal:

You should see an output similar to this:

If you get a command not found: port, this either means you are using Homebrew (see next section) or you did not yet.

If MacPort is installed on your computer, you should be able to add the missing Tesseract language package with the following command (for German):

The full list of supported language packages can be found .

Once the installation is done, close and restart Datashare to be able to use the newly installed packages.

hashtag
With Homebrew

If Homebrew was already present on your system when Datashare was installed, Datashare used it to install Tesseract and its language packages. Because Homebrew doesn't package each Tesseract language individually, all languages are already supported by your system. In other words, you have nothing to do!

If you want to check if Homebrew is installed, run the following command in a Terminal:

You should see an output similar to this:

If you get a command not found: brew error, this mean Homebrew is not installed on your system. You might either use MacPorts (see previous section) or on your computer.

hashtag
Install languages on Windows

Languages packages are available on Tesseract . Trained data files have to be downloaded and added into tessdata folder in Tesseract's installation folder.

*Additional languages can be also added during Tesseract's installation.

The list of installed languages can be checked with Windows command prompt or Powershell with the command tesseract --list-langs.

Datashare has to be restarted after the language installation. Check how for , and .

sudo apt install tesseract-ocr-[lang]
herearrow-up-right
MacPortsarrow-up-right
Homebrewarrow-up-right
run the Datashare installer for Mac
on MacPorts websitearrow-up-right
run the Datashare installer for Mac
Github repositoryarrow-up-right
Mac
Windows
Linux
Download and add French into tessdata
French is listed in installed languages
port version
port install tesseract-deu
brew -v
Screenshot of a terminal window with the text: username % port version / version 2.8.0 / username %
Screenshot of a terminal window with a text mentioning homebrew
Screenshot of the Tessdata folder showing languages files
Screenshot of the command tesseract --list-langs. with the result: 'List of available languages (3): eng fra osd'