diff --git a/src/main/resources/public/js/fuzzyRule.js b/src/main/resources/public/js/fuzzyRule.js index f075a52..1f07ffb 100644 --- a/src/main/resources/public/js/fuzzyRule.js +++ b/src/main/resources/public/js/fuzzyRule.js @@ -1,3 +1,24 @@ + +// Rules parsing +function getAntecedent(rule) { + withoutIf = rule.split('if'); + return withoutIf[1].trim().split('then')[0].trim(); +} + +function getAntecedentComponents(antecedent) { + return antecedent.split('and').map((i) => i.trim()); +} + +function getVariable(antecedent) { + return antecedent.split('is')[0].trim(); +} + +function getVariableValue(antecedent) { + return antecedent.split('is')[1].trim(); +} + +// Rules creation + /* exported MessageTypesEnum */ var MessageTypesEnum = { INFO: "info", diff --git a/src/main/resources/templates/project/edit.html b/src/main/resources/templates/project/edit.html index 61e8c8b..c683dbb 100644 --- a/src/main/resources/templates/project/edit.html +++ b/src/main/resources/templates/project/edit.html @@ -57,24 +57,8 @@ class="btn btn-outline-dark">Добавить правило +