katana.units.raw.morsecode — Interpret Morsecode

Unit to decode Morsecode

This unit will attempt to read data from Morsecode, both in the International sound mapping as well as the text representation with dots and dashes.

class katana.units.raw.morsecode.Unit(manager: katana.manager.Manager, target: katana.target.Target)

Bases: katana.unit.RegexUnit

GROUPS = ['raw', 'decode', 'morsecode']

These are “tags” for a unit. Considering it is a Raw unit, “raw” is included, as well as the tag “decode”, and the unit name “morsecode”.

PATTERN = regex.Regex(b'((((dit|dah|di)-?)+)|([.\\-]+))( ((((dit|dah|di)-?)+)|([.\\-]+))){3,}', flags=regex.A | regex.S | regex.M | regex.V0)
PRIORITY = 30

Priority works with 0 being the highest priority, and 100 being the lowest priority. 50 is the default priorty. This unit has a moderate priority

evaluate(match)

Evaluate the target. Translate any morsecode in the target and to its English representation and recurse on any newfound information.

Parameters:match – A match returned by the RegexUnit.
Returns:None. This function should not return any data.