Package 'remorse'

Title: Translate Text to Morse to Sound
Description: Converts a string input to Morse Code and back. Plays the Morse Code as audible dits and dahs (dots and dashes).
Authors: Matt Dray [aut, cre]
Maintainer: Matt Dray <[email protected]>
License: MIT + file LICENSE
Version: 0.1.1
Built: 2025-01-14 05:38:05 UTC
Source: https://github.com/matt-dray/remorse

Help Index


Character to Morse Code Lookup

Description

A mapping of Morse Code signals to letters, digits and punctuation.

Usage

morse_lookup

Format

A named character vector of length 52.

Source

International Morse Code.


Play Morse Code as Sound

Description

Provide a Morse Code string and it will be played over your computer's speakers as dits (dots), dahs (dashes) and pauses.

Usage

morse2sfx(string, dit_length = 0.05, play = TRUE)

Arguments

string

Character. A Morse Code string. See details.

dit_length

Numeric. Length of a dit in seconds. The length of a dah will be three times the dit_length.

play

Logical. Should sounds be played? Defaults to TRUE. Included for testing purposes.

Details

Only certain characters can be converted to and from Morse Code. See the inbuilt morse_lookup dataset. The input will be composed of dits (or dots, '.'), dahs (or dashes, '-'), dividers around the dits and dahs that represent a single character ('/') and word dividers (' ', a space). Ideally it will have been produced using txt2morse.

Value

Nothing. Sounds will play if play = TRUE.

Examples

## Not run: txt2morse("hello there!") |> morse2sfx()

Convert Morse Code to a String

Description

Provide a string of Morse Code and it'll be converted to the corresponding text.

Usage

morse2txt(string)

Arguments

string

Character. A Morse Code string. See details.

Details

Only certain characters can be converted to and from Morse Code. See the inbuilt morse_lookup dataset. The input will be composed of dits (or dots, '.'), dahs (or dashes, '-'), dividers around the dits and dahs that represent a single character ('/') and word dividers (' ', a space). Ideally it will have been produced using txt2morse.

Value

A character string.

Examples

txt2morse("hello there!") |> morse2txt()

Convert a String to Morse Code

Description

Provide a string of text and it'll be converted to the corresponding string that represents that string in Morse Code.

Usage

txt2morse(string)

Arguments

string

Character. Some text. See details.

Details

Only certain characters can be converted to and from Morse Code. See the inbuilt morse_lookup dataset. The output will be composed of dits (or dots, '.'), dahs (or dashes, '-'), dividers around the dits and dahs that represent a single character ('/') and word dividers (' ', a space).

Value

A character string.

Examples

txt2morse("hello there!")