morse_code_translator

Types

pub type ConvertOptions {
    ConvertOptions(
        input_dot: String,
        output_dot: String,
        input_dash: String,
        output_dash: String,
        input_space: String,
        output_space: String,
        input_separator: String,
        output_separator: String,
    )
}

Constructors

  • ConvertOptions(
        input_dot: String,
        output_dot: String,
        input_dash: String,
        output_dash: String,
        input_space: String,
        output_space: String,
        input_separator: String,
        output_separator: String,
    )
pub type DecodeOptions {
    DecodeOptions(
        input_dot: String,
        input_dash: String,
        input_space: String,
        input_separator: String,
        to_uppercase: Bool,
        language_num: String,
    )
}

Constructors

  • DecodeOptions(
        input_dot: String,
        input_dash: String,
        input_space: String,
        input_separator: String,
        to_uppercase: Bool,
        language_num: String,
    )
pub type EncodeOptions {
    EncodeOptions(
        output_dot: String,
        output_dash: String,
        output_space: String,
        output_separator: String,
        is_uppercase: Bool,
        language_num: String,
    )
}

Constructors

  • EncodeOptions(
        output_dot: String,
        output_dash: String,
        output_space: String,
        output_separator: String,
        is_uppercase: Bool,
        language_num: String,
    )
pub type MorseCodeError {
    MorseCodeError(msg: String)
}

Constructors

  • MorseCodeError(msg: String)
pub type MorseCodeList =
    List(#(String, String, List(Bool)))

Constants

pub const default_dash: String = "-"
pub const default_dot: String = "."
pub const default_is_uppercase: Bool = False
pub const default_language_num: String = language_num_latin
pub const default_separator: String = " "
pub const default_space: String = "/"
pub const default_to_uppercase: Bool = False
pub const language_num_arabic: String = "8"
pub const language_num_cyrillic: String = "5"
pub const language_num_greek: String = "6"
pub const language_num_hebrew: String = "7"
pub const language_num_japanese: String = "10"
pub const language_num_korean: String = "11"
pub const language_num_latin: String = "1"
pub const language_num_latin_extended: String = "4"
pub const language_num_numbers: String = "2"
pub const language_num_persian: String = "9"
pub const language_num_punctuation: String = "3"
pub const language_num_thai: String = "12"
pub const morse_code_list: List(#(String, String, List(Bool))) = characters.base_characters

Functions

pub fn convert(
    input: String,
    options: ConvertOptions,
) -> Result(String, MorseCodeError)
pub fn convert_to_string(
    input: String,
    options: ConvertOptions,
) -> String
pub fn decode(
    input: String,
    morse_code_list: List(#(String, String, List(Bool))),
    options: DecodeOptions,
) -> Result(String, MorseCodeError)
pub fn decode_to_string(
    input: String,
    morse_code_list: List(#(String, String, List(Bool))),
    options: DecodeOptions,
) -> String
pub fn encode(
    input: String,
    morse_code_list: List(#(String, String, List(Bool))),
    options: EncodeOptions,
) -> Result(String, MorseCodeError)
pub fn encode_to_string(
    input: String,
    morse_code_list: List(#(String, String, List(Bool))),
    options: EncodeOptions,
) -> String
Search Document