Exemplo n.º 1
0
 public function testParse()
 {
     $ARQNode = $this->ERXPath->evaluate('//ARQuery')->item(0);
     $ARQR = new TaskSettingRule($ARQNode, $this->ER, $this->attributes, $this->IMs, $this->DBAP, $this->BBAP);
     $ARQR->parse();
     $data = $ARQR->toArray();
     $this->assertEquals(1, count($data['antecedent']));
     $this->assertEquals(2, count($data['IM']));
     $this->assertEquals(1, count($data['consequent']));
 }
Exemplo n.º 2
0
 function parseRules()
 {
     $rules = array();
     $CP = new ConnectiveParser($this->ER, $this->XPath);
     $BBAP = new BBAParser($this->ER, $this->XPath);
     $BBAP->parseBBAs();
     $DBAP = new DBAParser($this->ER, $this->XPath, $CP);
     $DBAP->parseDBAs();
     $TSR = new TaskSettingRule($this->XPath->evaluate('//TaskSetting')->item(0), $this->ER, $this->attributes, $this->interestMeasures, $DBAP, $BBAP);
     try {
         $TSR->parse($DBAP, $BBAP);
         array_push($rules, $TSR);
     } catch (InvalidRuleException $e) {
     }
     return $rules;
 }
Exemplo n.º 3
0
 /**
  * It solves the rules if the data format is TaskSettings
  *
  * @param <String> $whichOne It is name of Element I get from the XML and then
  * proces further.
  */
 private function solveTaskSetting($whichOne)
 {
     $rule = $this->domER->getElementsByTagName($whichOne)->item(0);
     $ruleAR = new TaskSettingRule($rule, $this->domER);
     $this->jsonObject["rule0"] = $ruleAR->toJSON();
     $this->jsonObject["rules"] = 1;
 }