Git Product home page Git Product logo

morse-talk's Introduction

Morse Talk

Morse Talk is a Python library which deals with Morse code

Installion

Using pip

pip install morse-talk

Development version

git clone https://github.com/OrkoHunter/morse-talk.git
cd morse-talk/
python setup.py install

Examples

>>> import morse_talk as mtalk

# Encoding in morse
>>> mtalk.encode('Alpha Ranger 45 departed')
'.-   .-..   .--.   ....   .-       .-.   .-   -.   --.   .   .-.       ....-   .....
       -..   .   .--.   .-   .-.   -   .   -..'

# Encoding using binary pattern
>>> mtalk.encode('Alpha Ranger 45 knocked down', encoding='binary')
'1111000111111000111111110001111000111100000001111100011110001111000111111100010001111
10000000111111100011111000000011111110001111000111111111000111111110001111111000100011
11100000001111100011111111100011111110001111'

# Decoding a code encoded in morse
>>> code = '-...   ---   --   -...       -..-       .--.   --'
>>> mtalk.decode(code)
'bomb x pm'

Morse Code

Morse code is a method of transmitting text information as a series of on-off tones, lights, or clicks that can be directly understood by a skilled listener or observer without special equipment. The International Morse Code encodes the ISO basic Latin alphabet, some extra Latin letters, the Arabic numerals and a small set of punctuation and procedural signals as standardized sequences of short and long signals called "dots" and "dashes", or "dits" and "dahs". Because many non-English natural languages use more than the 26 Roman letters, extensions to the Morse alphabet exist for those languages.

Morse Code table

International Morse code is composed of five elements:

  • short mark, dot or "dit" (ยท) : "dot duration" is one time unit long
  • longer mark, dash or "dah" (โ€“) : three time units long
  • inter-element gap between the dots and dashes within a character : one dot duration or one unit long
  • short gap (between letters) : three time units long
  • medium gap (between words) : seven time units long

Morse Code graph

morse-talk's People

Contributors

orkohunter avatar sylvainde avatar

Watchers

 avatar  avatar  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.