From 07f19c99cdfb9135e514d97c0b05671500c50e31 Mon Sep 17 00:00:00 2001 From: cesare Date: Fri, 5 Jan 2024 12:22:12 +0100 Subject: [PATCH] corretto bug per query sint & morf --- js/syntgraph.js | 6 ++++-- js/utils.js | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/js/syntgraph.js b/js/syntgraph.js index 626332a..f6dc018 100644 --- a/js/syntgraph.js +++ b/js/syntgraph.js @@ -26,17 +26,19 @@ document.addEventListener("dblclick", function(e){ let showngr=document.getElementById("periodograph").getAttribute('name').split("_") var tmpsent=showngr[0]+"_"+showngr[1]+"_s_"+showngr[2] periodograph.parentNode.removeChild(periodograph); + //var sentence = document.getElementsByClassName(lsentid); var sentence = document.getElementsByClassName(tmpsent); + for (let i = 0; i < sentence.length; i++) { + var matches = listaClausoleRisultato.filter(s => s.includes(sentence[i].classList[0])); sentence[i].classList.remove('font-italic'); - if (selectedVista!='frasi' && !listaPeriodiRisultato.includes(tmpsent)) + if (selectedVista!='frasi' && !listaPeriodiRisultato.includes(tmpsent) && !matches.length) sentence[i].style.removeProperty('color'); sentence[i].classList.remove('font-weight-normal'); } - var matches = listaClausoleRisultato.filter(s => s.includes(sentence[i].classList[0])); //console.log('matches for clausole '+matches) diff --git a/js/utils.js b/js/utils.js index db4b15e..9b10e22 100644 --- a/js/utils.js +++ b/js/utils.js @@ -574,7 +574,9 @@ function buildStatementClause(clause, parsedquery, whereind, theplace) { tmpgroup.patterns.at(-1).triples.push(myf) } if (typeS != null && typeS != ".+") { - let mymt=macrotipi_sint[typeS] + var alltipi = Object.assign(macrotipi_sint, tipi_sint); + let mymt=alltipi[typeS] + //let mymt=macrotipi_sint[typeS] if(listaMacroTipiConSubTipo.includes(mymt.split(':')[1])){ let myfa=buildMacroSyntType(mymt) for (fa in myfa){ @@ -583,7 +585,7 @@ function buildStatementClause(clause, parsedquery, whereind, theplace) { } } else{ - var tmptr=macrotipi_sint[typeS].split(';') + var tmptr=alltipi[typeS].split(';') for (indttr in tmptr){ myf = buildsyntClause(tmptr[indttr]) if (myf != '')