aggiunto grammatica per avverbi e per pronomi
This commit is contained in:
parent
3e6ef8e7ac
commit
813766d4c9
|
@ -58,7 +58,16 @@ $(document).ready(function() {
|
||||||
|
|
||||||
$("[data-cg]").hover(function() {
|
$("[data-cg]").hover(function() {
|
||||||
var details=getHoverContent($(this).data("cg"))
|
var details=getHoverContent($(this).data("cg"))
|
||||||
$(this).popover({title: "Proprietà", content: details, trigger: "click"});
|
var index = details.indexOf(",");
|
||||||
|
var categoria = "";
|
||||||
|
if (index != -1){
|
||||||
|
categoria = details.substring(0,index);
|
||||||
|
details = details.substring(index+1);
|
||||||
|
}else{
|
||||||
|
categoria = details;
|
||||||
|
details = "";
|
||||||
|
}
|
||||||
|
$(this).popover({title: categoria, content: details, trigger: "click"});
|
||||||
});
|
});
|
||||||
|
|
||||||
var mmih = 0
|
var mmih = 0
|
||||||
|
@ -135,6 +144,12 @@ $(document).ready(function() {
|
||||||
if(categ[0]=='e'){
|
if(categ[0]=='e'){
|
||||||
return parserPreposizioni.parse(categ).split(',').filter(prop => prop.length > 0).join()
|
return parserPreposizioni.parse(categ).split(',').filter(prop => prop.length > 0).join()
|
||||||
}
|
}
|
||||||
|
if(categ[0]=='b'){
|
||||||
|
return parserAvverbi.parse(categ).split(',').filter(prop => prop.length > 0).join()
|
||||||
|
}
|
||||||
|
if(categ[0]=='p'){
|
||||||
|
return parserPronomi.parse(categ).split(',').filter(prop => prop.length > 0).join()
|
||||||
|
}
|
||||||
//console.log(categ[0])
|
//console.log(categ[0])
|
||||||
return categoriegrammaticali[categ[0]]
|
return categoriegrammaticali[categ[0]]
|
||||||
}
|
}
|
||||||
|
@ -623,9 +638,9 @@ declinazionesostantivo= [1|2|3]? {switch(parseInt(text())){
|
||||||
case(2): return ' Seconda declinazione';
|
case(2): return ' Seconda declinazione';
|
||||||
case(3): return ' Terza declinazione'}}
|
case(3): return ' Terza declinazione'}}
|
||||||
|
|
||||||
genereforma=[m|f]? {if (text()=='m') return ' maschile'; else if (text()=='f') return ' femminile';}
|
genereforma=[m|f]? {if (text()=='m') return ' forma maschile'; else if (text()=='f') return ' forma femminile';}
|
||||||
|
|
||||||
generelemma=[m|f]? {if (text()=='m') return ' maschile'; else if (text()=='f') return ' femminile';}
|
generelemma=[m|f]? {if (text()=='m') return ' lemma maschile'; else if (text()=='f') return ' lemma femminile';}
|
||||||
|
|
||||||
numersingolareplurale=[s|p]? {if (text()=='s') return ' numero singolare'; else if (text()=='p') return ' numero plurale';}
|
numersingolareplurale=[s|p]? {if (text()=='s') return ' numero singolare'; else if (text()=='p') return ' numero plurale';}
|
||||||
|
|
||||||
|
@ -719,11 +734,88 @@ complemento2=
|
||||||
"k13" {return(" Di Esclusione")} /
|
"k13" {return(" Di Esclusione")} /
|
||||||
"k14" {return(" Di Rapporto")}
|
"k14" {return(" Di Rapporto")}
|
||||||
|
|
||||||
|
`
|
||||||
|
var avverbio = ` Expression = head:(Filtro){return 'Avverbio,'+head.join()}
|
||||||
|
Filtro= fhead:("b")? tail:( fake? tipo?){return tail}
|
||||||
|
|
||||||
|
fake= ""
|
||||||
|
|
||||||
|
tipo="c+" {return(' Avverbio al Comparativo di Maggioranza')}/
|
||||||
|
"c-" {return(' Avverbio al Comparativo di Minoranza')}/
|
||||||
|
"sa" {return(' Avverbio al Superlativo Assoluto')}/
|
||||||
|
"sr" {return(' Avverbio al Superlativo Relativo')}/
|
||||||
|
"I" {return(' Avverbio in Locuzione')}/
|
||||||
|
"lz" {return(' Avverbio in Locuzione Separato')}/
|
||||||
|
"y" {return(' Avverbio Proclitico')}/
|
||||||
|
"x" {return(' Avverbio Enclitico')}/
|
||||||
|
"c" {return(' Avverbio al Comparativo di Uguaglianza')}
|
||||||
|
|
||||||
|
|
||||||
|
Integer "integer"
|
||||||
|
= _ [0-9]+ { return parseInt(text(), 10); }
|
||||||
|
|
||||||
|
_ "whitespace"= " "*
|
||||||
|
|
||||||
|
`
|
||||||
|
|
||||||
|
var pronome = `
|
||||||
|
|
||||||
|
Expression = head:(Filtro){return 'Pronome,'+head.join()}
|
||||||
|
Filtro= fhead:("p")? tail:( tipo_pronome? classe_pronome? genere_pronome?
|
||||||
|
numero_pronome? forma_pronome? funzione_pronome? tiporiflessivi?){return tail}
|
||||||
|
|
||||||
|
|
||||||
|
tipo_pronome= "p" {return(' Pronome Personale')}/
|
||||||
|
"f" {return(" Pronome Riflessivo")}/
|
||||||
|
"s" {return(" Pronome Possessivo")}/
|
||||||
|
"d" {return(" Pronome Dimostrativo")}/
|
||||||
|
"i" {return(" Pronome Indefinito")}/
|
||||||
|
"r" {return(" Pronome Relativo")}/
|
||||||
|
"t" {return(" Pronome Interrogativo")}/
|
||||||
|
"e" {return(" Pronome Esclamativo")}/
|
||||||
|
"n" {return(" Pronome Numerale")}
|
||||||
|
|
||||||
|
classe_pronome= "1" {return(" Prima Classe Persona")}/
|
||||||
|
"2" {return(" Seconda Classe Persona")}/
|
||||||
|
"3" {return(" Terza Classe Persona")}
|
||||||
|
|
||||||
|
genere_pronome= "m" {return(" Maschile")}/
|
||||||
|
"f" {return(" Femminile")}/
|
||||||
|
"n" {return(" Neutro")}
|
||||||
|
numero_pronome= "s" {return(" Singolare")}/
|
||||||
|
"p" {return(" Plurale")}
|
||||||
|
forma_pronome= "l" {return(" Pronome Libero")}/
|
||||||
|
"i" {return(" Pronome Libero In Composizione")}/
|
||||||
|
"y" {return(" Pronome Proclitico")}/
|
||||||
|
"x" {return(" Pronome Enclitico")}
|
||||||
|
funzione_pronome="so" {return(' Libero Soggetto')}/
|
||||||
|
"soi" {return(' Libero Soggetto Impersonale')}/
|
||||||
|
"co" {return(' Libero Complemento')}/
|
||||||
|
"ra" {return(' Libero Rafforzativo')}/
|
||||||
|
"ac" {return(' Clitico Accusativo')}/
|
||||||
|
"ad" {return(' Clitico Dativo')}/
|
||||||
|
"pt" {return(' Clitico Partitivo')}
|
||||||
|
|
||||||
|
|
||||||
|
tiporiflessivi="pr" {return(' Proprio')}/
|
||||||
|
"le" {return(' Lessicalizzato')}/
|
||||||
|
"im" {return(' Impersonale')}/
|
||||||
|
"pa" {return(' Passivo')}/
|
||||||
|
"re" {return(' Reciproco')}
|
||||||
|
|
||||||
|
|
||||||
|
Integer "integer"
|
||||||
|
= _ [0-9]+ { return parseInt(text(), 10); }
|
||||||
|
|
||||||
|
_ "whitespace"= " "*
|
||||||
|
|
||||||
`
|
`
|
||||||
//parser per categorie
|
//parser per categorie
|
||||||
var parserVerbi = peg.generate(categoriegrammaticaliGrammar);
|
var parserVerbi = peg.generate(categoriegrammaticaliGrammar);
|
||||||
var parserSostantivi = peg.generate(categoriaGrammaticaleSostantivo);
|
var parserSostantivi = peg.generate(categoriaGrammaticaleSostantivo);
|
||||||
var parserPreposizioni = peg.generate(categoriaGrammaticalePreposizione);
|
var parserPreposizioni = peg.generate(categoriaGrammaticalePreposizione);
|
||||||
|
var parserAvverbi = peg.generate(avverbio);
|
||||||
|
var parserPronomi = peg.generate(pronome);
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue