FromMorse operation extended to treat dashes & hyphens as long signals
This commit is contained in:
parent
991bb887ae
commit
1cc7835a8d
@ -163,8 +163,8 @@ var MorseCode = {
|
|||||||
var letterDelim = Utils.charRep[args[0]];
|
var letterDelim = Utils.charRep[args[0]];
|
||||||
var wordDelim = Utils.charRep[args[1]];
|
var wordDelim = Utils.charRep[args[1]];
|
||||||
|
|
||||||
input = input.replace(/-|_|dash/ig, "<dash>");
|
input = input.replace(/-|‐|−|_|–|—|dash/ig, "<dash>"); //hyphen-minus|hyphen|minus-sign|undersore|en-dash|em-dash
|
||||||
input = input.replace(/\.|dot/ig, "<dot>");
|
input = input.replace(/\.|·|dot/ig, "<dot>");
|
||||||
|
|
||||||
var words = input.split(wordDelim);
|
var words = input.split(wordDelim);
|
||||||
words = Array.prototype.map.call(words, function(word) {
|
words = Array.prototype.map.call(words, function(word) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user