#4 -- Add some functions for consequent
All checks were successful
CI fuzzy controller / container-test-job (push) Successful in 59s
All checks were successful
CI fuzzy controller / container-test-job (push) Successful in 59s
This commit is contained in:
parent
e91642e1d0
commit
ae309290ff
@ -1,20 +1,35 @@
|
||||
|
||||
// Rules parsing
|
||||
// antecedent
|
||||
function getAntecedent(rule) {
|
||||
withoutIf = rule.split('if');
|
||||
var withoutIf = rule.split('if');
|
||||
return withoutIf[1].trim().split('then')[0].trim();
|
||||
}
|
||||
|
||||
|
||||
// TODO: remove duplicate
|
||||
function getAntecedentComponents(antecedent) {
|
||||
return antecedent.split('and').map((i) => i.trim());
|
||||
}
|
||||
|
||||
function getVariable(antecedent) {
|
||||
return antecedent.split('is')[0].trim();
|
||||
// consequent
|
||||
function getConsequent(rule) {
|
||||
var withoutIf = rule.split('if');
|
||||
return withoutIf[1].trim().split('then')[1].trim();
|
||||
}
|
||||
|
||||
function getVariableValue(antecedent) {
|
||||
return antecedent.split('is')[1].trim();
|
||||
// TODO: remove duplicate
|
||||
function getConsequentComponents(consequent) {
|
||||
return consequent.split('and').map((i) => i.trim());
|
||||
}
|
||||
|
||||
// common
|
||||
function getVariable(variableComponents) {
|
||||
return variableComponents.split('is')[0].trim();
|
||||
}
|
||||
|
||||
function getVariableValue(variableComponents) {
|
||||
return variableComponents.split('is')[1].trim();
|
||||
}
|
||||
|
||||
// Rules creation
|
||||
|
Loading…
x
Reference in New Issue
Block a user