Beispiel #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']));
 }
 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;
 }