Morse Code Library in Go

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.

  • 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

  • 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

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

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

  • 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

  • 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

🎄 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

Dec 9, 2021
Automatically generate Go test boilerplate from your source code.
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

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

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

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:

Jul 6, 2022
Visualize how a projects source code is distributed among its files and folders
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

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

Dec 25, 2022
Universal code search (self-hosted)
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

Jan 9, 2023
Yet another Go REPL that works nicely. Featured with line editing, code completion, and more.
  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

Jan 7, 2023
Nodebook - Multi-Lang Web REPL + CLI Code runner
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

Dec 29, 2022
Experimental code execution microservice based on Docker containers.
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

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

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

Jun 5, 2021
Auto-evaluate your Golang code.
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

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/

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() {

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

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

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

Nov 11, 2022