Skip to content

Commit

Permalink
Progress on #15
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardojorgerm authored Apr 7, 2024
1 parent 4f28f7f commit 5ce5e16
Showing 1 changed file with 43 additions and 3 deletions.
46 changes: 43 additions & 3 deletions services/makeTTS.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ module.exports = (p, modes = {}) => {
thisString = thisString.replace(regex, 'Praceta$2');
regex = /\b(P[r]?[cç]?t[a][\.]?)(\s|$)/giu;
thisString = thisString.replace(regex, 'Praceta$2');
regex = /\b(Prac[\.]?)(\s|$)/giu;
thisString = thisString.replace(regex, 'Praceta$2');
regex = /\b(P[a]?[r]?[q](ue)?[\.]?)(\s)(Camp[^\s]*)\b/giu;
thisString = thisString.replace(regex, 'Parque de Campismo');
regex = /\b(P[a]?[r]?[q](ue)?[\.]?)(\s)(Inf[^\s]*)\b/giu;
Expand All @@ -167,8 +169,12 @@ module.exports = (p, modes = {}) => {
thisString = thisString.replace(regex, ' Parque ');
regex = /(?<=Parque)\s*Est[a]?[c]?[i]?[o]?[n]?[a]?[m]?[\.]?($|\s)/giu;
thisString = thisString.replace(regex, ' de Estacionamento ');
regex = /\b(Estaciona[m]?[\.]?)(\s|$)/giu;
thisString = thisString.replace(regex, 'Estacionamento$2');
regex = /\b(C[m]?[p]?[\.]?[oº]?)(\s)(?=Fut|Bol|Jog)/giu;
thisString = thisString.replace(regex, 'Campo$2');
regex = /\b(Fut[e]?[b]?[\.]?)(\s|$)/giu;
thisString = thisString.replace(regex, 'Futeból');
regex = /\b(Viad[\.]?)(\s|$)/giu;
thisString = thisString.replace(regex, 'Viaduto$2');
regex = /\b(Vdt[o]?[\.]?)(\s|$)/giu;
Expand Down Expand Up @@ -291,6 +297,10 @@ module.exports = (p, modes = {}) => {
thisString = thisString.replace(regex, ' Sociedade ');
regex = /\b(Bomb[\.]?)(\s|$)/giu;
thisString = thisString.replace(regex, 'Bombeiros$2');
regex = /\b(Condom[\.]?)(\s|$)/giu;
thisString = thisString.replace(regex, 'Condomínio$2');
regex = /\b(Resid[\.]?)(\s|$)/giu;
thisString = thisString.replace(regex, 'Residência$2');
regex = /\b(Rec[r]?[e]?[a]?[t]?[i]?[v]?[\.]?)(\s|$)/giu;
thisString = thisString.replace(regex, 'Recreativo ');
regex = /\b(Volunt[\.]?)(\s|$)/giu;
Expand All @@ -305,12 +315,18 @@ module.exports = (p, modes = {}) => {
thisString = thisString.replace(regex, 'Escola Básica ');
regex = /\b(Esc[\.]?)(\s|$|\))/giu;
thisString = thisString.replace(regex, 'Escola ');
regex = /(?<=Escola\s)Pri[m]?(\s|$)/giu;
thisString = thisString.replace(regex, 'Primária ');
regex = /(?<=Escola\s)Prep(\s|$)/giu;
thisString = thisString.replace(regex, 'Preparatória ');
regex = /(?<=Escola\s)Cond(\s|$)/giu;
thisString = thisString.replace(regex, 'Condução ');
regex = /\bPSP\b/giu;
thisString = thisString.replace(regex, 'Polícia');
regex = /(?<=Escola\s)Nac(\s|$)/giu;
thisString = thisString.replace(regex, 'Nacional ');
regex = /\b(Col[\.]?)\s/giu;
thisString = thisString.replace(regex, 'Colégio ');
regex = /\b(Acad[\.]?)\s/giu;
thisString = thisString.replace(regex, 'Academia ');
regex = /\b(Cid[\.]?)\s/giu;
thisString = thisString.replace(regex, 'Cidáde ');
regex = /(?<=Cidade)[\s]*(Univ(ers)?[\.]?)\s/giu;
Expand Down Expand Up @@ -387,6 +403,8 @@ module.exports = (p, modes = {}) => {
thisString = thisString.replace(regex, 'Solidária ');
regex = /\bJardm\b/giu;
thisString = thisString.replace(regex, 'Jardim');
regex = /\bMirad\b/giu;
thisString = thisString.replace(regex, 'Miradouro');
regex = /(?<=((Bairro)|B[oº]?))[\.]?\sCtt\b/giu;
thisString = thisString.replace(regex, ' dos C.T.T.');
regex = /\bCtt\b/giu;
Expand All @@ -397,6 +415,8 @@ module.exports = (p, modes = {}) => {
thisString = thisString.replace(regex, 'Combóios ');
regex = /\bSMAS\b/giu;
thisString = thisString.replace(regex, ' Serviços Municipalizados');
regex = /\bServ[\s]+Op\b/giu;
thisString = thisString.replace(regex, ' Serviços Operacionais ');
regex = /\bInst(itut)?\b/giu;
thisString = thisString.replace(regex, 'Instituto');
regex = /\bCab\s+(?=Luz|Pt)/giu;
Expand All @@ -405,20 +425,32 @@ module.exports = (p, modes = {}) => {
thisString = thisString.replace(regex, 'Guárda Republicana');
regex = /\bPSP\b/giu;
thisString = thisString.replace(regex, 'Polícia');
regex = /\bUnid\b/giu;
thisString = thisString.replace(regex, 'Unidade');
regex = /\bFarm([aá]c)?[\.]?(\s|$|\/)/giu;
thisString = thisString.replace(regex, 'Farmácia ');
regex = /\b(Ter([m]?|mi|min)[\.]?)(\s|$)/giu;
thisString = thisString.replace(regex, ' Terminál ');
regex = /\b(Merc[\.]?)(\s|$)/giu;
thisString = thisString.replace(regex, 'Mercado ');
regex = /\b(Hot[\.]?)(\s|$)/giu;
thisString = thisString.replace(regex, 'Hotel ');
regex = /\b(Vet[\.]?)(\s|$)/giu;
thisString = thisString.replace(regex, 'Veterinário ');
regex = /\b(Comp[\.]?)(\s|$)/giu;
thisString = thisString.replace(regex, 'Complexo ');
regex = /\b(Intern[\.]?)(\s|$)/giu;
thisString = thisString.replace(regex, 'Internacional ');
regex = /\b(Superm(erc)?[\.]?)(\s|$)/giu;
thisString = thisString.replace(regex, 'Súper-mercádo ');
regex = /\b(Paral[\.]?)\s/giu;
thisString = thisString.replace(regex, 'Paralélo ');
regex = /\b(Prin[c]?[\.]?)\s/giu;
thisString = thisString.replace(regex, 'Príncipal ');
regex = /\b(Polidesp[\.]?)(\s|$)/giu;
thisString = thisString.replace(regex, 'Polidesportivo ');
regex = /\b(Tap[\.]?)(\s|$)/giu;
thisString = thisString.replace(regex, 'Tapada ');
/* Localities */
regex = /\b(Alc[^âa](ch)?[\.]?)\b/giu;
thisString = thisString.replace(regex, 'Álcochete');
Expand Down Expand Up @@ -452,8 +484,10 @@ module.exports = (p, modes = {}) => {
thisString = thisString.replace(regex, 'Guerra ');
regex = /\b(G[\.\s]*)(de[\s]*)?(?=Ort)/giu;
thisString = thisString.replace(regex, 'Garcia de ');
regex = /\b(Com[^\s]*[\s]Gr[^\s]*[\s]G[^\s]*)\b/giu;
regex = /\b(Com(bat)?[^\s]*[\s]Gr[^\s]*[\s]G[^\s]*)\b/giu;
thisString = thisString.replace(regex, 'Combatentes da Grande Guerra');
regex = /\bCombat\b/giu;
thisString = thisString.replace(regex, 'Combatentes');
regex = /\b(Mov[^\s]*[\s]F[^\s]*[\s]Arm[^\s]*)\b/giu;
thisString = thisString.replace(regex, 'Movimento das Forças Armadas');
regex = /\bF(or)?([cç]as)?[^\s]*[\s]+Arm[^\s]*\b/giu;
Expand All @@ -466,6 +500,10 @@ module.exports = (p, modes = {}) => {
thisString = thisString.replace(regex, 'Fuzileiros Navais');
regex = /\bEcom\b/giu;
thisString = thisString.replace(regex, 'Ecomuseu');
regex = /(?<=s)[\s]+[AÁ]g(\s|$)/giu;
thisString = thisString.replace(regex, 'Águas ');
regex = /\b[AÁ]g(\s|$)/giu;
thisString = thisString.replace(regex, 'Água ');
regex = /\bM[\.\s]*F[\.\s]*A[\.\s]*\b/giu;
thisString = thisString.replace(regex, 'M. F. A.');
regex = /\b(C[o]?v[\.]?)(\s|$)/giu;
Expand Down Expand Up @@ -659,6 +697,8 @@ module.exports = (p, modes = {}) => {
thisString = thisString.replace(regex, ' Alfredo ');
regex = /(?<=Alfredo)[\s]*Vit[\.]?\s/giu;
thisString = thisString.replace(regex, ' Vitorino ');
regex = /\bTras[\.]?(\s)/giu;
thisString = thisString.replace(regex, 'Traseiras ');
regex = /\bDps[\.]?(\s)/giu;
thisString = thisString.replace(regex, 'Depois ');
regex = /\bJto[\.]?(\s)/giu;
Expand Down

0 comments on commit 5ce5e16

Please sign in to comment.