Coder Social home page Coder Social logo

kalenchukov / morsecode Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 76 KB

Кодировщик / декодировщик азбуки Морзе (Morse code encoder / decoder)

License: MIT License

Java 100.00%
morse morse-code morse-code-converter morse-code-translator morse-conversion morse-decode morse-decoder morse-encode morse-translator morsecode

morsecode's Introduction

Справка

MorseCode

Кодировщик / декодировщик азбуки Морзе.

Поддерживаемые языки

  • Русский
  • Английский (соответствует рекомендации МСЭ-R M.1677-1)

Схема сопоставления для чисел

Схема сопоставления поддерживаются по умолчанию и идентична для всех языков.

Соответствует рекомендации МСЭ-R M.1677-1.

Символ Сигнал
0 -----
1 .----
2 ..---
3 ...--
4 ....-
5 .....
6 -....
7 --...
8 ---..
9 ----.

Схема сопоставления для спецсимволов

Схема сопоставления поддерживаются по умолчанию и идентична для всех языков.

Соответствует рекомендации МСЭ-R M.1677-1.

Символ Сигнал
. .-.-.-
, --..--
: ---...
? ..--..
' .----.
- -....-
/ -..-.
; -.-.-.
( -.--.
) -.--.-
" .-..-.
= -...-
+ .-.-.
& .-...
_ ..--.-
$ ...-..-

Использование

Перечисления

Получение схемы сопоставления

import dev.kalenchukov.morsecode.resources.Language;

Language.RUSSIAN.getScheme();

Кодирование и декодирование

Кодирование

import dev.kalenchukov.morsecode.resources.Language;
import dev.kalenchukov.morsecode.MorseCodable;
import dev.kalenchukov.morsecode.MorseCode;

MorseCodable morseCode = new MorseCode(Language.RUSSIAN);
morseCode.encode("Эх, чужд кайф, сплющь объём вши, грызя цент.");

Результат выполнения:

..-.. .... --..--   ---. ..- ...- -..   -.- .- .--- ..-. --..--   ... .--. .-.. ..-- --.- -..-   --- -... .--.-. . --   .-- ---- .. --..--   --. .-. -.-- --.. .-.-   -.-. . -. - .-.-.-

Декодирование

import dev.kalenchukov.morsecode.resources.Language;
import dev.kalenchukov.morsecode.MorseCodable;
import dev.kalenchukov.morsecode.MorseCode;

MorseCodable morseCode = new MorseCode(Language.RUSSIAN);
morseCode.decode("..-.. .... --..--   ---. ..- ...- -..   -.- .- .--- ..-. --..--   ... .--. .-.. ..-- --.- -..-   --- -... .--.-. . --   .-- ---- .. --..--   --. .-. -.-- --.. .-.-   -.-. . -. - .-.-.-");

Результат выполнения:

ЭХ, ЧУЖД КАЙФ, СПЛЮЩЬ ОБЪЕМ ВШИ, ГРЫЗЯ ЦЕНТ.

morsecode's People

Contributors

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