make_decode: Make a decode function.

View source: R/morse.R

make_decodeR Documentation

Make a decode function.

Description

Make a decode function.

Usage

make_decode(table, pre = identity)

Arguments

table

Hash table for looking up characters for code words.

pre

A function to pre-process the input.

Value

A function that takes an encoded string and return the original string.

Examples

table <- morse:::make_code_table(list(c("a", "1"), c("b", "2")), from = 2, to = 1)
decode <- make_decode(table)
decode("1/2", sep = "/")

kunhtkun/morse documentation built on March 17, 2022, 5:17 p.m.