Git Product home page Git Product logo

br6's Introduction

Br6

A simple, Unified English Braille (UEB) Grade 1 library [old WIP]

Br6 = 6-dot Braille

Usage

Installing:

npm install br6

Example:

const {toBrailleText, toAlphabetText} = require('br6');

const sentence = 'Lewis CARROLL published "ALICE IN WONDERLAND" in 1865. ^~^';
const inBraille = toBrailleText(sentence);
// '⠠⠇⠑⠺⠊⠎⠀⠠⠠⠉⠁⠗⠗⠕⠇⠇⠀⠏⠥⠃⠇⠊⠎⠓⠑⠙⠀⠦⠠⠠⠠⠁⠇⠊⠉⠑⠀⠊⠝⠀⠺⠕⠝⠙⠑⠗⠇⠁⠝⠙⠠⠄⠴⠀⠊⠝⠀⠼⠁⠓⠋⠑⠲⠀⠤⠤⠤'
const inAlphabet = toAlphabetText(inBraille);
// 'Lewis CARROLL published “ALICE IN WONDERLAND” in 1865. ---'

Learning Braille

These are the resources I used and liked:

How It Works

Legend: ORANGE MEANS CHANGE; GREEN MEANS ADDITION. The GitHub Pages' version displays colors correctly.

  • Starting with a text like this:

Lewis CARROLL published "ALICE IN WONDERLAND" in 1865. ^~^

  • Convert straight quotation marks to curly ones

Lewis CARROLL published ALICE IN WONDERLAND in 1865. ^~^

  • Replace (yet) unsupported characters with "-"

Lewis CARROLL published “ALICE IN WONDERLAND” in 1865. ---

  • Add capital indicators and terminators, then lowercase everything

Lewis CARROLL published “⠠⠠⠠alice in wonderland⠠⠄” in 1865. ---

Lewis ⠠⠠carroll published “⠠⠠⠠alice in wonderland⠠⠄” in 1865. ---

lewis ⠠⠠carroll published “⠠⠠⠠alice in wonderland⠠⠄” in 1865. ---

  • Add numeric indicators and translate numbers

⠠lewis ⠠⠠carroll published “⠠⠠⠠alice in wonderland⠠⠄” in ⠁⠓⠋⠑. ---

  • Using a map, convert the remaining characters to Braille

⠇⠑⠺⠊⠎⠀⠠⠠⠉⠁⠗⠗⠕⠇⠇⠀⠏⠥⠃⠇⠊⠎⠓⠑⠙⠀⠦⠠⠠⠠⠁⠇⠊⠉⠑⠀⠊⠝⠀⠺⠕⠝⠙⠑⠗⠇⠁⠝⠙⠠⠄⠴⠀⠊⠝⠀⠼⠁⠓⠋⠑⠲⠀⠤⠤⠤

  • And there you have it:

⠠⠇⠑⠺⠊⠎⠀⠠⠠⠉⠁⠗⠗⠕⠇⠇⠀⠏⠥⠃⠇⠊⠎⠓⠑⠙⠀⠦⠠⠠⠠⠁⠇⠊⠉⠑⠀⠊⠝⠀⠺⠕⠝⠙⠑⠗⠇⠁⠝⠙⠠⠄⠴⠀⠊⠝⠀⠼⠁⠓⠋⠑⠲⠀⠤⠤⠤

TODO

  • Either handle letters with accents/diacritics, or remove them (Téle -> Tele)
  • Support contractions and wordsigns
  • ...

License

CC0

br6's People

Contributors

djalilhebal avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.