Browse Source

The Magic operation now only checks the most commonly used Internet languages by default, to lower false positives and improve performance.

n1474335 7 years ago
parent
commit
544d78f461
3 changed files with 62 additions and 7 deletions
  1. 2 1
      src/core/FlowControl.js
  2. 5 0
      src/core/config/OperationConfig.js
  3. 55 6
      src/core/lib/Magic.js

+ 2 - 1
src/core/FlowControl.js

@@ -267,10 +267,11 @@ const FlowControl = {
     runMagic: async function(state) {
         const ings = state.opList[state.progress].getIngValues(),
             depth = ings[0],
+            extLang = ings[1],
             dish = state.dish,
             currentRecipeConfig = state.opList.map(op => op.getConfig()),
             magic = new Magic(dish.get(Dish.ARRAY_BUFFER)),
-            options = await magic.speculativeExecution(depth);
+            options = await magic.speculativeExecution(depth, extLang);
 
         let output = `<table
                 class='table table-hover table-condensed table-bordered'

+ 5 - 0
src/core/config/OperationConfig.js

@@ -92,6 +92,11 @@ const OperationConfig = {
                 name: "Depth",
                 type: "number",
                 value: 3
+            },
+            {
+                name: "Extensive language support",
+                type: "boolean",
+                value: false
             }
         ]
     },

File diff suppressed because it is too large
+ 55 - 6
src/core/lib/Magic.js


Some files were not shown because too many files changed in this diff