{"id":16271166,"url":"https://github.com/superiorlu/morse_code","last_synced_at":"2025-10-04T06:30:40.213Z","repository":{"id":56884538,"uuid":"151640594","full_name":"superiorlu/morse_code","owner":"superiorlu","description":" Simple Morse Code Encode and Decode Tool","archived":false,"fork":false,"pushed_at":"2020-09-21T07:13:29.000Z","size":36,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-08T09:45:13.270Z","etag":null,"topics":["decode","encode","morse","morse-code","wavefile"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/superiorlu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-04T21:53:00.000Z","updated_at":"2020-10-20T02:23:31.000Z","dependencies_parsed_at":"2022-08-20T23:40:43.861Z","dependency_job_id":null,"html_url":"https://github.com/superiorlu/morse_code","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superiorlu%2Fmorse_code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superiorlu%2Fmorse_code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superiorlu%2Fmorse_code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superiorlu%2Fmorse_code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/superiorlu","download_url":"https://codeload.github.com/superiorlu/morse_code/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235222571,"owners_count":18955330,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["decode","encode","morse","morse-code","wavefile"],"created_at":"2024-10-10T18:12:43.945Z","updated_at":"2025-10-04T06:30:34.957Z","avatar_url":"https://github.com/superiorlu.png","language":"Ruby","readme":"# MorseCode\n\nSimple Morse Code Encode and Decode Tool\n\n[![Gem Version](http://img.shields.io/gem/v/morse-code-rb.svg)](https://rubygems.org/gems/morse-code-rb) [![Build Status](https://travis-ci.org/superiorlu/morse_code.svg)](https://travis-ci.org/superiorlu/morse_code) [![Maintainability](https://api.codeclimate.com/v1/badges/62b6eb7ed9b65c62d3f6/maintainability)](https://codeclimate.com/github/superiorlu/morse_code/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/62b6eb7ed9b65c62d3f6/test_coverage)](https://codeclimate.com/github/superiorlu/morse_code/test_coverage) [![GitHub license](https://img.shields.io/github/license/superiorlu/morse_code.svg)](https://github.com/superiorlu/morse_code/blob/master/LICENSE.md)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'morse-code-rb'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install morse-code-rb\n\n## Usage\n\n### Encode\n\n```ruby\nrequire 'morse_code'\n\ncontent = 'I am Robot.'\nMorseCode::Encoder.new(content).encode\n=\u003e \".. / .- -- / .-. --- -... --- - .-.-.-\"\n\nMorseCode::Encoder.new(content).dit_dah\n=\u003e \"DITDIT / DITDAH DAHDAH / DITDAHDIT DAHDAHDAH DAHDITDITDIT DAHDAHDAH DAH DITDAHDITDAHDITDAH\"\n\ncontent = 'I am Chinese 我是中国人'\nMorseCode::Encoder.new(content).encode\n=\u003e \".. / .- -- / -.-. .... .. -. . ... . / --...-....-...- --..--...-.---- -..---...-.--.- -.-.--.------.- -..---.-.---.-.\"\n\nMorseCode::Encoder.new(content).dit_dah\n=\u003e \"DITDIT / DITDAH DAHDAH / DAHDITDAHDIT DITDITDITDIT DITDIT DAHDIT DIT DITDITDIT DIT / DAHDAHDITDITDITDAHDITDITDITDITDAHDITDITDITDAH DAHDAHDITDITDAHDAHDITDITDITDAHDITDAHDAHDAHDAH DAHDITDITDAHDAHDAHDITDITDITDAHDITDAHDAHDITDAH DAHDITDAHDITDAHDAHDITDAHDAHDAHDAHDAHDAHDITDAH DAHDITDITDAHDAHDAHDITDAHDITDAHDAHDAHDITDAHDIT\"\n```\n\n#### Generate Wave File\n\n```ruby\nrequire 'morse_code'\n\ncontent = 'I am Robot.'\nMorseCode::Encoder.new(content).wave\n=\u003e \"/tmp/morse_code-5b9b3aa176.wav\"\n```\nyou can open [wavefile](https://pan.baidu.com/s/1TtpfOzJplyFLDu_hbk8V7A) and listen to the morse code sound.\n\n\n### Decode\n\n```ruby\nrequire 'morse_code'\n\ncontent = '.. / .- -- / .-. --- -... --- - .-.-.-'\nMorseCode::Decoder.new(content).decode\n=\u003e \"I AM ROBOT.\"\n\ndit_dah = 'DITDIT / DITDAH DAHDAH / DITDAHDIT DAHDAHDAH DAHDITDITDIT DAHDAHDAH DAH DITDAHDITDAHDITDAH'\nMorseCode::Decoder.new(dit_dah).dit_dah_to\n=\u003e \"I AM ROBOT.\"\n\ncontent = '.. / .- -- / -.-. .... .. -. . ... . / --...-....-...- --..--...-.---- -..---...-.--.- -.-.--.------.- -..---.-.---.-.'\nMorseCode::Decoder.new(content).decode\n=\u003e \"I AM CHINESE 我是中国人\"\n```\n\n### Terminal\n\n```shell\n$\u003e mc\nmc commands:\n  mc decode MESSAGE  # decode Morse Code as original message\n  mc encode MESSAGE  # encode message as Morse Code\n  mc help [COMMAND]  # Describe available commands or one specific command\n```\n\n#### encode\n\n```shell\n$\u003e mc help encode\nUsage:\n  mc encode MESSAGE\n\nOptions:\n  -d, [--dit-dah], [--no-dit-dah]  # encode DITDAH message\n  -w, [--wave], [--no-wave]        # gen morse code wav\n\nencode message as Morse Code\n```\n\n```shell\n$\u003e mc -e 'I am Robot.'\n=\u003e \".. / .- -- / .-. --- -... --- - .-.-.-\"\n\n$\u003e mc -e 'I am Robot.' --dit-dah\n=\u003e \"DITDIT / DITDAH DAHDAH / DITDAHDIT DAHDAHDAH DAHDITDITDIT DAHDAHDAH DAH DITDAHDITDAHDITDAH\"\n\n$\u003e mc -e 'I am Chinese 我是中国人'\n=\u003e \".. / .- -- / -.-. .... .. -. . ... . / --...-....-...- --..--...-.---- -..---...-.--.- -.-.--.------.- -..---.-.---.-.\"\n\n$\u003e mc -e -w 'I am Chinese 我是中国人'\n=\u003e \".. / .- -- / -.-. .... .. -. . ... . / --...-....-...- --..--...-.---- -..---...-.--.- -.-.--.------.- -..---.-.---.-.\"\n=\u003e \"Generate wave file: /tmp/morse_code-0d56cd233e.wav\"\n```\n\nyou can open [wavefile](https://pan.baidu.com/s/1v5RcZSsYOHBxkF7nsbAz_g) and listen to the morse code sound.\n\n#### decode\n\n```shell\n$\u003e mc -d '.. / .- -- / .-. --- -... --- - .-.-.-'\n=\u003e \"I AM ROBOT.\"\n\n$\u003e mc -d 'DITDIT / DITDAH DAHDAH / DITDAHDIT DAHDAHDAH DAHDITDITDIT DAHDAHDAH DAH DITDAHDITDAHDITDAH' --dit-dah\n=\u003e \"I AM ROBOT.\"\n\n$\u003e mc -d '.. / .- -- / -.-. .... .. -. . ... . / --...-....-...- --..--...-.---- -..---...-.--.- -.-.--.------.- -..---.-.---.-.'\n=\u003e \"I AM CHINESE 我是中国人\"\n```\n\n### Contributing\n\n#### Fork the Project\n\n```shell\n$ git https://github.com/superiorlu/morse_code.git\n$ cd morse_code\n$ git remote add upstream https://github.com/superiorlu/morse_code.git\n```\n\n#### Create a Toptic Branch\n\n```shell\n$ git checkout master\n$ git pull upstream master\n$ git checkout -b my-feature-branch\n```\n\n#### Run Test\n\n```shell\n$ bundle exec rake test\n```\n\n#### Make a Pull Request\n\nClick the `'Pull Request'` button and fill out the form.\n\n### Resource\n - [Learn More Code](http://www.learnmorsecode.com/)\n - [Morse Pro](https://github.com/scp93ch/morse-pro)\n - [Wavefile](https://github.com/jstrait/wavefile)\n\n### License\n\nMIT License. See [LICENSE](https://github.com/superiorlu/morse_code/blob/master/LICENSE.md) for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperiorlu%2Fmorse_code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuperiorlu%2Fmorse_code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperiorlu%2Fmorse_code/lists"}