implementazione simple search
This commit is contained in:
parent
844465c56a
commit
e3ff96bb02
|
@ -43,7 +43,7 @@ $(document).ready(function() {
|
||||||
// prima cantica
|
// prima cantica
|
||||||
$('#cantica1').on('click', function() {
|
$('#cantica1').on('click', function() {
|
||||||
|
|
||||||
//$("#CantiInferno").attr('style', 'display:block')
|
|
||||||
$('#cantica1').css({ 'opacity': 1 });
|
$('#cantica1').css({ 'opacity': 1 });
|
||||||
$('#cantica2').css({ 'opacity': 0.40 });
|
$('#cantica2').css({ 'opacity': 0.40 });
|
||||||
$('#cantica3').css({ 'opacity': 0.40 });
|
$('#cantica3').css({ 'opacity': 0.40 });
|
||||||
|
@ -51,8 +51,7 @@ $(document).ready(function() {
|
||||||
|
|
||||||
// seconda cantica
|
// seconda cantica
|
||||||
$('#cantica2').on('click', function() {
|
$('#cantica2').on('click', function() {
|
||||||
//hideMinimap();
|
|
||||||
//$("#CantiPurgatorio").attr('style', 'display:block')
|
|
||||||
$('#cantica1').css({ 'opacity': 0.40 });
|
$('#cantica1').css({ 'opacity': 0.40 });
|
||||||
$('#cantica2').css({ 'opacity': 1 });
|
$('#cantica2').css({ 'opacity': 1 });
|
||||||
$('#cantica3').css({ 'opacity': 0.40 });
|
$('#cantica3').css({ 'opacity': 0.40 });
|
||||||
|
@ -61,8 +60,7 @@ $(document).ready(function() {
|
||||||
|
|
||||||
// terza cantica
|
// terza cantica
|
||||||
$('#cantica3').on('click', function() {
|
$('#cantica3').on('click', function() {
|
||||||
//hideMinimap();
|
|
||||||
//$("#CantiParadiso").attr('style', 'display:block')
|
|
||||||
$('#cantica1').css({ 'opacity': 0.40 });
|
$('#cantica1').css({ 'opacity': 0.40 });
|
||||||
$('#cantica2').css({ 'opacity': 0.40 });
|
$('#cantica2').css({ 'opacity': 0.40 });
|
||||||
$('#cantica3').css({ 'opacity': 1 });
|
$('#cantica3').css({ 'opacity': 1 });
|
||||||
|
@ -104,22 +102,12 @@ $(document).ready(function() {
|
||||||
//Query
|
//Query
|
||||||
|
|
||||||
|
|
||||||
jQuery(document).delegate('#searchcomm', 'click', function(e) {
|
jQuery(document).delegate('#searchcomm, #searchcomm2', 'click', function(e) {
|
||||||
cleanSearchResult()
|
e.preventDefault();
|
||||||
esprlogica = []
|
manageQuery()
|
||||||
|
|
||||||
esprlogica.push('Clausola1')
|
|
||||||
condizioni = { "EsprLogica": esprlogica }
|
|
||||||
clausola = {}
|
|
||||||
clausola['typeGramm0'] = $('#queryText').val()
|
|
||||||
clausola['queryText'] = ""
|
|
||||||
condizioni['Clausola1'] = clausola
|
|
||||||
jsonQuery = buildSQ(condizioni)
|
|
||||||
myquery = new sparqlGenerator().stringify(jsonQuery)
|
|
||||||
|
|
||||||
executeQuerySearch(myquery)
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
//Reset
|
//Reset
|
||||||
|
|
||||||
jQuery(document).delegate('#cleanresult', 'click', function(e) {
|
jQuery(document).delegate('#cleanresult', 'click', function(e) {
|
||||||
|
@ -169,6 +157,20 @@ $(document).ready(function() {
|
||||||
if (currentMinimap != '')
|
if (currentMinimap != '')
|
||||||
showMinimap(currentMinimap)
|
showMinimap(currentMinimap)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function manageQuery(){
|
||||||
|
cleanSearchResult()
|
||||||
|
esprlogica = []
|
||||||
|
jsonQuery=getJsonQuery()
|
||||||
|
console.log("got json query")
|
||||||
|
|
||||||
|
jsonQuery = buildSQ(jsonQuery)
|
||||||
|
|
||||||
|
myquery = new sparqlGenerator().stringify(jsonQuery)
|
||||||
|
console.log(myquery)
|
||||||
|
executeQuerySearch(myquery)
|
||||||
|
}
|
||||||
|
|
||||||
//minimap management
|
//minimap management
|
||||||
|
|
||||||
|
|
||||||
|
@ -213,28 +215,8 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
function getDimensions() {
|
|
||||||
cantoplace = document.getElementById(displayId)
|
|
||||||
let bodyWidth = cantoplace.clientWidth;
|
|
||||||
let bodyRatio = bodyWidth / cantoplace.clientHeight
|
|
||||||
//let winRatio=cantoplace.clientWidth / getInnerHeight(cantoplace)
|
|
||||||
let winRatio = window.innerHeight / window.innerWidth;
|
|
||||||
|
|
||||||
|
|
||||||
minimap.style.width = '55%';
|
|
||||||
viewer.style.width = '55%'
|
|
||||||
|
|
||||||
realScale = minimap.clientWidth / bodyWidth;
|
|
||||||
|
|
||||||
minimapSize.style.paddingTop = `${bodyRatio * 100}%`
|
|
||||||
viewer.style.paddingTop = `${winRatio * 100}%`;
|
|
||||||
minimapContent.style.transform = `scale(${realScale})`;
|
|
||||||
minimapContent.style.width = `${(100 / realScale)}%`;
|
|
||||||
minimapContent.style.height = `${(100 / realScale)}%`;
|
|
||||||
|
|
||||||
}*/
|
|
||||||
|
|
||||||
function getInnerHeight(elm) {
|
function getInnerHeight(elm) {
|
||||||
var computed = getComputedStyle(elm),
|
var computed = getComputedStyle(elm),
|
||||||
padding = parseInt(computed.paddingTop) + parseInt(computed.paddingBottom);
|
padding = parseInt(computed.paddingTop) + parseInt(computed.paddingBottom);
|
||||||
|
@ -365,6 +347,7 @@ $(document).ready(function() {
|
||||||
return orderedListaCanti
|
return orderedListaCanti
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Search functions
|
// Search functions
|
||||||
/* async function executeQueryVersi(query) {
|
/* async function executeQueryVersi(query) {
|
||||||
bindingsStream = await myEngine.queryBindings(query, { sources: [{ type: 'sparql', value: sparqlEndpoint },], });
|
bindingsStream = await myEngine.queryBindings(query, { sources: [{ type: 'sparql', value: sparqlEndpoint },], });
|
||||||
|
@ -523,10 +506,12 @@ $(document).ready(function() {
|
||||||
for (cantica of cantiche) {
|
for (cantica of cantiche) {
|
||||||
i += 1
|
i += 1
|
||||||
let count = resultsInCantica.reduce((n, x) => n + (x === cantica), 0);
|
let count = resultsInCantica.reduce((n, x) => n + (x === cantica), 0);
|
||||||
var spanbadgecantica = $('<span />');
|
if (count>0){
|
||||||
spanbadgecantica.attr('class', 'badge badge-primary badge-pill ml-1');
|
var spanbadgecantica = $('<span />');
|
||||||
spanbadgecantica.append(count)
|
spanbadgecantica.attr('class', 'badge badge-primary badge-pill ml-1');
|
||||||
spanbadgecantica.appendTo($('#cantica' + i))
|
spanbadgecantica.append(count)
|
||||||
|
spanbadgecantica.appendTo($('#cantica' + i))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//aggiunge badge con totale risultati accanto ai canti
|
//aggiunge badge con totale risultati accanto ai canti
|
||||||
|
|
||||||
|
@ -535,13 +520,14 @@ $(document).ready(function() {
|
||||||
if (k == 0)
|
if (k == 0)
|
||||||
continue
|
continue
|
||||||
let count = resultsInCanto.reduce((n, x) => n + (x === cantica + 'Canto ' + k), 0);
|
let count = resultsInCanto.reduce((n, x) => n + (x === cantica + 'Canto ' + k), 0);
|
||||||
|
if (count>0){
|
||||||
var spanbadge = $('<span />');
|
var spanbadge = $('<span />');
|
||||||
spanbadge.attr('class', cantobadgeclass);
|
spanbadge.attr('class', cantobadgeclass);
|
||||||
spanbadge.append(count)
|
spanbadge.append(count)
|
||||||
//$("[name='nameofobject']")
|
//$("[name='nameofobject']")
|
||||||
spanbadge.appendTo($('[name="' + cantica + 'Canto ' + k + '"]'))
|
spanbadge.appendTo($('[name="' + cantica + 'Canto ' + k + '"]'))
|
||||||
//spanbadge.insertAfter($('[name="'+cantica+'Canto '+k+'"]'))
|
//spanbadge.insertAfter($('[name="'+cantica+'Canto '+k+'"]'))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
66752
js/partext.js
66752
js/partext.js
File diff suppressed because it is too large
Load Diff
211
js/utils.js
211
js/utils.js
|
@ -76,28 +76,6 @@ LIMIT 20
|
||||||
`
|
`
|
||||||
|
|
||||||
// Per restituire i versi di una cantica
|
// Per restituire i versi di una cantica
|
||||||
var qVersiCanticaold=`
|
|
||||||
PREFIX ecrm: <http://erlangen-crm.org/current/>
|
|
||||||
PREFIX orl: <https://dantenetwork.it/ontology/orl/current/>
|
|
||||||
PREFIX ontolex: <http://www.w3.org/ns/lemon/ontolex#>
|
|
||||||
PREFIX olires: <https://dantenetwork.it/ontology/olires/current/>
|
|
||||||
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
|
||||||
PREFIX text: <http://jena.apache.org/text#>
|
|
||||||
PREFIx hdn: <https://dantenetwork.it/data/commedia/>
|
|
||||||
|
|
||||||
SELECT (?textver AS ?Verso) (?NumVerso AS ?NumeroVerso) (?t_canto AS ?Canto) (?t_cantica AS ?Cantica) ?from ?to
|
|
||||||
WHERE {
|
|
||||||
?ver ecrm:P190_Has_Symbolic_Content ?textver;
|
|
||||||
olires:hasNumber ?NumVerso;
|
|
||||||
olires:OccursInRegion ?reg .
|
|
||||||
?reg olires:fragmentRegionFrom ?from;
|
|
||||||
olires:fragmentRegionTo ?to .
|
|
||||||
?canto ecrm:P102_has_title ?t_canto;
|
|
||||||
olires:hasStructuralComponent ?ver.
|
|
||||||
?cantica ecrm:P102_has_title ?t_cantica ;
|
|
||||||
olires:hasStructuralComponent ?canto.
|
|
||||||
FILTER regex(?t_cantica,"Inferno","i") .
|
|
||||||
}`
|
|
||||||
|
|
||||||
var qVersiCantica=`
|
var qVersiCantica=`
|
||||||
PREFIX ecrm: <http://erlangen-crm.org/current/>
|
PREFIX ecrm: <http://erlangen-crm.org/current/>
|
||||||
|
@ -157,31 +135,11 @@ Integer "integer"
|
||||||
_ "whitespace"= " "*
|
_ "whitespace"= " "*
|
||||||
|
|
||||||
`
|
`
|
||||||
var hdnquerygrammartest = `
|
|
||||||
Expression
|
|
||||||
= head:((_)?"("(_)?("AND "/"OR ") Filtro+ (_)?(")")?){return '{"'+head[3]+'": ['+head[4]+"]}"}//{ return head}.join("").replaceAll(", ,","").replaceAll("(,","(").replaceAll(",("," (")}
|
|
||||||
/ resu:Filtro {return resu[1].split().join()+' ';}
|
|
||||||
Filtro
|
|
||||||
= (_)"("?head:(("AND "/"OR "))? tail:Clausola+ (_)? closecl:(")")?
|
|
||||||
|
|
||||||
{if (head != null) return ' {"'+head+'":['+tail+"]}";
|
|
||||||
else if (tail!=null & tail.length <2) return ' '+tail+''
|
|
||||||
else return ""+tail+"";}
|
|
||||||
/ cl:Clausola
|
|
||||||
|
|
||||||
Clausola
|
|
||||||
= cla:("Clausola"Integer)(_)? {return ' {"TERM": "'+cla[0]+cla[1]+'"}';}
|
|
||||||
|
|
||||||
|
|
||||||
Integer "integer"
|
|
||||||
= _ [0-9]+ { return parseInt(text(), 10); }
|
|
||||||
|
|
||||||
_ "whitespace"= " "*
|
|
||||||
|
|
||||||
`
|
|
||||||
var testmm = 0
|
var testmm = 0
|
||||||
|
|
||||||
//query
|
//query
|
||||||
|
|
||||||
ontoSparqlQuery = `PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
ontoSparqlQuery = `PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
||||||
PREFIX ecrm: <http://erlangen-crm.org/current/>
|
PREFIX ecrm: <http://erlangen-crm.org/current/>
|
||||||
PREFIX hdn: <http://dantenetwork.it/data/commedia/>
|
PREFIX hdn: <http://dantenetwork.it/data/commedia/>
|
||||||
|
@ -194,26 +152,24 @@ PREFIX comm: <http://dantenetwork.it/data/commedia/>
|
||||||
|
|
||||||
SELECT (?form as ?IRIForma) (?Rappresentazione as ?Forma) (?lm as ?Lemma) (?textver as ?Verso) (?NumVerso as ?NumeroVerso)
|
SELECT (?form as ?IRIForma) (?Rappresentazione as ?Forma) (?lm as ?Lemma) (?textver as ?Verso) (?NumVerso as ?NumeroVerso)
|
||||||
(?t_canto as ?Canto) (?t_cantica as ?Cantica) ?pos
|
(?t_canto as ?Canto) (?t_cantica as ?Cantica) ?pos
|
||||||
|
|
||||||
|
|
||||||
WHERE {
|
WHERE {
|
||||||
?fa orl:occurrenceOf ?form.
|
FILTER(REGEX(?Rappresentazione, "^andare$", "i")) .
|
||||||
|
FILTER(LANGMATCHES(LANG(?Rappresentazione), "it"))
|
||||||
|
?form ontolex:writtenRep ?Rappresentazione.
|
||||||
|
?fa orl:occurrenceOf ?form;
|
||||||
|
olires:OccursInRegion ?reg .
|
||||||
?ver ecrm:P190_Has_Symbolic_Content ?textver;
|
?ver ecrm:P190_Has_Symbolic_Content ?textver;
|
||||||
olires:hasNumber ?NumVerso;
|
olires:hasNumber ?NumVerso;
|
||||||
olires:hasStructuralComponent ?fa.
|
olires:hasStructuralComponent ?fa.
|
||||||
?fa olires:OccursInRegion ?reg .
|
?reg olires:fragmentRegionFrom ?pos .
|
||||||
?reg olires:fragmentRegionFrom ?pos .
|
|
||||||
?canto ecrm:P102_has_title ?t_canto;
|
?canto ecrm:P102_has_title ?t_canto;
|
||||||
olires:hasStructuralComponent ?ver.
|
olires:hasStructuralComponent ?ver.
|
||||||
?cantica ecrm:P102_has_title ?t_cantica;
|
?cantica ecrm:P102_has_title ?t_cantica;
|
||||||
olires:hasStructuralComponent ?canto.
|
olires:hasStructuralComponent ?canto.
|
||||||
?form ontolex:writtenRep ?Rappresentazione.
|
|
||||||
?lent ontolex:lexicalForm ?form;
|
?lent ontolex:lexicalForm ?form;
|
||||||
ontolex:canonicalForm ?cf.
|
ontolex:canonicalForm ?cf.
|
||||||
?cf ontolex:writtenRep ?lm.
|
?cf ontolex:writtenRep ?lm.
|
||||||
FILTER(LANGMATCHES(LANG(?Rappresentazione), "it"))
|
}`
|
||||||
} `
|
|
||||||
//Togliere LIMIT in prod
|
|
||||||
|
|
||||||
orlprefix = 'https://dantenetwork.it/ontology/orl/current/'
|
orlprefix = 'https://dantenetwork.it/ontology/orl/current/'
|
||||||
var stringInSparql= false;
|
var stringInSparql= false;
|
||||||
|
@ -355,50 +311,9 @@ function buildSQ(stquery) {
|
||||||
//Prendo la query SPARQL template
|
//Prendo la query SPARQL template
|
||||||
const parsedquery = parser.parse(ontoSparqlQuery);
|
const parsedquery = parser.parse(ontoSparqlQuery);
|
||||||
//const parsedquery = parser.parse(tqvpvs);
|
//const parsedquery = parser.parse(tqvpvs);
|
||||||
const lf = document.getElementById("lemma_forma");
|
|
||||||
//mytestq = parser.parse(tq);
|
|
||||||
var ftxt = document.getElementById("queryText");
|
|
||||||
//Nick
|
|
||||||
if (ftxt == null) {
|
|
||||||
ftxt = document.getElementById("searchValue");
|
|
||||||
/*
|
|
||||||
//definizione struttura della query
|
|
||||||
var EsprLogica = ""
|
|
||||||
filters = $("[id^=filtro-]")
|
|
||||||
term = "";
|
|
||||||
filters.each(function(index, element) {
|
|
||||||
var mx = $(this).find('#andor');
|
|
||||||
if (index == 0) {
|
|
||||||
EsprLogica += ''
|
|
||||||
term = $(this).attr('id')
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
EsprLogica = "(" + mx.val() + " " + term + " " + $(this).attr('id') + ") "
|
|
||||||
term = EsprLogica
|
|
||||||
}
|
|
||||||
});
|
|
||||||
stquery['EsprLogica'] = EsprLogica.split(" ")
|
|
||||||
// fine definizione struttura
|
|
||||||
*/
|
|
||||||
if (stquery['EsprLogica'] != '') {
|
|
||||||
if (stquery['query'] != null && clause['query'].trim() != "") {
|
|
||||||
if (clause['query'].trim().slice(-1) !== '*')
|
|
||||||
strval = "^" + clause['query'].trim() + "$";
|
|
||||||
else
|
|
||||||
strval = clause['query'].trim().slice(0, -1)
|
|
||||||
|
|
||||||
multipleCondSpQuery.where[1].expression.args[1].value = strval;
|
|
||||||
|
|
||||||
if (clause['lemma_forma'] != null && clause['lemma_forma'] == 'lemma')
|
|
||||||
multipleCondSpQuery.where[1].expression.args[0].value = "lm";
|
|
||||||
}
|
|
||||||
buildSPQuery(stquery)
|
|
||||||
return multipleCondSpQuery;
|
|
||||||
|
|
||||||
}
|
|
||||||
myquery = buildClauseNick(stquery, parsedquery);
|
|
||||||
return (myquery)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (stquery['EsprLogica'] != null && stquery['EsprLogica'].length > 1) {
|
if (stquery['EsprLogica'] != null && stquery['EsprLogica'].length > 1) {
|
||||||
buildSPQuery(stquery)
|
buildSPQuery(stquery)
|
||||||
|
@ -412,76 +327,36 @@ function buildSQ(stquery) {
|
||||||
return (myquery)
|
return (myquery)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ftxt.value.trim() != "") {
|
if(stquery['Clausola0']['queryText']!= ""){
|
||||||
|
searchtext=stquery['Clausola0']['queryText']
|
||||||
|
strval=searchtext
|
||||||
|
if(stquery['Clausola0']['opzioni_testo']=='parola'){
|
||||||
|
strval = "^" + searchtext.trim() + "$";
|
||||||
|
}
|
||||||
|
if(stquery['Clausola0']['opzioni_testo']=='sottostringa'){
|
||||||
|
strval = searchtext.trim();
|
||||||
|
}
|
||||||
|
if(stquery['Clausola0']['opzioni_testo']=='suffisso'){
|
||||||
|
strval = searchtext.trim()+ "$";
|
||||||
|
}
|
||||||
|
if(stquery['Clausola0']['opzioni_testo']=='prefisso'){
|
||||||
|
strval = "^" +searchtext.trim();
|
||||||
|
}
|
||||||
|
//COMPLETARE con regexp
|
||||||
|
|
||||||
if (ftxt.value.trim().slice(-1) !== '*')
|
parsedquery.where[0].expression.args[1].value = strval;
|
||||||
strval = "^" + ftxt.value.trim() + "$";
|
if (stquery['Clausola0']['lemma_forma'] == 'lemma')
|
||||||
else
|
parsedquery.where[0].expression.args[0].value = "lm";
|
||||||
strval = ftxt.value.trim().slice(0, -1)
|
|
||||||
|
|
||||||
parsedquery.where[1].expression.args[1].value = strval;
|
|
||||||
if (lf.value == 'lemma')
|
|
||||||
parsedquery.where[1].expression.args[0].value = "lm";
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
parsedquery.where.splice(1, 1)
|
parsedquery.where.splice(0, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return (parsedquery)
|
return (parsedquery)
|
||||||
|
|
||||||
}
|
}
|
||||||
//Nick
|
|
||||||
function buildClauseNick(nickclause, parsedquery) {
|
|
||||||
//clause = clause['filtro-1'];//da modificare
|
|
||||||
sctk = Object.keys(nickclause)
|
|
||||||
clause={}
|
|
||||||
for (ck in sctk){
|
|
||||||
if (sctk[ck].includes("filtro-")){
|
|
||||||
clause = nickclause [sctk[ck]]
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (clause['query'] != null && clause['query'].trim() != "") {
|
|
||||||
if (clause['query'].trim().slice(-1) !== '*')
|
|
||||||
strval = "^" + clause['query'].trim() + "$";
|
|
||||||
else
|
|
||||||
strval = clause['query'].trim().slice(0, -1)
|
|
||||||
|
|
||||||
parsedquery.where[1].expression.args[1].value = strval;
|
|
||||||
if (clause['lemma_forma'] != null && clause['lemma_forma'] == 'lemma')
|
|
||||||
parsedquery.where[1].expression.args[0].value = "lm";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
parsedquery.where.splice(1, 1)
|
|
||||||
}
|
|
||||||
if (clause['categoria'] != null && clause['categoria'] != "all")
|
|
||||||
parsedquery.where[0].triples.push(JSON.parse(data21)[clause['categoria']]);
|
|
||||||
|
|
||||||
|
|
||||||
if (clause['tipoClausola'] != null && Object.keys(sottoCategorie).includes(clause['categoria'].trim())) {
|
|
||||||
//sctmp=JSON.parse(sottoCategorieSostantivi)
|
|
||||||
sctmp = sottoCategorie[clause['categoria'].trim()]
|
|
||||||
sctk = Object.keys(sctmp)
|
|
||||||
for (ke in sctk) {
|
|
||||||
|
|
||||||
keval = clause[encodeURI(sctk[ke])]
|
|
||||||
|
|
||||||
if (keval != null && keval != '') {
|
|
||||||
keval = decodeURI(keval)
|
|
||||||
sttmts = sctmp[sctk[ke]]
|
|
||||||
if (sttmts[keval] != null && (sttmts[keval].split(':')[1]) != null) {
|
|
||||||
subcatstat = buildsubcategoryClause(sttmts[keval])
|
|
||||||
parsedquery.where[0].triples.push(subcatstat);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return parsedquery
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function buildJsonClause(clause, parsedquery, whereind, theplace) {
|
function buildJsonClause(clause, parsedquery, whereind, theplace) {
|
||||||
//Nick
|
//Nick
|
||||||
|
@ -611,37 +486,7 @@ function buildsubcategoryClause(sttmnt) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
//autocomplete
|
|
||||||
var categorie = ['aggettivovolgare', 'articolovolgare', 'avverbiovolgare',
|
|
||||||
'citazionevolgare', 'congiunzionevolgare', 'interiezionevolgare',
|
|
||||||
'locuzionevolgare', 'onomasticavolgare', 'preposizionevolgare',
|
|
||||||
'pronomevolgare', 'sostantivovolgare','verbovolgare'];
|
|
||||||
|
|
||||||
function autocompleteMatch(input) {
|
|
||||||
if (input == '') {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
var reg = new RegExp(input)
|
|
||||||
return categorie.filter(function(term) {
|
|
||||||
if (term.match(reg)) {
|
|
||||||
return term;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function showResults(val) {
|
|
||||||
res = document.getElementById("aco");
|
|
||||||
res.innerHTML = '';
|
|
||||||
let list = '';
|
|
||||||
let terms = autocompleteMatch(val);
|
|
||||||
for (i=0; i<terms.length; i++) {
|
|
||||||
list += '<li>' + terms[i] + '</li>';
|
|
||||||
}
|
|
||||||
res.innerHTML = '<ul>' + list + '</ul>';
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
var sottoCategorie = {
|
var sottoCategorie = {
|
||||||
"verbovolgare": {
|
"verbovolgare": {
|
||||||
"Diatesi": { "Attivo": "TipoDiatesiVerboVolgare:VerboVolgareAttivo", "Passivo": "TipoDiatesiVerboVolgare:VerboVolgarePassivo" },
|
"Diatesi": { "Attivo": "TipoDiatesiVerboVolgare:VerboVolgareAttivo", "Passivo": "TipoDiatesiVerboVolgare:VerboVolgarePassivo" },
|
||||||
|
|
Loading…
Reference in New Issue