implementazione query, progress

This commit is contained in:
cesare 2025-02-20 16:03:32 +01:00
parent 52b7d50416
commit 114720b7e8
1 changed files with 12 additions and 3 deletions

View File

@ -677,6 +677,8 @@ function getFiltroContestoJson(datiContesto) {
return []
}
//CLAUSE BUILDER
function buildStatementClause(clause, parsedquery, whereind, theplace, token, op) {
//
var tmpgroup = ''
@ -756,7 +758,12 @@ function buildStatementClause(clause, parsedquery, whereind, theplace, token, op
tmpg = tmpg.replaceAll('"pos"', '"pos' + token + '"')
tmpg = tmpg.replaceAll('"lm"', '"lm' + token + '"')
tmpg = tmpg.replaceAll('"reg"', '"reg' + token + '"')
tmpg = tmpg.replaceAll('"clg"', '"clg' + token + '"')
if (op=='OR')
tmpg = tmpg.replaceAll('"clg"', '"clg' + token + '"')
else
tmpg = tmpg.replaceAll('"clg"', '"cl"')
tmpg = tmpg.replaceAll('"cloccte"', '"cloccte' + token + '"')
var tmppos = `{
"type": "operation",
@ -823,13 +830,14 @@ function buildStatementClause(clause, parsedquery, whereind, theplace, token, op
}
var functS = clause['functionSyntax'];
var typeS = clause['typeSyntax0']
console.log(functS + ' ' + typeS)
var myf = ''
if (functS != null && functS != ".+" && functS != "all") {
myf = buildsyntClause(funzione_clausola[functS])
if (myf != '')
tmpgroup.patterns.at(-1).triples.push(myf)
}
if (typeS != null && typeS != ".+" && typeS != "all") {
var alltipi = Object.assign(macrotipi_sint, tipi_sint);
let mymt = alltipi[typeS]
@ -854,7 +862,8 @@ function buildStatementClause(clause, parsedquery, whereind, theplace, token, op
}
if (theguiQ['unitaRicerca'] == 'periodo' || theguiQ['unitaRicerca'] == 'frase' || theguiQ['unitaRicerca'] == 'verso') {
mytest = JSON.stringify(tmpgroup)
mytest = mytest.replaceAll(':"cl"', ':"cl' + token + '"')
if (op=='OR')
mytest = tmpg.replaceAll(':"cl"', ':"cl' + token + '"')
mytest = mytest.replaceAll(':"clatype"', ':"clatype' + token + '"')
mytest = mytest.replaceAll(':"clafunction"', ':"clafunction' + token + '"')
mytest = mytest.replaceAll(':"cloccu"', ':"cloccu' + token + '"')