mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-04 00:32:51 -06:00
minibar: better implementation of word replacement
Instead of trying to reconstruct the abstract tree from the bracketed string, use the node numbers (the field called "fid") to identify which node in the abstact syntax tree a word in the bracketed string corresponds to.
This commit is contained in:
@@ -178,6 +178,7 @@ Translations.prototype.parsetree_button=function(abs,lang) {
|
||||
function draw_brackets(b) {
|
||||
return b.token
|
||||
? span_class("token",text(b.token))
|
||||
: node("span",{"class":"brackets",title:(b.fun||"_")+":"+b.cat},
|
||||
: node("span",{"class":"brackets",
|
||||
title:(b.fun||"_")+":"+b.cat+" "+b.fid+":"+b.index},
|
||||
b.children.map(draw_brackets))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user