From 4cfeb07af8b5a599f904a80ef8491b0398c70ba5 Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Fri, 7 Aug 2026 16:04:24 +0200 Subject: [PATCH] fix the display of an inflection table and add a gloss --- src/compiler/www/js/wc.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/compiler/www/js/wc.js b/src/compiler/www/js/wc.js index a30f68edd..a35a54e74 100644 --- a/src/compiler/www/js/wc.js +++ b/src/compiler/www/js/wc.js @@ -121,13 +121,19 @@ wc.translate=function(redo) { function show_inflections(lins) { if(wc.e2) wc.e2.innerHTML=lins[0].text } - function get_inflections() { - var tree="MkDocument+%22%22+(Inflection"+wcls+"+"+w+")+%22%22" + function get_inflections(glosses) { + if (glosses.length == 0) { + glosses = [""] + } + var tree="MkDocument+(NoDefinition+%22"+glosses[0]+"%22)+(Inflection"+wcls+"+"+w+")+%22%22" var l=gftranslate.grammar+f.to.value - gftranslate.call("?command=c-linearize&to="+l+"&tree="+tree,show_inflections) + gftranslate.call("?command=linearize&to="+l+"&tree="+tree,show_inflections) } + function get_gloss() { + ajax_http_post_querystring_json("https://cloud.grammaticalframework.org/wordnet/SenseService.fcgi","gloss_id="+w,get_inflections); + } var wn=wrap_class("span","inflect",text(w)) - if(wc.e2) wn.onclick=get_inflections + if(wc.e2) wn.onclick=get_gloss return wn } function word(w) {