Giter Site home page Giter Site logo

bin-braille-parser's Introduction

Binary Braille Parser

This readme has a Brazilian Portuguese version (pt-br).

npm version npm downloads

How it works

Binary Braille, nicknamed BinBraille, is an abstraction from conventional Braille, in Braille each letter, symbol or number is represented by 6 possible points, where with the combination of these points the letters are formed, following an example:

Image of the braille

In Binary Braille, we change the points marked by 1 and where we don't mark anything we put 0, for this variation of zeros and one, the abstraction is called Binary Braille. The same pattern of letters in the image above would look like this in the Binary Braille system:

[ "1", "0" ],  [ "1", "0" ],  [ "1", "1" ],  [ "1", "1" ]
[ "0", "0" ],  [ "1", "0" ],  [ "0", "0" ],  [ "0", "1" ]
[ "0", "0" ],  [ "0", "0" ],  [ "0", "0" ],  [ "0", "0" ]
     a              b		   c		  d

Coverage

At the moment, character coverage is throughout the alphabet, numbers, single characters and complex symbols:

(",", ";", ":", "?", "!", "@", "-", "*", "&", "$", ">", "<", "=", "+", "/", "%", "©")

However, it still doesn't support specificities of other languages

Demo

Go to this site and there you can test all the features of the parser.

Installing

Via npm or yarn

npm i bin-braille-parser # or yarn add bin-braille-parser

Disclaimer

This parser follows the Braille language in Brazilian standard, if you want to contribute with the conversion to other languages, feel free and submit your pull request. Check this official language support document.

Usage

const parserTextToBinBraille = require('bin-braille-parser')

parserTextToBinBraille("Jonh snow")

/* The return is
 [ 
  [ [ '0', '1' ], [ '0', '0' ], [ '0', '1' ] ], Character to say that the next letter is capitalized.
  [ [ '0', '1' ], [ '1', '1' ], [ '0', '0' ] ], J
  [ [ '1', '0' ], [ '0', '1' ], [ '1', '0' ] ], o
  [ [ '1', '1' ], [ '0', '1' ], [ '1', '0' ] ], n
  [ [ '1', '0' ], [ '1', '1' ], [ '0', '0' ] ], h
  [ [ '0', '0' ], [ '0', '0' ], [ '0', '0' ] ], 
  [ [ '0', '1' ], [ '1', '0' ], [ '1', '0' ] ], s
  [ [ '1', '1' ], [ '0', '1' ], [ '1', '0' ] ], n
  [ [ '1', '0' ], [ '0', '1' ], [ '1', '0' ] ], o
  [ [ '0', '1' ], [ '1', '1' ], [ '0', '1' ] ]  w
  ]
*/

Running the tests

npm run test #or yarn test

Contribute to this project, send ideas and suggestions on issues !

bin-braille-parser's People

Contributors

ademarcardoso avatar dependabot[bot] 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.