w2v-server: handle out of dictionary words in a more robust way
diff --git a/templates/index.html.ep b/templates/index.html.ep
index d42a282..6269e02 100644
--- a/templates/index.html.ep
+++ b/templates/index.html.ep
@@ -329,7 +329,7 @@
<span> </span><input type="button" value="→ KorAP" onclick="queryKorAP();" title="query word with KorAP"/>
</form>
<br>
- % if($lists) {
+ % if($lists && (@$lists) > 0 && (@$lists)[0]) {
<div id="wrapper">
<table id="first">
<tr>
@@ -408,6 +408,12 @@
showMap(<%= b(Mojo::JSON::to_json({target => " $word ", mergedEnd=> $mergedEnd, words => \@words, vecs => \@vecs, ranks => \@ranks, marked => \@marked, urlprefix => $urlprefix})); %>);
});
</script>
+ % } else { # ($word && $word !~ /^\s*$/)
+ <div id="wrapper">
+ <p>
+ ERROR: "<%= $word %>" not found in vocabluary.
+ </p>
+ </div>
% }
<div id="second" style="width:800px; height:800px; font-family: arial;">
<div id="embed">