Braille Text Analysis

Students will use string manipulations, turtles, lists, and dictionaries to collect and analyze braille text

A person sitting in front of a laptop and braille display. The person is wearing headphones connected to the laptop and is using their hands to touch and read the braille display.

(Figure 1) Person using a screen reader, by Elypse at stock.adobe.com


A braille display with keypads. The keypads are arranged in an ergonomic fashion such that the keys are angled the way hands naturally rest.

(Figure 2) An example of a braille display, from PaTTAN


Braille was also the first writing system with binary encoding. The system as devised by Louis Braille consists of two parts:

  • Character encoding that mapped characters of the alphabet to arrays of six bits.
  • The physical representation of those six-bit characters with raised dots in a braille cell.

Within an individual cell, the dot positions are arranged in a three by two grid. A raised dot can appear in any of the six positions, producing sixty-four possible patterns, including one in which there are no raised dots.

A braille letter is commonly described by listing the positions where dots are raised. The positions are universally numbered, from top to bottom, as 1 to 3 on the left column and 4 to 6 on the right column. For example, dot pattern 1-3-4 describes a cell with three dots raised at the top and bottom of the left column and at the top of the right column: the letter “m” ⡉

The following describes some patterns within grade 1 braille:

  1. The first ten letters of the alphabet, “a-j”, use the upper four dot positions:
    ⠁⠃⠉⠙⠑⠋⠛⠓⠊⠚ (black dots in the table below).
  2. The next ten letters, “k-t”, are similar to “a-j” with an addition of a dot at position 3:
    ⠅⠇⠍⠝⠕⠏⠟⠗⠎⠞ (red dots in the table below)
  3. The next ten letters (the next "decade") are the same again, but with dots also at positions 3 and 6 (green dots in the table below). Here “w” was left out as it was not a part of the official French alphabet during the time Louis Braille was alive.
  4. A space in braille is represented by a cell with no dots raised.
Table showing the language of braille, color coded to demonstrate the differences between decades.

(Figure 3)

Grade 2 braille is just like grade 1 braille, except there are extra braille representations for commonly used words (“for,” “the,” “will”) and letter combinations (“th,” “-ing,” “st”). This makes grade 2 braille a popular choice in most publications as it shortens the number of pages. Here the keys should be strings corresponding to the word (e.g. “us”). Note that the final word should actually be “will” not “wil”.

A chart of braille representations for commonly used words, including but, can, do, every, and other words.

(Figure 4) Examples of abbreviated braille words, from ContactLensKing


The skeleton code contains a braille_dictionary that contains the braille representations of the alphabet a-z, the numbers 0-9, the space, and grade 2 braille. The keys in the dictionary correspond to the ASCII characters and the values are their Braille representation. The Braille representation is a list of 1's and 0's with raised dots represented as 1's and flat dots represented as 0's. For example, the key “n” in the dictionary corresponds to the value: [1,0,1,1,1,0]. Note that the numbering starts in the upper left of the braille cell and goes down column one and then column 2.