Morse Code Library in Go

Overview

morse

Go Report Card CircleCI codecov Documentation License

Morse Code Library in Go

Download and Use

go get -u -v github.com/alwindoss/morse

or

dep ensure -add github.com/alwindoss/morse

Sample Usage

package main

import (
	"fmt"
	"strings"

	"github.com/alwindoss/morse"
)

func main() {
	h := morse.NewHacker()
	morseCode, err := h.Encode(strings.NewReader("Convert this to Morse"))
	if err != nil {
		return
	}
	// Morse Code is: -.-. --- ...- . .-. - / - .... .. ... / - --- / -- --- .-. ... .
	fmt.Printf("Morse Code is: %s\n", string(morseCode))
}
Comments
  • special characters is supported?

    special characters is supported?

    Is your feature request related to a problem? Please describe. Excuse me, special characters, such as: ":", "=", "&", is not supported yet? Example:

    package main
    
    import (
    	"strings"
    	"fmt"
    	"github.com/alwindoss/morse"
    )
    
    
    func main()  {
    	h:=morse.NewHacker()
    	encode,_:=h.Encode(strings.NewReader(":=:&=:"))
    	decode,_:=h.Decode(strings.NewReader(string(encode)))
    	fmt.Println(string(decode))
    }
    

    Output empty string.

    enhancement 
    opened by Declarcall 2
  • Change github statistic

    Change github statistic

    Is your feature request related to a problem? Please describe. Github statistic use all files(sources, scripts,...) for show statistic. But some projects avoid files of scripts, testdata, CI files in Github statistic.

    Describe the solution you'd like Add file : .gitattributes Example of use: https://github.com/Konstantin8105/c4go/blob/master/.gitattributes

    Describe alternatives you've considered Ignored

    Additional context See Article https://hackernoon.com/how-to-change-repo-language-in-github-c3e07819c5bb

    opened by Konstantin8105 2
  • Morse alfabet not valid by stardard

    Morse alfabet not valid by stardard

    Describe the bug Morse alfabet not valid by stardard

    To Reproduce see Go tests:

    expected := "-- -.-- / -. .- -- . / .. ... / .- .-.. .-- .. -. / -.. --- ... ..."
    

    Expected behavior

    expected := "-- -.--  -. .- -- . .. ... .- .-.. .-- .. -. -.. --- ... ..."
    

    Screenshots No.

    Environment (please complete the following information with go env output): No need

    Additional context for more information see Recommendation ITU-R M.1677-1 http://www.itu.int/dms_pubrec/itu-r/rec/m/R-REC-M.1677-1-200910-I!!PDF-E.pdf

    opened by Konstantin8105 2
  • Removing the Println statement in the Encode method

    Removing the Println statement in the Encode method

    So that when we run: go run docs/example.go instead of getting:

    -.-. --- -. ...- . .-. - / - .... .. ... / - --- / -- --- .-. ... .
    Morse Code is: -.-. --- -. ...- . .-. - / - .... .. ... / - --- / -- --- .-. ... .
    

    we get:

    Morse Code is: -.-. --- -. ...- . .-. - / - .... .. ... / - --- / -- --- .-. ... .
    

    as expected.

    opened by javjar 1
  • Misspell

    Misspell

    Describe the bug change word from "Covert" to "Convert"

    To Reproduce See Readme.md file

    Expected behavior "Convert" Prepared #11

    Screenshots No need

    Environment (please complete the following information with go env output): No need

    Additional context Add misspell checking in CI.

    opened by Konstantin8105 0
  • Using bytes.Buffer

    Using bytes.Buffer

    Is your feature request related to a problem? Please describe. Now, source code have many convertion []byte to string, string to []byte

    Describe the solution you'd like Using bytes.Buffer

    Describe alternatives you've considered ??

    Additional context Prepared PR #7

    opened by Konstantin8105 0
  • Test for not valid letter

    Test for not valid letter

    Is your feature request related to a problem? Please describe. Now, we haven't test for not valid letter. For example, China hieroglyph or Sweden letter.

    Describe the solution you'd like Add test in file morse_test.go

    Describe alternatives you've considered ??

    Additional context Prepared PR #7

    bug help wanted test-fix 
    opened by Konstantin8105 1
Releases(v1.0.1)
Owner
Alwin Doss
Alwin Doss
🎄 My code for the Advent of Code of year 2021 in Go.

Advent of Code 2021 This repository contains all code that I wrote for the Advent of Code 2021. This year I chose to try and learn Go. Enjoy! Built wi

Nick van Ravenzwaaij 0 Dec 9, 2021
Automatically generate Go test boilerplate from your source code.

gotests gotests makes writing Go tests easy. It's a Golang commandline tool that generates table driven tests based on its target source files' functi

Charles Weill 4.4k Jan 3, 2023
XSD (XML Schema Definition) parser and Go/C/Java/Rust/TypeScript code generator

xgen Introduction xgen is a library written in pure Go providing a set of functions that allow you to parse XSD (XML schema definition) files. This li

null 211 Jan 1, 2023
Get user-like access to VirtualBox VMs from Go code.

#Vboxgo Get user-like access to VirtualBox VMs from Go code. This library wraps some define-tainted VirtualBox SDK functions, making it possible to ge

Vladislav Supalov 27 Oct 25, 2021
WeCTF 2020+ Source Code & Organizer's Writeup

WeCTF 2020+ Thank you all for participating! This README contains our writeup sketches. You can also share your writeup on CTFtime. Event Link: https:

WeCTF Organizers 22 Jul 6, 2022
Visualize how a projects source code is distributed among its files and folders

Source Code Visualizer Visualize the code distribution in a project. Applications Applications include: Visualizing code distribution for more educate

Guy Levin 81 Jul 31, 2022
Jennifer is a code generator for Go

Jennifer Jennifer is a code generator for Go. package main import ( "fmt" . "github.com/dave/jennifer/jen" ) func main() { f := NewFile("m

Dave Brophy 2.7k Dec 25, 2022
Universal code search (self-hosted)

Sourcegraph OSS edition is a fast, open-source, fully-featured code search and navigation engine. Enterprise editions are available. Features Fast glo

Sourcegraph 7.2k Jan 9, 2023
Yet another Go REPL that works nicely. Featured with line editing, code completion, and more.

gore Yet another Go REPL that works nicely. Featured with line editing, code completion, and more. (Screencast taken with cho45/KeyCast) Usage gore Af

Hironao OTSUBO 4.7k Jan 7, 2023
Nodebook - Multi-Lang Web REPL + CLI Code runner

nodebook Nodebook - Multi-Language REPL with Web UI + CLI code runner Useful to practice algorithms and datastructures for coding interviews. What is

Jérôme Schneider 1.6k Dec 29, 2022
Experimental code execution microservice based on Docker containers.

ranna ランナー - Experimental code runner microservice based on Docker containers. ⚠ PLEASE READ BEFORE USE First of all, this project is currently work i

ranna 31 Dec 9, 2022
README snippets for Visual Code inspired by readme.so

vscode-readme This was inspired by @katherinepeterson who made the wonderful readme.so! Huge thanks. Configuration Make sure you have quickSuggestions

ThreeComma.io 15 Feb 7, 2022
Assembly syntax that makes you feel like you're writing code in a high-level language.

shasm Assembly syntax that makes you feel like you're writing code in a high-level language. Shasm is not an Assembler. Shasm simply compiles Shasm sy

Shoyaaa 14 Jun 5, 2021
Auto-evaluate your Golang code.

Ginker Ginker is a GUI application for auto-evaluating your Golang code. It allows you to write and run Golang code on the fly and it will help you to

nkoporec 8 Jun 24, 2021
Golang Code Challenge for PARSPOOYESH

golang-code-challenge Dependencies You must have go and Docker installed on your machine also you need to go get this Dependencies: name repo gorilla/

Armin Goodarzi 3 Mar 18, 2022
General Golang Code Generator

gg gg is a General Golang Code Generator: A Good Game to play with Golang. package main import ( "fmt" . "github.com/Xuanwo/gg" ) func main() {

Xuanwo 83 Jan 7, 2023
Windows Store Installer for VS Code

vscode-winsta11er This repo contains the code for a simple Go-based installer for the new Windows store. Releases To create a release, create and push

Microsoft 12 Dec 9, 2022
Default godoc generator - make your first steps towards better code documentation

godoc-generate Overview godoc-generate is a simple command line tool that generates default godoc comments on all exported types, functions, consts an

Dimitar Petrov 19 Sep 14, 2022
Code for the Go pipeline blog post

Concurrent and Parallel Pipelines in Go This repository contains the code that goes along with a blog post about concurrent and parallel pipelines in

AMBOSS 9 Nov 11, 2022