/
bear
/
opencorpora
Обзор
Документация
Войти
/
bear
/
opencorpora
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
ajax/get_context.php
16 строк
401 B
Dmitry Granovsky
use wrappers instead of direct reads from and (merge from branch:ensure)
27 дек 2016, 18:50
27 дек 2016, 18:50
b1f4cd2
Код
Авторство
О чём код?
<?php require_once('../lib/header_ajax.php'); require_once('../lib/lib_annot.php'); $result['context'] = array(); $tf_id = (int)POST('tf_id'); $dir = (int)POST('dir', 0); if ($tf_id && $dir) { $wds = get_context_for_word($tf_id, -1, $dir, 0); foreach ($wds['context'] as $word) { $result['context'][] = htmlspecialchars($word); } } log_timing(true); die(json_encode($result)); ?>