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: option.Option(String),
    input_dash: option.Option(String),
    input_space: option.Option(String),
    input_separator: option.Option(String),
    to_uppercase: option.Option(Bool),
    language: option.Option(Language),
  )
}

Constructors

  • DecodeOptions(
      input_dot: option.Option(String),
      input_dash: option.Option(String),
      input_space: option.Option(String),
      input_separator: option.Option(String),
      to_uppercase: option.Option(Bool),
      language: option.Option(Language),
    )
pub type EncodeOptions {
  EncodeOptions(
    output_dot: option.Option(String),
    output_dash: option.Option(String),
    output_space: option.Option(String),
    output_separator: option.Option(String),
    is_uppercase: option.Option(Bool),
    language: option.Option(Language),
  )
}

Constructors

  • EncodeOptions(
      output_dot: option.Option(String),
      output_dash: option.Option(String),
      output_space: option.Option(String),
      output_separator: option.Option(String),
      is_uppercase: option.Option(Bool),
      language: option.Option(Language),
    )
pub type Language {
  Language(num: String)
}

Constructors

  • 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

Input will be converted to uppercase

pub const default_language: Language

Default language is ASCII

pub const default_separator: String
pub const default_space: String
pub const default_to_uppercase: Bool

Output will be converted to lowercase

pub const language_arabic: Language

Arabic

pub const language_cyrillic: Language

Cyrillic languages

pub const language_greek: Language

Greek

pub const language_hebrew: Language

Hebrew

pub const language_japanese: Language

Japanese

pub const language_korean: Language

Korean

pub const language_latin: Language

ASCII

pub const language_latin_extended: Language

Latin Extended (Turkish, Polish etc.)

pub const language_numbers: Language

Numbers

pub const language_persian: Language

Persian

pub const language_punctuation: Language

Punctuation

pub const language_thai: Language

Thai

pub const morse_code_list: List(#(String, String, List(Bool)))

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,
  options: DecodeOptions,
  morse_code_dict: Option(List(#(String, String, List(Bool)))),
) -> Result(String, MorseCodeError)
pub fn decode_to_string(
  input: String,
  options: DecodeOptions,
  morse_code_dict: Option(List(#(String, String, List(Bool)))),
) -> String
pub fn encode(
  input: String,
  options: EncodeOptions,
  morse_code_dict: Option(List(#(String, String, List(Bool)))),
) -> Result(String, MorseCodeError)
pub fn encode_to_string(
  input: String,
  options: EncodeOptions,
  morse_code_dict: Option(List(#(String, String, List(Bool)))),
) -> String
Search Document