コード例 #1
0
<?php

include_once 'semsol/ARC2.php';
/* ARC2 static class inclusion */
include_once 'question/QuestionList.php';
$QuestionList = new QuestionList();
$questions = $QuestionList->load();
$question = $_GET['question'];
foreach ($questions as $existingQuestion) {
    if (trim($existingQuestion["fulltext"]) == trim($question)) {
        $entities = $existingQuestion["entities"];
        break;
    }
}
$property = "";
$location = "";
$organization = "";
foreach ($entities as $entity) {
    if ($entity["type"] == "PROPERTY") {
        $property = $entity["property"];
    } else {
        if ($entity["type"] == "LOCATION" && strlen($location) == 0) {
            $location = $entity["name"];
        } else {
            if (strlen($organization) == 0) {
                $organization = $entity["name"];
            } else {
                if (strlen($location) == 0) {
                    $location = $entity["name"];
                }
            }