1
|
<?php
|
2
|
require "../model/DB.php";
|
3
|
require "../model/Tag.php";
|
4
|
require "../model/Word.php";
|
5
|
$DB = new DB();
|
6
|
|
7
|
// (B) SEARCH FOR USERS
|
8
|
$results = $DB->select(
|
9
|
"SELECT w.id, w.context, w.date, w.description, w.description2, w.description3, w.ending, w.finished,
|
10
|
w.namedentity, w.position1, w.position2, w.positiondetail, w.word, w.tag_id, w.lemma_id, t.tag, l.lemma, l.pos FROM dd_wordform as w left join dd_tag as t on w.tag_id = t.id left join dd_lemma as l on w.lemma_id = l.id order by w.id LIMIT 100"
|
11
|
);
|
12
|
|
13
|
var_dump($results);
|
14
|
|
15
|
$output = Array();
|
16
|
foreach ($results as $res) {
|
17
|
$tag = new Tag($res["tag_id"], $res["tag"]);
|
18
|
$lemma = new Lemma($res["lemma_id"], $res["lemma"], $res["pos"]);
|
19
|
$word = new Word($res["id"], $res["context"], $res["date"], $res["description"], $res["description2"], $res["description3"], $res["ending"],
|
20
|
$res["finished"], $res["namedentity"], $res["position1"], $res["position2"], $res["positiondetail"], $res["word"], $lemma, $tag);
|
21
|
array_push($output, $word);
|
22
|
}
|
23
|
|
24
|
$result = json_encode(count($output)==0 ? null : $output);
|
25
|
echo $result;
|