make_encode: Make an encode function.

View source: R/morse.R

make_encodeR Documentation

Make an encode function.

Description

Make an encode function.

Usage

make_encode(table, pre = identity)

Arguments

table

Hash table for looking up code words.

pre

A function to pre-process the input.

Value

A function that takes a string and return the encoded string.

Examples

table <- morse:::make_code_table(list(c("a", "1"), c("b", "2")))
encode <- make_encode(table)
encode("ab")

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