diff --git a/js/cesareBrowse.js b/js/cesareBrowse.js index 1fdc8c4..cff3339 100644 --- a/js/cesareBrowse.js +++ b/js/cesareBrowse.js @@ -132,11 +132,17 @@ $(document).ready(function() { var parser = peg.generate(categoriegrammaticaliGrammar); //console.log (parser.parse(categ).split(',').filter(prop => prop.length > 0).join()) return parser.parse(categ).split(',').filter(prop => prop.length > 0).join() - }else if(categ[0]=='s'){ + } + if(categ[0]=='s'){ var parser = peg.generate(categoriaGrammaticaleSostantivo); //console.log (parser.parse(categ).split(',').filter(prop => prop.length > 0).join()) return parser.parse(categ).split(',').filter(prop => prop.length > 0).join() } + if(categ[0]=='e'){ + var parser = peg.generate(categoriaGrammaticalePreposizione); + //console.log (parser.parse(categ).split(',').filter(prop => prop.length > 0).join()) + return parser.parse(categ).split(',').filter(prop => prop.length > 0).join() + } //console.log(categ[0]) return categoriegrammaticali[categ[0]] } @@ -147,7 +153,7 @@ $(document).ready(function() { currentMinimap = name; //mmviewer diventa draggable - minimapTopPos = $('#minimapviewer').offset().top + var minimapTopPos = $('#minimapviewer').offset().top console.log("top viewer init " + minimapTopPos) $('#minimapviewer').draggable({ @@ -247,11 +253,11 @@ $(document).ready(function() { } function getDimensionsDiv() { - cantoplace = document.getElementById(displayId) - elementplace = document.getElementById(mappedElement) + var cantoplace = document.getElementById(displayId) + var elementplace = document.getElementById(mappedElement) - bodyWidth = elementplace.clientWidth; - bodyRatio = elementplace.clientHeight / bodyWidth; + var bodyWidth = elementplace.clientWidth; + var bodyRatio = elementplace.clientHeight / bodyWidth; let winRatio = getInnerHeight(cantoplace) / (cantoplace.clientWidth); @@ -640,4 +646,87 @@ _ "whitespace"= " "* ` +var categoriaGrammaticalePreposizione = ` +Expression = head:(Filtro){return 'Preposizione,'+head.join()} +Filtro= fhead:("e")? tail:( tipo1? tipo2? sintassi? complemento1? complemento2?){return tail} + + +tipo1=[p|i] {if (text()=='i') return ' Impropria'; else if (text()=='p') return ' Impropria';} +tipo2=modo:"a" {return(' Articolata')}/ + "lx" {return(" In locuzione separata")}/ + "l" {return(" In locuzione")} / + "s" {return(" Semplice")} + +sintassi=[sodbfcnutmezlpa] {if (text()=='s') return ' Soggettiva'; + if (text()=='o') return ' Oggettiva'; + if (text()=='d') return ' Dichiarativa'; + if (text()=='b') return ' Completiva obliqua'; + if (text()=='f') return ' Finale'; + if (text()=='c') return ' Causale'; + if (text()=='n') return ' Concessiva'; + if (text()=='u') return ' Consecutiva'; + if (text()=='t') return ' Temporale'; + if (text()=='m') return ' Modale'; + if (text()=='e') return ' Eccettuativa'; + if (text()=='z') return ' Esclusiva'; + if (text()=='l') return ' Limitativa'; + if (text()=='p') return ' Comparativa'; + if (text()=='a') return ' Avversativa';} + +complemento1="ktd" {return(" Di tempo determinato")} / + "ktc" {return(" Di tempo continuato")} / + "kt" {return(' Di tempo')}/ + "kdl" {return(" Di moto da luogo")} / + "kd" {return(" Di termine")}/ + "kv" {return(" Di vantaggio")} / + "ksl" {return(" Di stato in luogo")} / + "ks" {return(" Di svantaggio")} / + "kg" {return(" Di specificazione")} / + "kml" {return(" Di moto a luogo")} / + "km" {return(" Di modo")} / + "kw" {return(" Di mezzo")} / + "kc" {return(" Di compagnia")} / + "ku" {return(" Di unione")} / + "ka" {return(" Di allontanamento/separazione")} / + "kz" {return(" Di materia")} / + "kl" {return(" Di luogo")} / + "ko" {return(" Di sostanza")} / + "kpl" {return(" Di moto per luogo")} / + "kps" {return(" Predicativa del soggetto")} / + "kpo" {return(" Predicativa dell'oggetto")} + + +complemento2= + "kp" {return(" Di Limitazione")} / + "kq" {return(" Di Qualità")} / + "kr" {return(" Di Causa")} / + "ki" {return(" Di Agente")} / + "ke" {return(" Di Causa Efficiente")} / + "kf" {return(" Di Fine Scopo")} / + "ky" {return(" Di Paragone")} / + "kx" {return(" Di Argomento")} / + "kb" {return(" Distributivo")} / + "kj" {return(" Di Sostituzione")} / + "kn" {return(" Di Estensione")} / + "k1b" {return(" Indiretta Benefattiva")} / + "k1p" {return(" Indiretta Possessore")} / + "k1o" {return(" Indiretta Oggetto")} / + "k1d" {return(" Indiretta Dativo")} / + "k1e" {return(" Indiretta Esperiente")} / + "k2" {return(" Simmetrica")} / + "k3" {return(" Di Pena")} / + "k4" {return(" Di Effetto")} / + "k5" {return(" Concessiv")} / + "k6" {return(" Di Origine Provenienza")} / + "k7" {return(" Di Abbondanza/Privazione")} / + "k8" {return(" Partitiva")} / + "k9" {return(" Di Denominazione")} / + "k10" {return(" Di Colpa")} / + "k11" {return(" Di Quantità")} / + "k12" {return(" Di Peso")} / + "k13" {return(" Di Esclusione")} / + "k14" {return(" Di Rapporto")} + +` + });