bug fixing, query sulla posizione in progress
This commit is contained in:
parent
79b18d197a
commit
371ba234db
|
|
@ -1405,7 +1405,8 @@ $(document).ready(function() {
|
||||||
|
|
||||||
|
|
||||||
var details = [];
|
var details = [];
|
||||||
var lemma = categ.split('#')[1].replace("^", " ") //il lemma
|
//var lemma = categ.split('#')[1].replace("^", " ") //il lemma
|
||||||
|
var lemma = categ.split('#')[1].split("^") //il lemma
|
||||||
var categoria = categ.split('#')[0] // la categoria
|
var categoria = categ.split('#')[0] // la categoria
|
||||||
var details = getHoverContent(categoria);
|
var details = getHoverContent(categoria);
|
||||||
|
|
||||||
|
|
@ -1422,13 +1423,13 @@ $(document).ready(function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var ile=-1
|
||||||
for (var detail of details) {
|
for (var detail of details) {
|
||||||
|
ile+=1
|
||||||
myitems = detail.split(',');
|
myitems = detail.split(',');
|
||||||
|
|
||||||
catgramm = '<div class="ttContent">';
|
catgramm = '<div class="ttContent">';
|
||||||
subcatgramm = '<p> <b> ' + lemma + ' - </b><i>' + myitems[0] + ',' + myitems.slice(1) + '</i></p></div>';
|
subcatgramm = '<p> <b> ' + lemma[ile] + ' -</b><i> ' + myitems[0] + ',' + myitems.slice(1) + '</i></p></div>';
|
||||||
popoverText = popoverText + catgramm + subcatgramm;
|
popoverText = popoverText + catgramm + subcatgramm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2153,6 +2154,7 @@ $(document).ready(function() {
|
||||||
resultsInCanto.push(fraseItems[4] + fraseItems[5]);
|
resultsInCanto.push(fraseItems[4] + fraseItems[5]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
listaClausoleRisultato = Array.from(resSent);
|
listaClausoleRisultato = Array.from(resSent);
|
||||||
}
|
}
|
||||||
|
|
@ -2342,6 +2344,9 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* REGOLE DI PARSING PER VISUALIZZAZIONE CATEGORIE GRAMMATICALI
|
* REGOLE DI PARSING PER VISUALIZZAZIONE CATEGORIE GRAMMATICALI
|
||||||
*/
|
*/
|
||||||
|
|
@ -2570,16 +2575,16 @@ _ "whitespace"= " "*
|
||||||
var pronome = `
|
var pronome = `
|
||||||
|
|
||||||
Expression = head:(Filtro){return 'Pronome,'+head.join()}
|
Expression = head:(Filtro){return 'Pronome,'+head.join()}
|
||||||
Filtro= fhead:("p")? tail:( tipo_pronome? classe_pronome? genere_pronome?
|
Filtro= fhead:("p")? tail:( tipo_pronome* classe_pronome? genere_pronome?
|
||||||
numero_pronome? forma_pronome? funzione_pronome? tiporiflessivi?){return tail}
|
numero_pronome? forma_pronome? funzione_pronome? tiporiflessivi?){return tail}
|
||||||
|
|
||||||
|
|
||||||
tipo_pronome= "p" {return(' Pronome Personale')}/
|
tipo_pronome= "p" {return(' Pronome Personale')}/
|
||||||
|
"d" {return(" Pronome Dimostrativo")}/
|
||||||
"f" {return(" Pronome Riflessivo")}/
|
"f" {return(" Pronome Riflessivo")}/
|
||||||
"s" {return(" Pronome Possessivo")}/
|
"s" {return(" Pronome Possessivo")}/
|
||||||
"d" {return(" Pronome Dimostrativo")}/
|
|
||||||
"i" {return(" Pronome Indefinito")}/
|
|
||||||
"r" {return(" Pronome Relativo")}/
|
"r" {return(" Pronome Relativo")}/
|
||||||
|
"i" {return(" Pronome Indefinito")}/
|
||||||
"t" {return(" Pronome Interrogativo")}/
|
"t" {return(" Pronome Interrogativo")}/
|
||||||
"e" {return(" Pronome Esclamativo")}/
|
"e" {return(" Pronome Esclamativo")}/
|
||||||
"n" {return(" Pronome Numerale")}
|
"n" {return(" Pronome Numerale")}
|
||||||
|
|
@ -2814,4 +2819,5 @@ _ "whitespace"= " "*
|
||||||
var parserCongiunzione = peg.generate(congiunzione);
|
var parserCongiunzione = peg.generate(congiunzione);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -121,8 +121,29 @@ const maptypes = {
|
||||||
"ParentheticalCoI": "Coordinata alla parentetica I grado", "SubVII": "Subordinata VII grado"
|
"ParentheticalCoI": "Coordinata alla parentetica I grado", "SubVII": "Subordinata VII grado"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* regole di parsing per il filtro
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const filterposition=`
|
||||||
|
Filter = head:(interval? val?) {return head}
|
||||||
|
|
||||||
|
interval= limitinf? limitsup?
|
||||||
|
|
||||||
|
limitsup= head:(Integer) "]" {return head}
|
||||||
|
|
||||||
|
limitinf = "[" tail:(Integer) {return tail}
|
||||||
|
|
||||||
|
val = vhead:(Integer){return vhead}
|
||||||
|
|
||||||
|
Integer "integer"= _ [0-9]+ { return parseInt(text(), 10); }
|
||||||
|
_ "whitespace"= " "*`
|
||||||
|
|
||||||
|
//Filtro posizione
|
||||||
|
var parserFiltroPosizione=peg.generate(filterposition);
|
||||||
|
|
||||||
var orlprefix = 'https://dantenetwork.it/ontology/orl/current/'
|
var orlprefix = 'https://dantenetwork.it/ontology/orl/current/'
|
||||||
|
|
||||||
var syntitprefix = 'https://dantenetwork.it/ontology/syntit/current/'
|
var syntitprefix = 'https://dantenetwork.it/ontology/syntit/current/'
|
||||||
|
|
@ -813,6 +834,7 @@ function buildStatementClause(clause, parsedquery, whereind, theplace, token, op
|
||||||
clausePosCoalesceStatement['expression']['args'].push(JSON.parse(tmppos))
|
clausePosCoalesceStatement['expression']['args'].push(JSON.parse(tmppos))
|
||||||
var orfilter = JSON.parse(clausepos_gr_filter.replaceAll("pos_", "pos" + idtokenor))
|
var orfilter = JSON.parse(clausepos_gr_filter.replaceAll("pos_", "pos" + idtokenor))
|
||||||
|
|
||||||
|
|
||||||
if (orfilters.length == 0 || !orfilters.includes(JSON.stringify(orfilter))) {
|
if (orfilters.length == 0 || !orfilters.includes(JSON.stringify(orfilter))) {
|
||||||
if (parsedquery['where'].at(-1).type == "filter") {
|
if (parsedquery['where'].at(-1).type == "filter") {
|
||||||
var texp = JSON.parse(JSON.stringify(parsedquery['where'].at(-1).expression))
|
var texp = JSON.parse(JSON.stringify(parsedquery['where'].at(-1).expression))
|
||||||
|
|
@ -832,7 +854,45 @@ function buildStatementClause(clause, parsedquery, whereind, theplace, token, op
|
||||||
else {
|
else {
|
||||||
parsedquery['variables'].push(JSON.parse(tmppos))
|
parsedquery['variables'].push(JSON.parse(tmppos))
|
||||||
var andfilter = clausepos_gr_filter.replaceAll("pos_", "pos" + token)
|
var andfilter = clausepos_gr_filter.replaceAll("pos_", "pos" + token)
|
||||||
|
//TEST
|
||||||
|
if (document.querySelector('#Posizione_fr')!=null &&
|
||||||
|
document.querySelector('#Posizione_fr').value.trim()!=''){
|
||||||
|
var posrestr=document.querySelector('#Posizione_fr').value
|
||||||
|
var pospar=parserFiltroPosizione.parse(posrestr.trim())
|
||||||
|
if (pospar[1]!=null){
|
||||||
|
andfilter=andfilter.replace('<=', '=')
|
||||||
|
andfilter=andfilter.replace('clfr', 'clfr+'+(parseInt(pospar[1])-1))
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
var inter=pospar[0]
|
||||||
|
if (inter[0]!=null){
|
||||||
|
andfilter=andfilter.replace('clfr', 'clfr+'+(parseInt(inter[0])-1))
|
||||||
|
}
|
||||||
|
if (inter[1]!=null){
|
||||||
|
var newarg=`{
|
||||||
|
"type": "operation",
|
||||||
|
"operator": ">",
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"termType": "Variable",
|
||||||
|
"value": "clfr"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"termType": "Variable",
|
||||||
|
"value": "pos_"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}`
|
||||||
|
newarg=newarg.replace("clfr", "clfr+"+parseInt(inter[1]))
|
||||||
|
var tmpij=JSON.parse(andfilter)
|
||||||
|
tmpij.expression.args.push(JSON.parse(newarg))
|
||||||
|
andfilter=JSON.stringify(tmpij)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
parsedquery['where'].push(JSON.parse(andfilter))
|
parsedquery['where'].push(JSON.parse(andfilter))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue