Asper Header  1.0.14
The header injector extension
Loading...
Searching...
No Matches
morseCode.ts File Reference

Comprehensive Morse code translation system with International Morse Code compliance. More...

Go to the source code of this file.

Data Structures

class  MorseTranslator
 Static utility class for Morse code translation operations. More...
 

Variables

 import { logger, LogType } from "./logger"
 

Detailed Description

Comprehensive Morse code translation system with International Morse Code compliance.

Author
Henry Letellier
Since
1.0.0
Version
1.0.10
Date
2025

This module implements a complete Morse code translation system that provides bidirectional conversion between plain text and International Morse Code. It serves both practical communication needs and educational purposes within the AsperHeader extension ecosystem, while maintaining strict adherence to ITU-R M.1677-1 International Morse Code standards.

Translation Engine Architecture:

  • Bidirectional Translation: Seamless text-to-morse and morse-to-text conversion
  • Character Mapping: Complete International Morse Code character set implementation
  • Format Standards: ITU-R M.1677-1 compliant spacing and timing conventions
  • Input Validation: Comprehensive input sanitization and error handling
  • Performance Optimization: Efficient lookup tables for real-time translation
  • Logging Integration: Comprehensive operation tracking via logger

Supported Character Sets:

  • Latin Alphabet: Full A-Z character support (case-insensitive)
  • Numerals: Complete 0-9 digit support with standard timings
  • Punctuation: Period, comma, question mark, apostrophe, exclamation, slash
  • Mathematical: Plus, minus, equals signs with proper encoding
  • Special Characters: Parentheses, quotation marks, colon, semicolon
  • Extended Set: Additional symbols for modern communication needs

Spacing and Timing Conventions:

  • Inter-Element: Dot duration between dits and dahs within characters
  • Inter-Character: Three dot durations between characters (represented by single space)
  • Inter-Word: Seven dot durations between words (represented by forward slash /)
  • Inter-Line: Custom convention using double forward slash (//) for line breaks
  • Timing Standards: Full compliance with ITU-R timing recommendations

Translation Features:

  • Case Insensitive: Accepts both uppercase and lowercase input
  • Whitespace Handling: Intelligent processing of spaces, tabs, and line breaks
  • Error Recovery: Graceful handling of unsupported characters with logging
  • Batch Processing: Efficient processing of large text blocks
  • Format Preservation: Maintains original text structure in translation output

Educational Value:

  • Standards Compliance: Authentic International Morse Code implementation
  • Learning Support: Clear character mapping for Morse code education
  • Reference Implementation: Serves as reference for Morse code applications
  • Historical Accuracy: Preserves traditional telegraphic conventions

Integration Points:

  • Telegraph Headers: Morse code elements in file header generation
  • Communication Simulation: Telegraph-style protocol implementation
  • Easter Eggs: Hidden Morse code features for user discovery
  • Testing Framework: Comprehensive test coverage for all character mappings
  • Debugging: Morse code representation in diagnostic output

Performance Characteristics:

  • O(1) Lookup: Constant-time character translation via hash tables
  • Memory Efficient: Minimal memory footprint with static character maps
  • Thread Safe: Stateless design ensures thread safety
  • Scalable: Handles arbitrary input lengths without performance degradation

Definition in file morseCode.ts.

Variable Documentation

◆ import

import { logger, LogType } from "./logger"

Definition at line 88 of file morseCode.ts.