Braille is a tactile writing system used by visually impaired people.
It can be read on embossed paper or using refreshable braille displays connecting to computers and smartphone devices.
Braille can be written using a slate and stylus, a braille writer, an electronic braille notetaker, or a computer connected to a braille embosser.
Liblouis is an open-source braille translator and back-translator named in honor of Louis Braille. It features support for computer and literary braille, supports contracted and uncontracted translation for many languages, and has support for hyphenation. New languages can easily be added through tables that support a rule- or dictionary-based approach. Tools for testing and debugging tables are also included.
Install louis on your OS.
To use it in Python you need to install it for Python 3
Now you can use it on the command line or in Python.
It can be read on embossed paper or using refreshable braille displays connecting to computers and smartphone devices.
Braille can be written using a slate and stylus, a braille writer, an electronic braille notetaker, or a computer connected to a braille embosser.
Install louis on your OS.
git clone https://github.com/liblouis/liblouis
cd liblouis
./configure
make
sudo make install
sudo ldconfig
cd python
sudo python3 setup.py install
import louis
table = ["ur-pk-g2.ctb"]
line = "ایک قدم آگے بڑھیں۔"
translation = louis.translateString(table, line, 0, 0)
print(translation)
and the translation for the sentence is
⠁ ⠟⠙⠍ ⠜⠛⠌ ⠃⠻⠦⠊⠰⠲
⠁ ⠟⠙⠍ ⠜⠛⠌ ⠃⠻⠦⠊⠰⠲
You can use the backtranslation as well.
print(louis.backTranslateString(table, translation))
and the output of back translation is.
ایک قدم آگے بڑھیں۔
Comments
Post a Comment