FromBraille needs some work

This commit is contained in:
n1073645 2019-12-05 11:09:40 +00:00
parent 50d16ca3d2
commit 6adc5dda93
2 changed files with 4 additions and 11 deletions

View file

@ -245,7 +245,7 @@ class Magic {
} }
/** /**
* Uses the checks to validate the input//output of potential operations. * Uses the checks to validate the input/output of potential operations.
* *
* @param {string} flag * @param {string} flag
* @param {array} sensible * @param {array} sensible
@ -331,10 +331,10 @@ class Magic {
*/ */
async speculativeExecution(depth=0, extLang=false, intensive=false, recipeConfig=[], useful=false, crib=null) { async speculativeExecution(depth=0, extLang=false, intensive=false, recipeConfig=[], useful=false, crib=null) {
if (depth < 0) return []; if (depth < 0) return [];
console.log("still alive");
// Find any operations that can be run on this data // Find any operations that can be run on this data
const matchingOps = this.opPatterns.findMatchingInputRegexes(this.inputStr); const matchingOps = this.opPatterns.findMatchingInputRegexes(this.inputStr);
console.log(matchingOps);
let results = []; let results = [];
// Record the properties of the current data // Record the properties of the current data

View file

@ -26,14 +26,6 @@ class FromBraille extends Operation {
this.inputType = "string"; this.inputType = "string";
this.outputType = "string"; this.outputType = "string";
this.args = []; this.args = [];
this.checks = new magicObject([
{
match: "^\\s*[⠀⠁⠂⠃⠄⠅⠆⠇⠈⠉⠊⠋⠌⠍⠎⠏⠐⠑⠒⠓⠔⠕⠖⠗⠘⠙⠚⠛⠜⠝⠞⠟⠠⠡⠢⠣⠤⠥⠦⠧⠨⠩⠪⠫⠬⠭⠮⠯⠰⠱⠲⠳⠴⠵⠶⠷⠸⠹⠺⠻⠼⠽⠾⠿]+\\s*$",
flags: "i",
magic: true,
args: [true]
}
]);
} }
/** /**
@ -42,6 +34,7 @@ class FromBraille extends Operation {
* @returns {string} * @returns {string}
*/ */
run(input, args) { run(input, args) {
console.log("this is broke");
return input.split("").map(b => { return input.split("").map(b => {
const idx = BRAILLE_LOOKUP.dot6.indexOf(b); const idx = BRAILLE_LOOKUP.dot6.indexOf(b);
return idx < 0 ? b : BRAILLE_LOOKUP.ascii[idx]; return idx < 0 ? b : BRAILLE_LOOKUP.ascii[idx];