public static function createFromRDF(EasyRdf_Resource $annoResource)
 {
     $textAnno = new TextAnnotation($annoResource->getUri(), $annoResource->getLiteral("stanbol:start")->getValue(), $annoResource->getLiteral("stanbol:end")->getValue(), $annoResource->getLiteral("stanbol:confidence")->getValue());
     $textAnno->setSelectedText($annoResource->getLiteral("stanbol:selected-text")->getValue());
     return $textAnno;
 }
Exemple #2
0
 /**
  * Create text annotations
  * @param array $resources A collection of TextAnnotation RDF triples
  * @return array
  */
 private function _createTextAnnotations(array $resources)
 {
     $textAnnotations = array();
     foreach ($resources as $res) {
         array_push($textAnnotations, TextAnnotation::createFromRDF($res));
     }
     return $textAnnotations;
 }