Commit aaebc804 authored by Martin Gregor's avatar Martin Gregor
Browse files

oprava ak vypadne lematizacna sluzba, tak nech to funguje bez nej

parent 3f6e43bf
......@@ -15,6 +15,7 @@ class HomepagePresenter extends BasePresenter
private $words = [];
private $words_lema = [];
private $en_words = [];
private $lematization_service = 'http://text.fiit.stuba.sk:8080/lematizer/services/lemmatizer/lemmatize/fast';
public function renderDefault()
{
......@@ -48,6 +49,10 @@ class HomepagePresenter extends BasePresenter
// lematizacia skolskou sluzbou
$this->lematize($sentence->sentence);
if (empty($this->words_lema))
{
$this->words_lema = $this->words;
}
// preklad kazdeho slova z vety
foreach ($this->words_lema as $word)
......@@ -305,7 +310,7 @@ class HomepagePresenter extends BasePresenter
'Content-Type' => 'text/plain'
];
$result = $curl->post('http://text.fiit.stuba.sk:8080/lematizer/services/lemmatizer/lemmatize/fast',$sentence);
$result = $curl->post($this->lematization_service,$sentence);
$this->words_lema = explode(' ',$result->body);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment