All Projects → LazoCoder → Braille-Translator

LazoCoder / Braille-Translator

Licence: GPL-3.0 license
Translates standard alphabet based text to Grade 2 Braille and back.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Braille-Translator

meetup-ad-schematic
Introduction to reverse engineering design file formats as presented on Hardware Developers Didactic Galactic meetup on October 9th
Stars: ✭ 32 (+10.34%)
Mutual labels:  translator
kaldi helpers
🙊 A set of scripts to use in preparing a corpus for speech-to-text processing with the Kaldi Automatic Speech Recognition Library.
Stars: ✭ 13 (-55.17%)
Mutual labels:  transcription
xiaoyi crack
彩云小译Chrome插件破解版1.0.3
Stars: ✭ 247 (+751.72%)
Mutual labels:  translator
JamTools
JamTools是一个跨平台的小工具集,包含了截屏、录屏、文字识别、各种格式转换、鼠标键盘动作录制播放、文件传输、聊天机器人等功能
Stars: ✭ 73 (+151.72%)
Mutual labels:  translator
speech-to-text
Python helper for Google and IBM Watson speech-to-text cloud APIs.
Stars: ✭ 14 (-51.72%)
Mutual labels:  transcription
DeepLTranslator
The DeepL Translator is an API written in Java that translates via the DeepL website sentences. Without API key.
Stars: ✭ 45 (+55.17%)
Mutual labels:  translator
glaemscribe
Glaemscribe, the tolkienian languages/writings transcription engine.
Stars: ✭ 29 (+0%)
Mutual labels:  transcription
scription
An editor for speech-to-text transcripts such as AWS Transcribe and Mozilla DeepSpeech
Stars: ✭ 46 (+58.62%)
Mutual labels:  transcription
kaldi-long-audio-alignment
Long audio alignment using Kaldi
Stars: ✭ 21 (-27.59%)
Mutual labels:  transcription
simple-translator
Simple, universal translation with pure JavaScript.
Stars: ✭ 58 (+100%)
Mutual labels:  translator
DocumentTranslation
Command Line tool and Windows application for document translation, a local interface to the Azure Document Translation service for Windows, macOS and Linux.
Stars: ✭ 61 (+110.34%)
Mutual labels:  translator
PSAVanCanBridge
VAN - CAN protocol bridge (V2C) for cars made by PSA Group (Peugeot, Citroen)
Stars: ✭ 67 (+131.03%)
Mutual labels:  translator
EverTranslator
Translate text anytime and everywhere, even you are gaming!
Stars: ✭ 59 (+103.45%)
Mutual labels:  translator
translator
Translates for Korean
Stars: ✭ 32 (+10.34%)
Mutual labels:  translator
deepl-api-connector
Connector library for deepl.com rest translation api
Stars: ✭ 12 (-58.62%)
Mutual labels:  translator
godmt
Tool that can parse Go files into an abstract syntax tree and translate it to several programming languages.
Stars: ✭ 42 (+44.83%)
Mutual labels:  translator
fenrir
An TTY screenreader for Linux.
Stars: ✭ 33 (+13.79%)
Mutual labels:  braille
cmu-pronouncing-dictionary
The 134,000+ words and their pronunciations in the CMU pronouncing dictionary
Stars: ✭ 46 (+58.62%)
Mutual labels:  transcription
gtranscribe
Software for interview transcription
Stars: ✭ 12 (-58.62%)
Mutual labels:  transcription
trans
a small and fast translator living in macOS menu bar
Stars: ✭ 77 (+165.52%)
Mutual labels:  translator

Braille-Translator

Translating text to Grade 2 Braille is a non-trivial task since it is not just a variant of the alphabet, it is an independent writing system. Iterating over a string and translating it one character at a time will not yield correct results for Grade 2 Braille. Many braille symbols have multiple meanings and this can lead to ambiguities. Furthermore, certain words and letters that are commonly seen in the English language can be represented by fewer braille symbols than there are letters (these are called contractions). The algorithm used in this software is summarized below.

Sample

The following is the above introduction translated to braille:

⠠⠞⠗⠁⠝⠎⠇⠁⠞⠊⠝⠛ ⠞⠑⠭⠞ ⠖ ⠠⠛⠗⠁⠙⠑ ⠼⠃ ⠠⠃⠗⠁⠊⠇⠇⠑ ⠊⠎ ⠁ ⠝⠕⠝⠤⠞⠗⠊⠧⠊⠁⠇ ⠞⠁⠎⠅ ⠎⠊⠝⠉⠑ ⠭ ⠊⠎ ⠝ ⠚ ⠁ ⠧⠁⠗⠊⠁⠝⠞ ⠷ ⠮ ⠁⠇⠏⠓⠁⠃⠑⠞⠂ ⠭ ⠊⠎ ⠁⠝ ⠊⠝⠙⠑⠏⠑⠝⠙⠑⠝⠞ ⠺⠗⠊⠞⠊⠝⠛ ⠎⠽⠎⠞⠑⠍⠲ ⠠⠊⠞⠑⠗⠁⠞⠊⠝⠛ ⠕⠧⠑⠗ ⠁ ⠎⠞⠗⠊⠝⠛ ⠯ ⠞⠗⠁⠝⠎⠇⠁⠞⠊⠝⠛ ⠭ ⠕⠝⠑ ⠉⠓⠁⠗⠁⠉⠞⠑⠗ ⠁⠞ ⠁ ⠞⠊⠍⠑ ⠺ ⠝ ⠽⠊⠑⠇⠙ ⠉⠕⠗⠗⠑⠉⠞ ⠗⠑⠎⠥⠇⠞⠎ ⠿ ⠠⠛⠗⠁⠙⠑ ⠼⠃ ⠠⠃⠗⠁⠊⠇⠇⠑⠲ ⠠⠍⠁⠝⠽ ⠃⠗⠁⠊⠇⠇⠑ ⠎⠽⠍⠃⠕⠇⠎ ⠓ ⠍⠥⠇⠞⠊⠏⠇⠑ ⠍⠑⠁⠝⠊⠝⠛⠎ ⠯ ⠞⠓⠊⠎ ⠉ ⠇⠑⠁⠙ ⠖ ⠁⠍⠃⠊⠛⠥⠊⠞⠊⠑⠎⠲ ⠠⠋⠥⠗⠞⠓⠑⠗⠍⠕⠗⠑⠂ ⠉⠑⠗⠞⠁⠊⠝ ⠺⠕⠗⠙⠎ ⠯ ⠇⠑⠞⠞⠑⠗⠎ ⠞ ⠁⠗⠑ ⠉⠕⠍⠍⠕⠝⠇⠽ ⠎⠑⠑⠝ ⠔ ⠮ ⠠⠑⠝⠛⠇⠊⠎⠓ ⠇⠁⠝⠛⠥⠁⠛⠑ ⠉ ⠃⠑ ⠗⠑⠏⠗⠑⠎⠑⠝⠞⠑⠙ ⠃⠽ ⠋⠑⠺⠑⠗ ⠃⠗⠁⠊⠇⠇⠑ ⠎⠽⠍⠃⠕⠇⠎ ⠞⠓⠁⠝ ⠞⠓⠑⠗⠑ ⠁⠗⠑ ⠇⠑⠞⠞⠑⠗⠎ ⠶⠞⠓⠑⠎⠑ ⠁⠗⠑ ⠉⠁⠇⠇⠑⠙ ⠉⠕⠝⠞⠗⠁⠉⠞⠊⠕⠝⠎⠶⠲ ⠠⠮ ⠁⠇⠛⠕⠗⠊⠞⠓⠍ ⠥⠎⠑⠙ ⠔ ⠞⠓⠊⠎ ⠎⠕⠋⠞⠺⠁⠗⠑ ⠊⠎ ⠎⠥⠍⠍⠁⠗⠊⠵⠑⠙ ⠃⠑⠇⠕⠺⠲

Usage


Usage:
    Usage:
        main.py <parameter>
        main.py <file name> <parameter>
    Parameters:
        -braille | --b      translate braille to text
        -text    | --t      translate text to braille
        -help    | --h      display this screen
        -map     | --m      print translation map

The Algorithm for Translating Alphabet Based Text to Grade 2 Braille:

  1. Split up the text into words by dividing them based on whitespace characters.
    • Whitespace includes spaces (' ') and new lines ('\n')
  2. For each word, handle the numbers first.
    • Numbers in braille use the same symbols as the first 10 letters of the alphabet.
      • The number '7' and the letter 'g' are both represented by '⠛'.
      • To differentiate between numbers and letters, an escape code (⠼) is placed before groups of numbers.
      • Therefore '7' is actually '⠼⠛' whereas 'g' is only '⠛'.
    • In this step, only the numbers are dealt with, so there will be a mix of both braille and Alphabet symbols.
      • Example: "123-456-JUNK" becomes "⠼⠁⠃⠉-⠼⠙⠑⠋-JUNK"
  3. Handle the capitals.
    • Similarly to numbers in braille, capital letters need an escape code (⠠).
    • The escape code (⠠) is added to the beginning of each capital letter and the letter is changed to lowercase.
      • Example 1: "⠼⠁⠃⠉-⠼⠙⠑⠋-JUNK" becomes "⠼⠁⠃⠉-⠼⠙⠑⠋-⠠j⠠u⠠n⠠k". The dashes still remain.
      • Example 2: "Sweet" becomes "⠠sweet". The non-capital letters remain untouched.
  4. Trim the word.
    • Sometimes the words extracted contain punctuation attached to them such as commas or brackets.
    • Words need to be trimmed so that they can be converted to contractions.
      • Example: The word "the" is represented by a single braille symbol (⠮).
      • If the word "the" has punctuation around it ("the!") then it will not be interpreted correctly.
      • This is also why capitals are converted to lowercase in step 3 because "The" would not work either.
    • The characters that are trimmed off are called "shavings".
      • Example: In the word "!where?", the shavings are "!?" and the trimmed word is "where".
  5. Build the translation.
    1. Check to see if the trimmed word can be contracted.
      • This includes common words like "the", "in", "you" etc...
    2. Translate the remaining characters that are still alphabetic.
    3. Translate the shavings (this will mostly just be punctuation).
      • Exceptions to be mindful of:
        • There is no braille symbol for a generic quote (")
        • There is only open quotation (“) and closed quotation (”).
        • Therefore we must keep track of what the last quotation was to translate it correctly.

Disclaimer

Creating a perfect braille translation can only be done by a human as it requires an understanding of the content at hand. Also, many braille contractions follow pronunciation so programming this can be quite tricky. For instance, the “th” contraction that is used in “thought” would not be used in “pothole”.

This Braille Translator does not include partial contractions as this would increase the complexity of the code ten-fold. This software is meant to provide a rough translation and was written as a means for me to learn Python. Anyone who wants to produce quality braille to meet contract standards should consider consulting an expert instead.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].