ottimizzazione codice

This commit is contained in:
cesare 2024-05-17 10:56:24 +02:00
parent c442a5a60f
commit 2a5742d1b3
1 changed files with 10 additions and 9 deletions

View File

@ -14,6 +14,8 @@ var vistaRiferimenti = true
var listaPeriodiRisultato;
var listaClausoleRisultato;
var numeroContesti;
var hdnNamespace='http://dantenetwork.it/data/commedia/'
const syntitNamespace='https://dantenetwork.it/ontology/syntit/current/'
$(document).ready(function() {
removeGraph = false;
@ -1312,7 +1314,7 @@ $(document).ready(function() {
if (vistaDialoghi) {
for (const india in dialoghi) {
if (dialoghi[india]['Cnt'].replace('_so', '') == sentId) {
discorsost = "<div class='ttContentPers'><b>Personaggio:</b> <i>" + dialoghi[india]['Spna'].replace('http://dantenetwork.it/data/commedia/', '') + '</i>'
discorsost = "<div class='ttContentPers'><b>Personaggio:</b> <i>" + dialoghi[india]['Spna'].replace(hdnNamespace, '') + '</i>'
+ '<br><b>Discorso:</b> <i>' + TipiDiscorso[dialoghi[india]['Dty']] + '</i></div>'
break;
}
@ -1899,12 +1901,12 @@ $(document).ready(function() {
//regione della clausola
var clfrom = binding.get('clfr').value;
var clto = binding.get('clto').value;
//var cltype=binding.get('clatype').value.replace('https://dantenetwork.it/ontology/syntit/current/','')
var clfunction = binding.get('clafunction').value.replace('https://dantenetwork.it/ontology/syntit/current/', '')
var clocc = binding.get('clocc').value.replace('http://dantenetwork.it/data/commedia/', '')
//var clfunction=binding.get('clf').value.replace('https://dantenetwork.it/ontology/syntit/current/','')
//var cltype=binding.get('clatype').value.replace(syntitNamespace,'')
var clfunction = binding.get('clafunction').value.replace(syntitNamespace, '')
var clocc = binding.get('clocc').value.replace(hdnNamespace, '')
//var clfunction=binding.get('clf').value.replace(syntitNamespace,'')
//id del periodo
var sentenceid = binding.get('sentence').value.replace('http://dantenetwork.it/data/commedia/', '')
var sentenceid = binding.get('sentence').value.replace(hdnNamespace, '')
if (pos > 0 && !result.has(pos)) {
@ -1916,7 +1918,7 @@ $(document).ready(function() {
unitaRicerca = 'frase'
}
resultClauses.add(sentenceid + "-" + clfrom + '-' + clto + "-" + clfunction.trim().replace('ordinateClause', '').replace('MainClause', 'Ma') + '-' + cantica + '-' + canto + '-' + clocc)
resultSentences.add(sentenceid)
//resultSentences.add(sentenceid)//NON USATO????
});
seachbBindingsStream.on('end', () => {
@ -1949,7 +1951,6 @@ $(document).ready(function() {
let tmpocc = fraseItems.slice(-1)
if (resClauses.filter(clocc => clocc == tmpocc[0]).length == 0) {
resClauses.push(tmpocc[0]);
//resSent.add(fraseItems[0] + '-' + fraseItems[3]+'-'+fraseItems[1] + '-' + fraseItems[2]);
resSentence.add(fraseItems[1] + '-' + fraseItems[2]);
@ -2033,7 +2034,7 @@ $(document).ready(function() {
}
catch (err) {
//$("#loader").fadeOut(300);
$("#loader").fadeOut(300);
$("#searchcomm2").prop("disabled", false);
$("#searchcomm2").html('<span class="" role="status" aria-hidden="true"></span> Search');
console.log(err.message);