Wikcionario eswiktionary https://es.wiktionary.org/wiki/Wikcionario:Portada MediaWiki 1.46.0-wmf.22 case-sensitive Medio Especial Discusión Usuario Usuario discusión Wikcionario Wikcionario discusión Archivo Archivo discusión MediaWiki MediaWiki discusión Plantilla Plantilla discusión Ayuda Ayuda discusión Categoría Categoría discusión Apéndice Apéndice Discusión Tesauro Tesauro discusión TimedText TimedText talk Módulo Módulo discusión Evento Evento discusión uno 0 791 6076707 5925259 2026-04-05T02:46:17Z TMCbot 164594 . 6076707 wikitext text/x-wiki {{desambiguación|-uno|Ununoo|UNO|ùno|ünő}} == {{lengua|es}} == {{swadesh|es}} {{pron-graf|1audio1=LL-Q1321 (spa)-Rodelar-uno.wav|h1=huno}} === Etimología === {{etimología|osp|uno|uno}}, y este {{etim|la|unus|alt=ūnum|glosa=uno}}, {{etim|itc-ola|oinos|glosa=uno}}, {{etim|itc-pro|*oinos}}, {{etim|ine-pro|*óinos|ine=x}}. ==== {{adjetivo cardinal|es}} ==== {{es.adj|s}} {{tabla-cardinal|1|ord=primero|noprev=x|nsig=2|r=I|sig=dos}} ;1 {{csem|números}}: La cantidad de una cosa solitaria (a saber, sin otros). ==== {{sustantivo masculino|es}} ==== {{es.sust}} ;2: {{plm|primer}} [[número]] [[natural]], equivalente a la cantidad del [[conjunto]] no [[vacío]] más pequeño posible. ;3: {{plm|signo}} [[matemático]] que representa la [[unidad]]. {{ejemplo|en números romanos el número uno es representado por "I" y en números árabes por "1".}} ;4: Nombre del número '''1'''. ;5: Individuo. <ref>{{DRAE|uno}}</ref> ;6: Cierto juego de cartas en donde el objetivo es deshacerse de todas las cartas de la mano combinándolas con las cartas de la mesa. ==== {{adjetivo|es}} ==== {{es.adj}} ;7: Que no se encuentra [[dividido]] o [[separado]]. {{uso|Con este significado, no tiene plural}}. {{sinónimo|cabal|entero|indiviso|íntegro}}. ;8: Que no posee [[igual]]. {{sinónimo|único}}, sin [[par]] ;9: Que se identifica con otra persona o cosa en un plano espiritual, moral o que se siente físicamente unido. ;10: Que no posee diferencias con otra cosa. {{sinónimo|igual|idéntico}}. ;11: Usado con la palabra ''[[otro]]'', tiene valor distributivo. {{uso|distributivo|en correlación con {{l+|es|otro}} ({{l+|es|uno… otro}})}} {{ejemplo|el uno caminaba, el otro corría.}} ==== {{pronombre indefinido|es}} ==== {{es.adj}} ;12: Palabra que hace referencia a una persona de identidad desconocida, indefinida o irrelevante. {{ejemplo|uno sabe lo que debe hacer.}} ==== Locuciones ==== {{trad-arriba|Locuciones}} *[[a una]]: juntos, a un mismo tiempo *[[cada uno]]: todos, considerados individualmente. *[[decir unas veces cesta y otras ballesta]]: Contradecirse en unas y otras ocasiones. *[[del uno]]: excelente, de primera. (Chile, coloquial) *[[de so uno]]: unidamente (Anticuado) *[[de una]]: ::De golpe, con un solo esfuerzo o intento. ::De forma definitiva. ::Resueltamente, con decisión. *[[de una en una]]: considerando las personas o cosas individualmente, separadamente. *[[de una vez]]: ::De golpe, con un solo esfuerzo o intento. ::De forma definitiva. ::Resueltamente, con decisión. ::Excelente, de primera (España, coloquial) ::De inmediato (República Dominicana) *[[de una vez para siempre]]: de forma definitiva. *[[en uno]]: ::En conjunto ::De común acuerdo, unidamente. *[[la una]]: la primera hora después del mediodía y la primera después de la medianoche. *[[lo uno por lo otro]]: en compensación. *[[más de uno]]: varios. *[[no acertar una]]: fallar en todos los intentos, equivocarse mucho. *[[no achuntarle a una]]: fallar en todos los intentos, equivocarse mucho. (Chile, coloquial) *[[no dar una]]: fallar en todos los intentos, equivocarse mucho. *[[número uno]]: el mejor en una disciplina, deporte u otra actividad. *[[para en uno]]: para estar satisfechos y unidos en la vida (España) *[[para en uno son los dos]]: expresión de parabienes a los novios. (España) *[[ser todo uno]]: ::Ocurrir varias cosas en una secuencia que parece simultánea o una sola. ::Ser varias cosas un resultado forzoso o consecuencia unas de otras. *[[ser uno]]: ser todo uno. *[[una de]] + sustantivo: gran cantidad de. *[[una de dos]]: expresa una disyuntiva. Se usa en expresiones de advertencia o amenaza principalmente. *[[una de las suyas]]: se dice de lo típico de alguien. *[[una no es ninguna]]: no basta con una. *[[una por una]]: efectivamente. *[[una que]]: siendo así que, suponiendo que. *[[una que otra vez]]: rara vez. *escribir [[unas letras]]: escribir unas pocas palabras, una carta o escrito breve. *[[una vez que otra]]: rara vez. *[[una y no más]]: expresión de haber escarmentado *[[uno a otro]] (otra): De forma recíproca. *[[uno con otro]] (otra): En conjunto se compensan defectos y virtudes, ventajas y desventajas. *[[uno a uno]]: Considerando las personas o cosas individualmente, separadamente. *[[uno de tantos]]: Que no se destaca. *[[uno no es ninguno]] *[[uno por uno]]: Considerando las personas o cosas individualmente, separadamente. *[[uno que otro]] (o una que otra): Algunos. *[[unos cuantos]] (o unas cuantas): Un número pequeño de ellos. *[[uno tras otro]] (o una tras otra): De forma sucesiva. *[[uno y otro]] (uno y otra, una y otra): Los dos, [[ambos]]. {{trad-abajo}} ====Véase también==== {{w}} * [[un]] ====Información adicional==== *Delante de un sustantivo masculino singular, se usa el apócope [[un]]. ====Traducciones==== {{trad-arriba}} {{t|ay|t1=maya}} {{t|de|a1=1-4|t1=ein}} {{t|ar|t1=واحد}} {{t|br|a1=1|t1=unan}} {{t|bg|t1=един|g1=m}} {{t|cak|a1=1|t1=jun}} {{t|ca|t1=un}} {{t|cs|a1=1-3|t1=jeden|a2=10,11|t2=kterýsi|a3=12|t3=někdo|a4=11,12|t4=kdterýkoli|a5=11,12|t5=kdokoli|a6=11,12|t6=několik|a7=11,12|t7=pár|a8=11,12|t8=trochu|a9=11|t9=asi|a10=9|t10=navzájem|t11=sám|t12=sebe}} {{t|ctu|t1=jump'ej}} {{t|sh|a1=1|t1=jedan}} {{t|dv|t1=ekeh}} {{t|eo|a1=1-4,11|t1=unu|a2=5|t2=iu|a3=13|t3=kelkaj|a4=14|t4=oni}} {{t|eu|t1=bat}} {{t|fi|t1=yksi}} {{t|fr|a1=1,3|t1=un|a2=5|t2=on}} {{t|ha|t1=ɗaya}} {{t|io|t1=un}} {{t|en|a1=1-4,14|t1=one|a2=13|t2=some}} {{t|ga|a1=1-3,10,11|t1=aon|a2=1|t2=amháin|a3=4|t3=duine|a4=4|t4=ceann}} {{t|it|t1=uno}} {{t|ja|t1=一|t2=いち|t3=ひとつ|t4=ichi|t5=hitotsu}} {{t|ku|t1=yek}} {{t|zh|a1=1,3|t1=一|t2=壹}} {{t|arn|t1=kiñe}} {{t|yua|t1=jun}} {{t|mit|t1=ɨɨn}} {{t|mn|t1=нэг}} {{t|nhn|a1=1|t1=ce|nota1=Amecameca, Cholula y Milpa Alta|t2=ze|nota2=Texcoco|t3=se|nota3=Tlaxcala}} {{t|nci|a1=1|t1=ce|nota1=normalizado}} {{t|ngu|t1=se}} {{t|nch|t1=se}} {{t|nhw|t1=se}} {{t|nhe|t1=se}} {{t|ncl|t1=se}} {{t|nhm|t1=se}} {{t|nlv|t1=se}} {{t|nhp|a1=1|t1=se}} {{t|nhc|t1=se}} {{t|ncj|a1=1|t1=se|nota1=Acaxochitlán}} {{t|nv|t1=láá'ii}} {{t|nl|t1=een}} {{t|nb|t1=én}} {{t|nn|t1=ein}} {{t|ryu|a1=1|t1=一|a2=1|t2=いち|a3=1|t3=てぃー|a4=1|t4=ちゅー}} {{t|fa|t1=یک}} {{t|ppl|t1=se}} {{t|pt|t1=uno}} {{t|quz|t1=huk}} {{t|qwh|t1=huk}} {{t|rhg|t1=ek}} {{t|ru|a1=1-4|t1=один}} {{t|sa|i1=s|t1=एक}} {{t|tl|t1=isa}} {{t|crh|t1=bir}} {{t|yag|a1=1,2|t1=okóle}} {{trad-abajo}} === Forma flexiva === ==== Forma verbal ==== ;1: {{f.v|unir|p=1s|t=pres|m=ind}}. == {{lengua|ast}} == {{pron-graf|leng=ast}} === Forma flexiva === ==== Forma adjetiva ==== ;1: {{f.adj2|leng=ast|un|n|s}}. == {{lengua|osp}} == {{pron-graf|leng=osp}} === Etimología 1 === {{etimología|leng=osp|la|unus|alt=ūnum|uno}}, y este {{etim|leng=osp|itc-ola|oinos|glosa=uno}}, {{etim|leng=osp|itc-pro|*oinos}}, {{etim|leng=osp|ine-pro|*óynos|ine=x}}. Compárese el galaicoportugués {{l+|roa-opt|ũu}} y el italiano antiguo {{l+|roa-oit|uno}}. ==== {{adjetivo cardinal|osp}} ==== ;1 {{csem|números|leng=osp}}: {{plm}}. == {{lengua|it}} == {{swadesh|it}} {{pron-graf|leng=it|1audio1=it-uno.ogg}} === Etimología 1 === {{etimología|leng=it|roa-oit|uno|uno}}, y este {{etim|leng=it|la|unus|alt=ūnum|glosa=uno}}, {{etim|leng=it|itc-ola|oinos|glosa=uno}}, {{etim|leng=it|itc-pro|*oino-}}, {{etim|leng=it|ine-pro|*óynos|ine=x}}. ==== {{adjetivo cardinal|it}} ==== {{it.adj|s}} ;1 {{csem|números|leng=it}}: {{ucf}}. {{relacionado|leng=it|primo|singolo}}. ==== {{artículo|it|indefinido}} ==== {{it.adj}} ;2: {{impropia|Forma de}} {{l|it|un}} ''antes de "s impura" (la que va seguida de consonante).''. ==== {{pronombre indefinido|it}} ==== {{it.adj}} ;3: {{ucf}} ''(referencia a persona de identidad desconocida, indefinida o irrelevante)''. ==== Véase también ==== {{w|leng=it}} == {{lengua|roa-oit}} == {{pron-graf|leng=roa-oit}} === Etimología 1 === {{etimología|leng=roa-oit|la|unus|alt=ūnum|uno}}, y este {{etim|leng=roa-oit|itc-ola|oinos|glosa=uno}}, {{etim|leng=roa-oit|itc-pro|*oino-}}, {{etim|leng=roa-oit|ine-pro|*óynos|ine=x}}. Compárese el castellano antiguo {{l+|osp|uno}} y el italiano antiguo {{l+|roa-oit|uno}}. ==== {{adjetivo cardinal|roa-oit}} ==== ;1 {{csem|números|leng=roa-oit}}: {{plm}}. == {{lengua|lad}} == {{pron-graf|leng=lad|g1=אונו}} === Etimología 1 === {{etimología|leng=lad|osp|uno|uno}}, y este {{etim|leng=lad|la|unus|alt=ūnum|glosa=uno}}, {{etim|leng=lad|itc-ola|oinos|glosa=uno}}, {{etim|leng=lad|itc-pro|*oino-}}, {{etim|leng=lad|ine-pro|*Hoi-no-|ine=x}}. ==== {{adjetivo cardinal|lad}} ==== ;1 {{csem|números|leng=lad}}: {{plm}}. == {{lengua|la}} == {{pron-graf|leng=la|ayuda1=ūnō}} === Forma flexiva === ==== Forma adjetiva ==== ;1: {{forma adjetivo|leng=la|unus|ablativo|singular|masculino}}. ;2: {{forma adjetivo|leng=la|unus|ablativo|singular|neutro}}. == {{lengua|roa-oan}} == {{pron-graf|leng=roa-oan}} === Etimología 1 === {{etimología|leng=roa-oan|la|unus|alt=ūnum|uno}}, y este {{etim|leng=roa-oan|itc-ola|oinos|glosa=uno}}, {{etim|leng=roa-oan|itc-pro|*oino-}}, {{etim|leng=roa-oan|ine-pro|*Hoi-no-|ine=x}}. ==== {{adjetivo cardinal|roa-oan}} ==== ;1 {{csem|números|leng=roa-oan}}: {{plm}}. == {{lengua|pt}} == {{pron-graf|leng=pt|2audio=LL-Q5146 (por)-Santamarcanda-uno.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-uno.wav}} === Etimología 1 === {{etimología|leng=pt}}. ==== {{adjetivo|pt}} ==== {{pt.adj}} ;1: {{plm|único}}. {{sinónimo|leng=pt|único}}. === Forma flexiva === ==== Forma verbal ==== ;1: {{f.v|leng=pt|unir|1s|pres|ind|pron=eu}}. == {{lengua|vec}} == {{pron-graf|leng=vec}} === Etimología 1 === {{etimología|leng=vec|la|unus|alt=ūnum|uno}}, y este {{etim|leng=vec|itc-ola|oinos|glosa=uno}}, {{etim|leng=vec|itc-pro|*oino-}}, {{etim|leng=vec|ine-pro|*Hoi-no-|ine=x}}. ==== {{adjetivo cardinal|vec}} ==== ;1 {{csem|números|leng=vec}}: {{plm}}. == Referencias y notas == <references /> 2g1pdi9jh0n9eqajus389cj6enjgmpl Wikcionario:Café 4 1313 6076618 6076456 2026-04-04T23:32:26Z MABot 70592 Bot: archivo de 2 hilos (con una antigüedad de 30 días) en [[Wikcionario:Café/2026 03]] 6076618 wikitext text/x-wiki <!-- Inicio Encabezado del café, aviso, información histórica y información de archivado --> <div style="text-align: center;"> {{/Aviso}} {{/Histórico}} </div> {{atajo|WN:C}} [[Categoría:Café]] <!-- Fin del Encabezado del café --> <!-- Inicio configuración robot archivado; no tocar si no se sabe lo que se hace --> {{Usuario:MABot/config |archive = Wikcionario:Café/%(year)d %(month)02d |algo = old(30d) |counter = 1 |archiveheader = {{Archivo}} }} <h1>{{MONTHNAME|{{PREVIOUSMONTH}}}} de {{PREVIOUSMONTH.YEAR}}</h1> <div class="mw-archivedtalk"> {{/{{PREVIOUSMONTH.YEAR}} {{PREVIOUSMONTH}}}} </div> <h1>Actual</h1> == Revalidación de la administradora Lourdes Cardenal == Buenas! No me gusta ―y creo que a nadie le gusta― ser quien rompa el hielo con estos asuntos, pero por el bien del proyecto tengo el deber de hacerlo. Meta está en época de revalidación de sysops, y en su momento se decidió suscribir a la política global ―que ya dije que es un error, que deberíamos tener la nuestra―. Así que nos llega ahora una notificación con los supuestos administradores inactivos (lo pueden ver en el hilo anterior). Pensé que iban a aparecer más en la lista. Pero no ocurrió, así que nos damos cuenta que por eso nosotros mismos deberíamos revalidar a nuestros administradores en lugar de delegar el proceso a terceros que desconocen completamente la situación del proyecto. En este caso, debido a que: * La usuaria estuvo prácticamente contribuyendo muy poco después de 2014, cayendo en inactividad total en 2018 * Tras una notificación que le envían en 2021 (supuestamente errónea según el concepto que Meta toma por inactividad), recién aquí, oh casualidad! la usuaria se acuerda de que el proyecto existe y hace un par de contribuciones por un año aproximadamente * Para volver a caer en inactividad en 2022 y con ausencia definitiva en junio de 2023. * Luego, envía un mensaje a finales del año pasado, no se si bienintencionada o malintencionadamente, pero lo cierto es que increíblemente bastó para eludir los controles de Meta. * Y, al margen de si a la usuaria solo le "interesa" el proyecto justo cuando sabe que está a punto de perder sus "privilegios", así y todo no veo por qué la necesitaríamos como administradora. Estuve revisando y corrigiendo varias de sus contribuciones y mi evaluación es que nunca terminó de agarrar del todo el formato de las entradas. Confiesa además que no es buena para los asuntos técnicos, pero tampoco veo grandes hazañas en lo "no técnico". No me malinterpreten: sí hubo épocas en donde combatió al vandalismo, pero eso no necesariamente está relacionado con administrar, existe un flag de reversor. * Y por si fuera poco, [[w:Special:Diff/171056375|ya ha confesado que quiere abandonar el puesto]], pero le pidieron que "se quedara para combatir el vandalismo". Quién le dijo eso? Además, si pasa por ahí, nuevamente para eso está el flag de reversora. Le pido a @[[Usuario:Lourdes Cardenal|Lourdes Cardenal]] que renuncie. Si damos los controles de administrador a alguien, es para que '''administre''', no para que solamente ostente la placa en su PU. Y por las dudas: si alguien me salta ahora con que "es efectivo mantenerla como administradora, porque entonces podemos recordarle esto y amenazarla con quitarle los botones cada dos años, para que así vuelva a contribuir, y que es mejor eso a que abandone el sitio de una vez y para siempre", me permito decir que aquí no se trabaja a punta de pistola. Si quiere contribuir, que lo haga como una usuaria normal, con lo que pueda, cuando pueda y como pueda; no necesita mantener el rol de administradora para eso. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 05:17 15 feb 2026 (UTC) :Hola. Creo que le sobran algunas partes a tu mensaje. Veo de otra forma los permisos de administrador. Creo que todo usuario que dé muestras de entender y respetar las políticas del proyecto y de tener buen criterio al editar debería ser administrador y que como los permisos no ocupan espacio ni hay un número limitado, no importa que no se usen todos los días o todos los meses. Sin ánimo de atacarte, solo para marcar un contraste, tú sabes enormemente más de cosas técnicas y haces muchas ediciones válidas, pero fallas mucho en el trato y por eso no votaría tranquilo por ti; en cambio [[Usuaria:Lourdes Cardenal|Lourdes Cardenal]] puede no tener mucha idea de lo técnico y no hacer muchas acciones, pero me da la impresión de que ha errado rara vez en sus acciones administrativas en este proyecto y por eso la revalidaría si quiere seguir contando con esa herramienta. Saludos. [[Usuario:Lin linao|Lin linao]] [[Usuario Discusión:Lin linao|¿dime?]] 01:24 18 feb 2026 (UTC) ::Ese es el problema: varias políticas cambiaron y no sabemos cuáles muestras dio o va a dar de haberlas entendido. Ya ocurrió que un bibliotecario volvió completamente fuera de sintonía y sus actos rozaron el sabotaje. Por qué no ocurriría con el resto de los bibliotecarios? Si fuese como vos decís, que los pierdan y que empiecen de cero. Y si resultan ser tan buenos usuarios, que se vuelvan a postular y que los obtengan de nuevo. Total, la experiencia no la pierden así que de todas formas ya juegan con ventaja. Por qué no aceptar el desafío? [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 05:47 18 feb 2026 (UTC) ::Y los permisos sí ocupan espacio. Que después el sistema permita infinitos administradores en una wiki es otra cosa. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 06:18 18 feb 2026 (UTC) :Bueno, ya pasó una semana y me resulta muy raro que, siendo administradora, a esta altura todavía no haya contestado ni manifestado su opinión. Puesto que el resto tampoco opina nada, entiendo que están todos de acuerdo con mi propuesta y que efectivamente Lourdes mantendrá su decisión que le había manifestado a Taichi en Wikipedia. Esperaré 48 horas y luego presentaré este caso en Meta para que lo analicen y tomen allí una decisión al respecto. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 04:51 22 feb 2026 (UTC) ::Hola, @[[Usuario:Tmagc|Tmagc]]. Deberías escribir a Lourdes directamente en eswiki, donde sigue activa. En Meta te van a decir que primero hay que consensuar una política local, lo cual se debería discutir y votar en otro hilo. Dicho esto, prefiero que Lourdes mantenga sus permisos dado el escaso número de administradores activos. [[Usuario:Peter Bowman|Peter Bowman]] ([[Usuario discusión:Peter Bowman|discusión]]) 11:01 22 feb 2026 (UTC) :::@[[Usuario:Peter Bowman|Peter Bowman]] Si el problema es la falta de administradores activos, de qué forma nos beneficia tener administradores ''prolongadamente inactivos'' ? [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 14:09 22 feb 2026 (UTC) ::::@[[Usuario:Tmagc|Tmagc]]: beneficia tener a alguien "en la reserva", que siga en activo aunque sea en otro proyecto, y que pueda responder ante emergencias. Dicho esto, rectifico porque acabo de acordarme de que esta wiki permite la intervención de admins globales precisamente para este fin. Mantengo lo de avisar a Lourdes a través de eswiki. [[Usuario:Peter Bowman|Peter Bowman]] ([[Usuario discusión:Peter Bowman|discusión]]) 15:06 22 feb 2026 (UTC) :::::@[[Usuario:Peter Bowman|Peter Bowman]] Pero de qué hipotética emergencia estamos hablando? Repito: ya pasó '''una semana''' y todavía no ha respondido a mi propuesta. Si en todo este tiempo no intervinió, qué debemos de esperar cuando ''realmente'' la necesitemos? [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 15:17 22 feb 2026 (UTC) :@[[Usuario:Tmagc|Tmagc]], uno de los principios fundamentales de los wikis es presumir la buena fe. Que un usuario haga una contribución cada dos años no es un problema. Pero acusar, asumir malas intenciones y hostigar o maltratar a otros colaboradores, me parece lamentable, lo que dices puede tener cierto fundamento pero podemos invitar en lugar acusar, la amabilidad no cuesta. @[[Usuario:Lourdes Cardenal|Lourdes Cardenal]] tiene todo mi respeto como usuario y como administradora, espero que vuelva pronto. [[Usuario:Cvmontuy|Cvmontuy ]] [[Usuario_Discusi%C3%B3n:Cvmontuy|<sup>(mensajes)</sup>]] 13:08 9 mar 2026 (UTC) ::Gracias, [[Usuario:Cvmontuy|Cvmontuy]], acabo de ver tu contribución y no quiero pasarla por alto. Espero que nos veremos por estos pagos, como antes. [[Usuario:Lourdes Cardenal|Lourdes Cardenal]] ([[Usuario discusión:Lourdes Cardenal|discusión]]) 19:15 10 mar 2026 (UTC) Buenas tardes compañeros. Acudo a esta cita gracias al aviso directo de un buen colega; confieso y reconozco que no me había enterado. Reconozco también mis fallos y habría agradecido a [[Usuario:Tmagc|Tmagc]] que se hubiera dirigido directamente a mí en eswiki (veo que lo ha hecho hoy a las 15:20) con razonamientos de peso como es el caso de mi inactividad; con eso basta, es suficientemente importante para dejar los botones y no veo necesario buscar otros argumentos que se sostienen mal. Me parece de mal gusto esta frase "Luego, envía un mensaje a finales del año pasado, no se si bienintencionada o malintencionadamente, pero lo cierto es que increíblemente bastó para eludir los controles de Meta", y te aseguro Tmagc que la palabra " malintencionadamente" sobra. Y también te aseguro (porque se ve que no me conoces) que en el pasado trabajé mucho y lo hice bien ampliando el vocabulario de este diccionario. Y también te aseguro que nunca pensé que lo de ser administradora tuviera privilegios para agarrarme a ellos, tal y como dices. También vuelvo a decir que reconozco mi dejadez y que tendría que haber acudido a Meta para pedir "la baja". Por otra parte agradezco a [[Usuario:Lin linao|Lin linao]] y a [[Usuario:Peter Bowman|Peter Bowman]] sus palabras; ellos me conocen de antiguo, juntos hemos combatido vandalismo, hemos aportado ayudas y opiniones y hemos enriquecido el wictionario y nos hemos ayudado mutuamente. Y termino con unas palabras dirigidas directamente a [[Usuario:Tmagc|Tmagc]]: es necesario y es importante que los administradores mantengan la calma y guarden la agresividad en el armario, sin ofender, sin herir. Saludos [[Usuario:Lourdes Cardenal|Lourdes Cardenal]] ([[Usuario discusión:Lourdes Cardenal|discusión]]) 16:57 22 feb 2026 (UTC) :@[[Usuario:Lourdes Cardenal|Lourdes Cardenal]] Pido disculpas si sonó mal como lo dije; tampoco me parece fácil romper el hielo con estas cosas, pero desde hace tiempo siento que tengo que hacerlo. Estoy seguro de que contribuiste al proyecto en su momento y no tengo nada personal contra vos. Lo mío lo considero una medida de seguridad porque la experiencia ha demostrado que los administradores inactivos sí pueden hacer daño. Y mientras sobren administradores, no habrá incentivos para salir a buscar nuevas personas que quieran administrar ''en este proyecto''. En el mismo sentido, considero que se juzga mal la calidad de los administradores aquí, pero eso es para discutirlo en otro hilo. Gracias por tus años de servicio y cuando quieras volver a contribuir, aquí te estaré esperando. En breve abriré un pedido en Meta para que te quiten los controles. Saludos. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 22:39 22 feb 2026 (UTC) :Ya he renunciado '''voluntariamente'''. Gracias [[Usuario:Peter Bowman|Peter]], gracias [[Usuario:Lin linao|Lin]] por vuestro apoyo. Os deseo lo mejor, [[Usuario:Lourdes Cardenal|Lourdes Cardenal]] ([[Usuario discusión:Lourdes Cardenal|discusión]]) 19:00 23 feb 2026 (UTC) ::¡Muchas gracias a ti, @[[Usuario:Lourdes Cardenal|Lourdes]]! Espero que nos sigamos viendo por aquí :). [[Usuario:Peter Bowman|Peter Bowman]] ([[Usuario discusión:Peter Bowman|discusión]]) 19:40 23 feb 2026 (UTC) == Reestructuración de los espacios Categoría, Wikcionario, Apéndice, Ayuda == Aparte de otras categorías obsoletas que pronto serán eliminadas para que no causen más problemas, modifíquese lo siguiente: * Eliminar el prefijo "Wikcionario:" de todas las categorías y moverlas a donde corresponda. La mayoría de lo que tenemos debe ir en [[:Categoría:Mantenimiento]]. * Eliminar todas las redirecciones salvo siglas y atajos. * Sacar afuera del espacio de Wikcionario todas las páginas que sean posibles. Evitar dicha denominación por ambigua e imprecisa. * Reemplazar la notación "/(idioma)" por ":XX", siguiendo el modelo actual de las categorías. * Eliminar [[:Categoría:Wikcionario:Apéndices]] y similares. Es absurdo e innecesario categorizar todas las páginas de un espacio. * Trasladar [[Wikcionario:Índice]] y todas sus subpáginas a [[Apéndice:XX:Lemario]], donde XX es el código de idioma. El motivo de no eliminarlos es que todavía estamos verdes y eventualmente nos servirán para expandir nuestra base de datos. Unifíquense todas las páginas de propósito similar pero de otras denominaciones en [[Apéndice:XX:Lemario]]. Si es necesario mantener varios lemarios provenientes de distintas bases de datos, propongo [[Apéndice:XX:Lemario1]], [[Apéndice:XX:Lemario2]], etc. * Trasladar Wikcionario:Frecuencias/(nombre) a Apéndice:XX:Frecuencias.* * Trasladar [[Wikcionario:Referencia/XX]] a [[Apéndice:XX:Referencia]] o a Referencia:XX (nuevo espacio a abrir). * Trasladar Wikcionario:Cómo.* a Ayuda:Cómo.* * Eliminar Wikcionario:.*/Tesauro, redirecciones innecesarias. * Eliminar Apéndice:Páginas requeridas.* y Apéndice:Secciones de páginas requeridas.* * Eliminar Wikcionario:Babel.*, pero no [[Wikcionario:Babel]] (quizá trasladarlo a Ayuda:Babel). Obsoleto tras implementación de [[Módulo:babel]] Si confían en mi criterio, entonces puedo hacer todo yo solo si me convierten a mí y a mi bot en administradores temporales (90 días). En tal caso, prometo no usar los controles para otra cosa que no sea eliminar y trasladar páginas de estos espacios y verificaré que no queden más páginas apuntando primero. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 21:00 7 mar 2026 (UTC) :Hola, @[[Usuario:Tmagc|Tmagc]]. Aunque no me parece mala idea, la asignación de permisos elevados con carácter temporal no es algo que se haya hecho aquí antes. Solo lo he visto en proyectos pequeños donde no hay burócratas, y son stewards de Meta quienes atienden estas peticiones. Como ya he empezado con este proceso ([[User talk:Peter Bowman#Terminar de arreglar el árbol de categorías]]), prefiero llevarlo hasta el final. Por otro lado, hay varios puntos que me gustaría tratar con calma, uno a uno. Por ejemplo, las redirecciones afuera del espacio principal pueden ser útiles si hay muchas webs (incluyendo Google) que aún dirijan a ellas. Propongo ir abordando los elementos de la lista uno a la vez. Por último, con tu bot puedes trasladar páginas sin dejar redirecciones detrás, lo cual creo que reduce la necesidad de emplear permisos especiales. Un saludo, [[Usuario:Peter Bowman|Peter Bowman]] ([[Usuario discusión:Peter Bowman|discusión]]) 18:33 8 mar 2026 (UTC) ::@[[Usuario:Peter Bowman|Peter Bowman]] Si doce hilos quieres tú que cree, doce hilos abriré. Pero una última observación antes de acabar esta discusión: esas supuestas indexaciones de Google poca diferencia van a hacer a esta altura. Al ritmo que viene decayendo la actividad aquí, notando la poca cantidad de usuarios nuevos que reciben por año (con suerte uno) y la poca cantidad de ediciones que hay por día,. Y si en venite años no logramos otra cosa más que ir perdiendo uno por uno a todos los usuarios activos que quedaban, yo, como fresco y visionario que soy les aviso que cuanto más caótica sea la estructura del sitio en general, menos usuarios nuevos van a querer participar. Estuve leyendo algunas páginas, sobre todo comparando los "tutoriales" con [[WN:ES]] y encontré algunas cuantas contradicciones. Las arreglaría pero parecen tan anacrónicas todas esas páginas que dudo en varias respecto de si '''hoy''' mismo tendrían cabida. Decidan con inteligencia y sabiduría el futuro del proyecto. Nos vemos en las próximas discusiones. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 05:42 10 mar 2026 (UTC) :::@[[Usuario:Tmagc|Tmagc]]: quiero que dejemos constancia de las decisiones tomadas en este proyecto, así que sí, crea doce hilos si hace falta, o uno largo si así es más cómodo. No sé qué tienen que ver las redirecciones con la estructura y el comentario acerca del número de usuarios activos. [[Usuario:Peter Bowman|Peter Bowman]] ([[Usuario discusión:Peter Bowman|discusión]]) 09:51 10 mar 2026 (UTC) :Concuerdo con el comentario anterior. Saludos. [[Usuario:Lin linao|Lin linao]] [[Usuario Discusión:Lin linao|¿dime?]] 20:13 8 mar 2026 (UTC) == Noticias técnicas: 2026-11 == <section begin="technews-2026-W11"/><div class="plainlinks"> Las últimas '''[[m:Special:MyLanguage/Tech/News|noticias técnicas]]''' desde la comunidad técnica de Wikimedia. Por favor, comenta estos cambios con otros usuarios. No todos los cambios te afectarán. [[m:Special:MyLanguage/Tech/News/2026/11|Traducciones en varios idiomas]] están disponibles. '''Lo más destacado de la semana''' * [[m:Special:MyLanguage/Tech/Server switch|Todas las wikis estarán en modo de solo lectura]] durante unos minutos el 25 de marzo de 2026 a las [https://zonestamp.toolforge.org/1774450800 15:00 UTC]. Esto se debe a las pruebas de cambio al centro de datos de respaldo, [[wikitech:Deployments/Yearly calendar|que se realizan dos veces al año]]. Durante este proceso, todo el tráfico de los sitios de Wikimedia se desvía de un centro de datos primario al de respaldo para probar la disponibilidad y prevenir interrupciones del servicio incluso en situaciones de emergencia. * La semana pasada, todas las wikis experimentaron un periodo de 2 horas en modo de solo lectura y la desactivación de scripts de usuario y accesorios. Esto se debió a un incidente de seguridad que ya ha sido resuelto. Se está trabajando para evitar que esto vuelva a ocurrir. Para obtener información actualizada, puedes revisar el [[m:Steward's noticeboard#Statement on Meta about today's user script security incident|mensaje en el boletín de Stewards]] ([[m:Special:MyLanguage/Wikimedia Foundation/Product and Technology/Product Safety and Integrity/March 2026 User Script Incident|traducciones]]). '''Actualizaciones para editores''' * Los usuarios que sufran múltiples bloqueos en la versión móvil podrán ver los motivos de cada bloqueo por separado, en lugar de un mensaje genérico. Esto les ayudará a entender por qué están bloqueados y qué pasos deben seguir para resolverlo. Por ejemplo, los usuarios afectados por el uso de VPN comunes (como [[Special:MyLanguage/Apple iCloud Private Relay|iCloud Private Relay]]) recibirán instrucciones más claras sobre lo que deben hacer para seguir editando. [https://phabricator.wikimedia.org/T357118] * Durante esta semana, el [[mw:Special:MyLanguage/VisualEditor/Suggestion Mode|Modo de sugerencia]] estará disponible como función beta en el editor visual de todas las Wikipedias. Esta función sugiere proactivamente diversos tipos de acciones que los usuarios pueden considerar para mejorar los artículos y, al mismo tiempo, conocer las convenciones locales. La función es configurable a nivel local y permite añadir sugerencias personalizadas. Los ajustes actuales se pueden consultar en [[Special:EditChecks]] y existen [[mw:Special:MyLanguage/Help:Suggestion mode#For administrators %E2%80%93 local customization|instrucciones para que los administradores puedan personalizar]] los enlaces a las guías locales. Esta característica está vinculada a la [[mw:Special:MyLanguage/Help:Edit check|comprobación de edición]], que sugiere mejoras mientras se redacta contenido nuevo. En el futuro, el equipo de Edición tiene previsto evaluar el impacto de esta función en los usuarios recién llegados mediante un experimento controlado. [https://phabricator.wikimedia.org/T404600] * [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Elemento recurrente]] Revisa las {{formatnum:23}} {{PLURAL:23|tarea enviada|tareas enviadas}} por la comunidad que fueron [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resueltas la semana pasada]]. Por ejemplo, se solucionó el problema por el cual el cursor se desalineaba al usar el resaltado de sintaxis de CodeMirror, permitiendo que el wikitexto y el código sean más fáciles de leer. Este error afectó específicamente a los usuarios que definieron una regla de fuente en una hoja de estilo personalizada al crear un nuevo tema con DiscussionTools. [https://phabricator.wikimedia.org/T418793] '''Actualizaciones para los colaboradores técnicos''' * Actualización de los límites de tasa de la API: Para ayudar a garantizar el [[mw:Special:MyLanguage/MediaWiki Product Insights/Responsible Reuse|uso justo de la infraestructura]], esta semana se aplicarán límites de tasa globales en las API a las solicitudes sin un User-Agent compatible que provengan de fuera de Toolforge/WMCS y a las solicitudes no autenticadas realizadas desde navegadores web. En abril se aplicarán límites más altos al tráfico identificado. Por ahora, los bots que se ejecutan en Toolforge/WMCS o que cuentan con el permiso de usuario de bot en cualquier wiki no deberían verse afectados. Sin embargo, se recomienda a todos los desarrolladores seguir las buenas prácticas actualizadas. Para obtener más información, consulta [[mw:Special:MyLanguage/Wikimedia APIs/Rate limits|API de Wikimedia/Límites de tasa]]. * Se ha lanzado la nueva API GraphQL. Esta API se ha desarrollado como una alternativa flexible a ciertas funciones del Wikidata Query Service (WDQS) para mejorar la experiencia de desarrollo y fomentar la adaptabilidad y el acceso eficiente a los datos. Puedes probarla y [[d:Wikidata:Wikibase GraphQL#Feedback and development|enviar tus comentarios]]. Además, puedes [https://greatquestion.co/wikimediadeutschland/GraphQLAPI/apply inscribirte en las pruebas de usabilidad]. * El [[m:Special:MyLanguage/Product and Technology Advisory Council/Unsupported Tools Working Group|Grupo de Trabajo de Herramientas sin Soporte]] ha continuado con las mejoras en [[commons:Special:MyLanguage/Commons:Video2commons#|Video2Commons]] durante febrero, con correcciones en la autenticación, la gestión de archivos grandes, la visibilidad de la cola de tareas y un comportamiento de carga mucho más claro. El trabajo continúa en diversas áreas, incluyendo cambios relacionados con los métodos de subida obsoletos. Lee [[m:Special:MyLanguage/Product and Technology Advisory Council/Unsupported Tools Working Group#February 2026|esta actualización]] para más detalles. * [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Elemento recurrente]] Actualizaciones detalladas de código de esta semana: [[mw:MediaWiki 1.46/wmf.19|MediaWiki]] '''A fondo''' * El equipo de Article Guidance invita a editores experimentados de Wikipedia de las [[mw:Special:MyLanguage/Article guidance/Pilot wikis and collaborators#Collaborators|wikis piloto]] y a editores interesados de otras Wikipedias a completar este cuestionario, que está disponible en [https://docs.google.com/forms/d/e/1FAIpQLSfmLeVWnxmsCbPoI_UF2jyRcn73WRGWCVPHzerXb4Cz97X_Ag/viewform inglés], [https://docs.google.com/forms/d/e/1FAIpQLSd6rzr4XXQw8r4024fE3geTPFe13M_6w7Mitj-YJi0sOlWTAw/viewform?usp=header árabe], [https://docs.google.com/forms/d/e/1FAIpQLSdok3-RfB18lcugYTUMGkpwmqG_8p760Wv4dCXitOXOszjUDw/viewform?usp=header bengalí], [https://docs.google.com/forms/d/e/1FAIpQLSfjTfYp4jEo0akA4B1e-Nfg3QZPCudUjhJzHzzDi6AHyAaMGA/viewform?usp=header japonés], [https://docs.google.com/forms/d/e/1FAIpQLScteVoI29Aue4xc72dekk-6RYtvmMgQxzMI900UOawrFrSTWg/viewform?usp=header portugués], [https://docs.google.com/forms/d/e/1FAIpQLSetdxnYwL3ub2vqA7awCg5hJZPMIYcDPaiTe12rY9h0GYnVlw/viewform?usp=header persa] y [https://docs.google.com/forms/d/e/1FAIpQLScNvfJF-Ot-4pzA4qAN771_0QDJ4Li19YcUsaTgSKW8Nc7U_Q/viewform?usp=header turco]. Sus respuestas ayudarán al equipo a personalizar la guía para editores menos experimentados y permitirán comprender mejor las políticas y prácticas de la comunidad al momento de crear un artículo. Lee más en [[mw:Special:MyLanguage/Article guidance|la página del proyecto]]. ''Las '''[[m:Special:MyLanguage/Tech/News|Noticias Técnicas]]''' son preparadas por [[m:Special:MyLanguage/Tech/News/Writers|los escritores de Noticias Técnicas]] y publicadas con un [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]]&nbsp;• [[m:Special:MyLanguage/Tech/News#contribute|Colabore]]&nbsp;• [[m:Special:MyLanguage/Tech/News/2026/11|traduzca]]&nbsp;• [[m:Tech|obtenga ayuda]]&nbsp;• [[m:Talk:Tech/News|denos su opinión]]&nbsp;• [[m:Global message delivery/Targets/Tech ambassadors|suscríbase o cancele su suscripción]].'' </div><section end="technews-2026-W11"/> <bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 18:53 9 mar 2026 (UTC) <!-- Mensaje enviado por Usuario:STei (WMF)@metawiki mediante la lista en https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=30213008 --> == Prefijo Wikcionario: en categorías == Empezamos tirando la primera piedra. La denominación "Wikcionario" es vacua, laxa, imprecisa y a esta altura se convirtió en un popurrí de categorías que, en lo que será la nueva estructura, la mayoría de ellas, o ha perdido su razón de ser, o caben perfectamente dentro de otras categorías más precisas. Propongo trasladar todas las páginas --con o sin redirecciones-- a sus nuevas versiones eliminando el prefijo. Esto por supuesto que hablando de categorías y subcategorías. En cuanto a las páginas del espacio de Wikcionario, a descategorizarlas. Como ya dije, no hay razón para categorizar todo un espacio porque sí. Hay miles de formas de listar las paginas de un espacio sin necesidad de meterlas a la fuerza en una categoría. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 05:53 10 mar 2026 (UTC) :Para que sepamos de qué estamos hablando y su alcance: [[Especial:PáginasPorPrefijo/Categoría:Wikcionario:]]. Me parece bien quitar ese prefijo, siempre me ha parecido que es redundante. En cuanto a descategorizar el espacio Wikcionario:, no. Si las categorías actualmente son un cajón de sastre, conviene poner orden, pero no me imagino que páginas importantes como [[WN:ES]] estén descategorizadas. [[Usuario:Peter Bowman|Peter Bowman]] ([[Usuario discusión:Peter Bowman|discusión]]) 09:59 10 mar 2026 (UTC) ::Pero justo eso se puede trasladar a [[:Categoría:Políticas]]. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 13:03 10 mar 2026 (UTC) :::Vale, no te estaba entendiendo entonces. Por lo que leo más abajo, solo quieres eliminar [[:Categoría:Wikcionario]] del árbol de categorías y distribuir mejor sus contenidos actuales. Contesto abajo. [[Usuario:Peter Bowman|Peter Bowman]] ([[Usuario discusión:Peter Bowman|discusión]]) 15:45 10 mar 2026 (UTC) :Las categorías sin prefijo son de contenido de diccionario (ej.: Política, Bebidas). Las categorías con prefijo son para el manejo del proyecto (ej.: Wikcionario:Políticas, Wikcionario:Café). Saludos. [[Usuario:Lin linao|Lin linao]] [[Usuario Discusión:Lin linao|¿dime?]] 13:20 10 mar 2026 (UTC) ::De todas formas sigue siendo innecesario agregar el prefijo en cada categoría y es posible categorizar todas esas categorías bajo una categoría común. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 14:13 10 mar 2026 (UTC) :Hola, ¿me puedes dar ejemplos con un "antes" y un "después"? — <span style="background:#7EE6CB;padding:1px 2px;border-radius:2px">[[User:Genoskill|<span style="font-weight:bold">Genoskill</span>]]</span> ([[User talk:Genoskill|discusión]]) 15:00 10 mar 2026 (UTC) ::@[[Usuario:Genoskill|Genoskill]] Antes (ahora): ::* Categoría:Wikcionario:Políticas -> Categoría:Wikcionario -> Categoría:Fundamental ::* Categoría:Wikcionario:Estructurar -> Categoría:Mantenimiento -> Categoría:Wikcionario -> Categoría:Fundamental ::* Categoría:Wikcionario:Apéndices -> Categoría:Wikcionario -> Categoría:Fundamental ::* Categoría:Wikcionario:Usuarios -> Categoría:Wikcionario -> Categoría:Fundamental ::* Categoría:Wikcionario:Políticas -> Categoría:Wikcionario -> Categoría:Fundamental ::* Categoría:Wikcionario:Votaciones -> Categoría:Wikcionario -> Categoría:Fundamental ::Después: ::* Categoría:Políticas -> Categoría:Fundamental ::* Categoría:Estructurar -> Categoría:Mantenimiento -> Categoría:Fundamental ::* Categoría:Wikcionario:Apéndices -> se destruye y descategorizan las páginas (a discutir en otro hilo) ::* Categoría:Usuarios -> Categoría:Fundamental ::* Categoría:Políticas -> Categoría:Fundamental ::* Categoría:Votaciones -> Categoría:Fundamental ::No te parece increíblemente farragosa la nomenclatura que tenemos? [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 15:33 10 mar 2026 (UTC) :::No digo que en su estado actual no sea farragoso, pero ¿tal vez tras reorganizarla resulte que nos viene bien disponer de dos niveles? Lo comento porque muchísimos proyectos se manejan (creo que bien) con esta jerarquía, entonces podrías ver si hay alguna idea que merezca replicar aquí: [[d:Q1281]], [[d:Q7482890]]. Si ahora borramos [[:Categoría:Wikcionario]], luego costará dar vuelta atrás. [[Usuario:Peter Bowman|Peter Bowman]] ([[Usuario discusión:Peter Bowman|discusión]]) 15:53 10 mar 2026 (UTC) ::::O sea, dejamos [[:Categoría:Wikcionario]]. La pregunta sería, si añadimos este nuevo subnivel en el árbol, qué debemos incluir. Solo lo administrativo, o también información que sirva para editores? De todas formas, eso no significa que no haya que borrar el prefijo del resto de categorías. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 16:00 10 mar 2026 (UTC) :::::Opino similar a Peter, no creo que debamos remover este segundo nivel. Me parece bien limitarlo a contenido administrativo, lo demás debería estar en otras categorías o en Fundamental. Y sí, el prefijo en las categorías sin duda no aporta nada y creo que debería irse. No estoy tan a favor de que "Categoría:Wikcionario:Apéndices" desaparezca, pero eso lo veremos después... [[Usuario:Raos10|Raos10]] ([[Usuario discusión:Raos10|discusión]]) 16:17 10 mar 2026 (UTC) :::::Nota al pie: los tesauros tienen que unificarse por palabra, y en cada idioma agregar la sección N2 con {{ep|lengua}}, y se categoriza en XX:Tesauros. Por lo que Categoría:Wikcionario:Wikisauro no tiene razón de ser. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 16:26 10 mar 2026 (UTC) :::::Y [[:Categoría:Usuarios autoverificados]] tiene que pasar a [[:Categoría:Usuarios autoverificados]], para que pueda categorizarse correctamente. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 16:30 10 mar 2026 (UTC) ::::Ante la falta de más opiniones, procedo a quitar el prefijo a todas las categorías salvo a la (sub)categoría base [[:Categoría:Wikcionario]]. El módulo se ocupará de organizar la jerarquía de todas las categorías. Saludos. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 03:07 12 mar 2026 (UTC) :::Listo. Para no generar de nuevo los enlaces en páginas requeridas, esta vez comenté los enlaces en los espacios de discusión. @[[Usuario:Peter Bowman|Peter Bowman]] podrías modificar [[Usuario:Peter Bowman/rc-speedy-deletion-watcher.js]], [[MediaWiki:Deletedtext]], [[MediaWiki:Recentchangestext]] ? [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 19:25 12 mar 2026 (UTC) ::::Hecho. [[Usuario:Peter Bowman|Peter Bowman]] ([[Usuario discusión:Peter Bowman|discusión]]) 23:13 12 mar 2026 (UTC) == [[Wikcionario:Índice]] == Cuál será el futuro de estas páginas? Mi propuesta es la que ya dije antes, convertirlas en lemarios, migrar todos los idiomas a Apéndice:XX:Lemario y fusionar en el caso del español. Significa también que todos los aṕendices que tenemos ahora hay que prefijarlos con ES: ? En efecto. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 21:13 14 mar 2026 (UTC) :Como no obtuve respuestas, @[[Usuario:Peter Bowman|Peter Bowman]] si hago este traslado deberíamos eliminar las páginas del índice? [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 20:48 27 mar 2026 (UTC) :Siendo honesto, creo que no debería existir un índice manual. Sería mucho mejor simplemente añadir un encabezado para filtrar por letra a "Categoría:Idioma"... Y sí, creo que los apéndices deberían tener separarse por idiomas así. Que exista "Categoría:Apéndices por idioma" en vez de "Categoría:Apéndices sobre otros idiomas". :Al igual que los índices, los apéndices de Antropónimos tampoco deberían existir, "Categoría:xx:Antropónimos xxx" los cubre perfectamente. [[Usuario:Raos10|Raos10]] ([[Usuario discusión:Raos10|discusión]]) 22:35 27 mar 2026 (UTC) :Nota: en ese sentido casi todos los apéndices pueden ser cubiertos por las entradas añadidas correctamente en el espacio principal más una categorización correcta. La pregunta es qué hacer mientras o hasta que se complete la migración de toda la información. Pero bueno, si un índice manual es innecesario, es razón suficiente para eliminarlo o convertirlo en lo que propuse. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 01:40 28 mar 2026 (UTC) ::@[[Usuario:Tmagc|Tmagc]]: entiendo que quieres renombrar todo lo de [[Especial:PáginasPorPrefijo/Wikcionario:Índice/]] para que empiece por Apéndice:XX:. Tampoco soy partidario de los índices manuales, pero tienen razón de ser si: 1. las entradas pertinentes aún no han sido creadas; 2. esos índices aportan algo más que una mera lista de palabras ([[Wikcionario:Índice/Por idioma/EU/A|aquí]] tenemos la traducción de cada término). Una vez hecho el traslado, ¿qué páginas querrías eliminar? [[Usuario:Peter Bowman|Peter Bowman]] ([[Usuario discusión:Peter Bowman|discusión]]) 09:37 28 mar 2026 (UTC) :::@[[Usuario:Peter Bowman|Peter Bowman]] Por eso dije que quería convertirlos en lemarios. Trasladarlos a Apéndice:XX:Lemario con un formato similar a [[Apéndice:Lemario]] y después borrar las redirecciones ya que no tiene sentido tener "índices". [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 14:25 28 mar 2026 (UTC) ::::Vale, y si automatizas la tarea, recuerda que puedes trasladar sin crear redirecciones. [[Usuario:Peter Bowman|Peter Bowman]] ([[Usuario discusión:Peter Bowman|discusión]]) 16:36 28 mar 2026 (UTC) :::::@[[Usuario:Peter Bowman|Peter Bowman]] Pero un formato similar a [[Apéndice:Lemario]] requeriría separarlas por lotes de a 500, por lo que probablemente muchas tendrán que ser borradas (no puedo trasladar de nuevo si ya existe la página de destino). Otra es formatearlo como Apéndice:XX:Lemario/A, Apéndice:XX:Lemario/B, etc. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 16:45 28 mar 2026 (UTC) ::::::@[[Usuario:Tmagc|Tmagc]]: no me molestaría en cambiar el formato, simplemente renombraría p. ej. [[Wikcionario:Índice/Por idioma/EN/D]] a [[Apéndice:EN:Lemario/D]] y ya está. [[Usuario:Peter Bowman|Peter Bowman]] ([[Usuario discusión:Peter Bowman|discusión]]) 16:57 28 mar 2026 (UTC) :::::::Por eso, pero en lugar de agruparlas de a 500 (como en [[Apéndice:ES:Lemario]]), simplemente las separo por la inicial, tal y como está ahora en el índice. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 16:59 28 mar 2026 (UTC) == Noticias técnicas: 2026-12 == <section begin="technews-2026-W12" /><div class="plainlinks"> Las últimas '''[[m:Special:MyLanguage/Tech/News|noticias técnicas]]''' desde la comunidad técnica de Wikimedia. Por favor, comenta estos cambios con otros usuarios. No todos los cambios te afectarán. [[m:Special:MyLanguage/Tech/News/2026/12|Traducciones en varios idiomas]] están disponibles. '''Actualizaciones para editores''' * La función beta [[mw:Special:MyLanguage/Help:Extension:CodeMirror|{{int:codemirror-beta-feature-title}}]], también conocida como [[mw:Special:MyLanguage/Extension:CodeMirror|CodeMirror 6]], se ha estado utilizando para el resaltado de sintaxis de wikitexto desde noviembre de 2024. Esta funcionalidad saldrá de su fase beta en mayo de 2026 con el fin de aportar mejoras y nuevas [[mw:Special:MyLanguage/Help:Extension:CodeMirror#Features|características]] a todos los editores que utilizan el resaltador de sintaxis estándar. Si tienes dudas o comentarios sobre la salida de esta función de su fase beta, [[mw:Special:MyLanguage/Help talk:Extension:CodeMirror|por favor compártelos]]. [https://phabricator.wikimedia.org/T259059] * Algunos cambios en los grupos de usuarios locales son realizados por administradores en Meta-Wiki y se registran solo allí. Ahora, los cambios de permisos entre varias wikis se registrarán tanto en Meta-Wiki como en la wiki de destino para facilitar el acceso a un registro completo de los cambios de los permisos del usuario en una wiki local. Las entradas anteriores del registro de dichos cambios se completarán durante las próximas semanas. [https://phabricator.wikimedia.org/T6055] * En las wikis que utilizan [[m:Special:MyLanguage/Flagged Revisions|Flagged Revisions]], el contador de cambios pendientes mostrado en [[{{#Special:PendingChanges}}]] incluía anteriormente páginas que ya no estaban pendientes de revisión debido a que habían sido eliminadas del sistema sin ser revisadas (por ejemplo, por haber sido borradas, trasladadas a otro espacio de nombres o por cambios en la configuración de la wiki). Ahora el conteo es correcto. En algunas wikis, el número mostrado será mucho menor que antes, pero no debería haber cambios en la lista de páginas en sí misma. [https://phabricator.wikimedia.org/T413016] * La composición del lenguaje de Wikifunciones fue reescrita, lo que dio lugar a una nueva versión. Este cambio apunta a aumentar la estabilidad del servicio al reducir el consumo de memoria del orquestador. Esta reescritura también reduce sustancialmente la latencia, simplifica el código y mejora las abstracciones, lo que abre la puerta a mejoras adicionales a futuro. Lee más acerca de [[f:Special:MyLanguage/Wikifunctions:Status updates/2026-03-11|este cambio]]. * Los usuarios ahora pueden ordenar los resultados de búsqueda por el título de la página. Esta actualización ofrece una opción adicional para encontrar páginas de forma más fácil y rápida. Anteriormente, los resultados podían ordenarse por fecha de edición, fecha de creación o relevancia. Para utilizar la nueva opción, abra la «Búsqueda avanzada» en la página de resultados y seleccione «Alfabéticamente» en el menú «Ordenar por». [https://phabricator.wikimedia.org/T403775] * [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Elemento recurrente]] Revisa las {{formatnum:28}} {{PLURAL:28|tarea enviada|tareas enviadas}} por la comunidad que fueron [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resueltas la semana pasada]]. Por ejemplo, se corrigió un error que impedía que UploadWizard en Wikimedia Commons importara archivos de Flickr. [https://phabricator.wikimedia.org/T419263] '''Actualizaciones para los colaboradores técnicos''' * Se ha creado una nueva página especial, [[{{#special:LintTemplateErrors}}]], para enumerar las páginas transcluidas que están marcadas como que contienen errores de lint para ayudar a los usuarios a descubrirlos fácilmente. La lista se clasifica según el número de transcluciones con errores. Por ejemplo: [[{{#special:LintTemplateErrors}}]]-Erros. [https://phabricator.wikimedia.org/T170874] * Los usuarios de la función beta [[mw:Special:MyLanguage/Help:Extension:CodeMirror|{{int:codemirror-beta-feature-title}}]] han estado utilizando, desde hace algún tiempo, [[mw:Special:MyLanguage/Extension:CodeMirror|CodeMirror]] en lugar de [[mw:Special:MyLanguage/Extension:CodeEditor|CodeEditor]] para el resaltado de sintaxis al editar páginas de contenido JavaScript, CSS, JSON, Vue y Lua. Junto con la salida de CodeMirror 6 de su fase beta, el plan es reemplazar CodeEditor como editor estándar para estos modelos de contenido a partir de mayo de 2026. [[mw:Special:MyLanguage/Help talk:Extension:CodeMirror|Sus comentarios y dudas son bienvenidos]]. [https://phabricator.wikimedia.org/T419332] * Los módulos JavaScript de [[mw:Special:MyLanguage/Extension:CodeMirror|CodeMirror]] se actualizarán próximamente a CodeMirror 6. Como preparación para esta actualización, la carga de los módulos <code dir=ltr>ext.CodeMirror</code> y <code dir=ltr>ext.CodeMirror.lib</code> desde accesorios y scripts de usuario quedó obsoleta en julio de 2025. El uso del hook <code dir=ltr>ext.CodeMirror.switch</code> también se marcó como obsoleto en marzo de 2025. Los colaboradores ya pueden desarrollar la compatibilidad de sus herramientas con CodeMirror 6. Consulte la [[mw:Special:MyLanguage/Extension:CodeMirror#Gadgets and user scripts|guía de migración]] para obtener más información. [https://phabricator.wikimedia.org/T373720] * El equipo de Interfaces de MediaWiki está ampliando la cobertura de las definiciones de los módulos de la API REST para incluir la [[mw:Special:MyLanguage/API:REST API/Extensions|API de extensiones]]. Los módulos de la API REST son grupos de puntos de conexión (''endpoints'') relacionados que pueden gestionarse y versionarse de forma independiente. Ya existen módulos para las API de [https://phabricator.wikimedia.org/T414470 GrowthExperiments] y [https://phabricator.wikimedia.org/T419053 Wikifunctions]. A medida que migremos las API de las extensiones a esta estructura, la documentación se trasladará fuera de la especificación principal de OpenAPI de MediaWiki y de la vista general de la zona de pruebas REST; en su lugar, se podrá acceder a ella a través de opciones específicas por módulo en el menú desplegable de la [https://test.wikipedia.org/wiki/Special:RestSandbox zona de pruebas REST] (por ejemplo, en la página especial [[{{#Special:RestSandbox}}]], disponible en todas las wikis). * La extensión [[mw:Special:MyLanguage/Extension:Scribunto|Scribunto]] proporciona diferentes datos sobre dónde se está utilizando un módulo a través de la biblioteca [[mw:Special:MyLanguage/Extension:Scribunto/Lua reference manual|mw.site]]. Desde la semana pasada, la biblioteca también ofrece una [[mw:Special:MyLanguage/Extension:Scribunto/Lua reference manual#mw.site.wikiId|forma]] de acceder al [[mw:Special:MyLanguage/Manual:Wiki ID|ID de la wiki]], que puede utilizarse para facilitar el mantenimiento del módulo en múltiples wikis. [https://phabricator.wikimedia.org/T146616] * [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Elemento recurrente]] Actualizaciones detalladas de código de esta semana: [[mw:MediaWiki 1.46/wmf.20|MediaWiki]] '''A fondo''' * ¡Ya se ha abierto el periodo de nominaciones para el premio [[m:Special:MyLanguage/Coolest Tool Award|Coolest Tool Award 2026]], que celebra las herramientas comunitarias más destacadas! Nomine su herramienta favorita mediante el [https://wikimediafoundation.limesurvey.net/435684?lang=en formulario de nominación] hasta el 23 de marzo de 2026. Para obtener más información sobre la privacidad y el tratamiento de datos, consulte la [[foundation:Special:MyLanguage/Legal:Coolest_Tool_Award_2026_Survey_Privacy_Statement|declaración de privacidad del formulario]]. ''Las '''[[m:Special:MyLanguage/Tech/News|Noticias Técnicas]]''' son preparadas por [[m:Special:MyLanguage/Tech/News/Writers|los escritores de Noticias Técnicas]] y publicadas con un [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]]&nbsp;• [[m:Special:MyLanguage/Tech/News#contribute|Colabore]]&nbsp;• [[m:Special:MyLanguage/Tech/News/2026/12|traduzca]]&nbsp;• [[m:Tech|obtenga ayuda]]&nbsp;• [[m:Talk:Tech/News|denos su opinión]]&nbsp;• [[m:Global message delivery/Targets/Tech ambassadors|suscríbase o cancele su suscripción]].'' </div><section end="technews-2026-W12" /> <bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 19:35 16 mar 2026 (UTC) <!-- Mensaje enviado por Usuario:STei (WMF)@metawiki mediante la lista en https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=30260505 --> == Noticias técnicas: 2026-13 == <section begin="technews-2026-W13" /><div class="plainlinks"> Las últimas '''[[m:Special:MyLanguage/Tech/News|noticias técnicas]]''' desde la comunidad técnica de Wikimedia. Por favor, comenta estos cambios con otros usuarios. No todos los cambios te afectarán. [[m:Special:MyLanguage/Tech/News/2026/13|Traducciones en varios idiomas]] están disponibles. '''Lo más destacado de la semana''' * Los usuarios de los sitios de Wikimedia ya pueden iniciar sesión sin contraseña utilizando llaves de acceso (''passkeys''). Este es un método seguro que admite el uso de huella digital, reconocimiento facial o código PIN. Con este cambio, todos los usuarios que opten por el inicio de sesión sin contraseña verán que es más fácil, rápido y seguro acceder a sus cuentas desde cualquier dispositivo. Actualmente, la nueva opción de inicio de sesión con llave de acceso aparece como una sugerencia de autorrelleno en el campo del nombre de usuario. Próximamente, estará disponible un [[phab:T417120|botón «Iniciar sesión con llave de acceso»]] adicional para los usuarios que ya hayan registrado una. Esta actualización mejorará la seguridad y la experiencia de usuario. La [[c:File:Passwordless_login_screencast.webm|grabación de pantalla]] muestra el proceso de inicio de sesión sin contraseña paso a paso. * [[m:Special:MyLanguage/Tech/Server switch|Todas las wikis estarán en modo de solo lectura]] durante unos minutos el 25 de marzo de 2026 a las [https://zonestamp.toolforge.org/1774450800 15:00 UTC]. Esto se debe a las pruebas de cambio al centro de datos de respaldo, [[wikitech:Deployments/Yearly calendar|que se realizan dos veces al año]]. Durante este proceso, todo el tráfico de los sitios de Wikimedia se desvía de un centro de datos primario al de respaldo para probar la disponibilidad y prevenir interrupciones del servicio incluso en situaciones de emergencia. '''Actualizaciones para editores''' * Los usuarios de los sitios de Wikimedia ya pueden exportar sus notificaciones con más de 5 años de antigüedad mediante una [[toolforge:echo-chamber|nueva herramienta en Toolforge]]. Esto permite que dichos usuarios conserven sus notificaciones importantes y eviten perderlas, de acuerdo con el cambio planificado que eliminará las notificaciones que superen los 5 años de antigüedad, tal como se anunció previamente. [https://phabricator.wikimedia.org/T383948] * Los editores de las Wikipedias en indonesio, tailandés, turco e inglés simple ya tienen acceso a Special:PersonalDashboard. Se trata de una [[mw:Special:MyLanguage/Moderator Tools/Dashboard|versión preliminar de una experiencia]] que introduce a los editores más nuevos en los flujos de trabajo de patrullaje, facilitándoles la transición desde la edición de contenidos hacia tareas de moderación más avanzadas en su proyecto. [https://phabricator.wikimedia.org/T402647] * La página [[Special:Block]] tiene dos cambios menores en la interfaz. Los administradores ahora pueden seleccionar un bloqueo por tiempo indefinido mediante un selector dedicado en la sección de caducidad. Además, al elegir un bloqueo infinito, se muestra una lista de motivos comunes en el menú desplegable, la cual puede personalizarse en [[MediaWiki:Ipbreason-indef-dropdown]]. [https://phabricator.wikimedia.org/T401823] * Los editores en entornos móviles de [[mw:Special:MyLanguage/Contributors/Account Creation Experiments#Logged-out|varias wikis]] ahora verán una advertencia mejorada al realizar ediciones sin haber iniciado sesión, gracias a las actualizaciones recientes del equipo de Growth. Estos cambios, lanzados la semana pasada, forman parte de los esfuerzos y pruebas para mejorar [[mw:Special:MyLanguage/Contributors/Account Creation Experiments|la experiencia de creación de cuentas en dispositivos móviles]] y fomentar la participación. [https://phabricator.wikimedia.org/T408484] * [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Elemento recurrente]] Revisa las {{formatnum:36}} {{PLURAL:36|tarea enviada|tareas enviadas}} por la comunidad que fueron [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resueltas la semana pasada]]. Por ejemplo, se ha solucionado el error que impedía que los usuarios de la versión web móvil vieran la información del bloqueo cuando estaban afectados por múltiples bloqueos. Ahora pueden consultar todos los bloqueos que les afectan al visitar Wikipedia. '''Actualizaciones para los colaboradores técnicos''' * Las imágenes creadas con Toolforge recibirán pronto una versión actualizada de los ''buildpacks'', que incluirá soporte para nuevas versiones de lenguajes de programación, además de otras mejoras y correcciones en el código fuente original (''upstream''). Si utiliza el servicio de construcción de Toolforge (''Toolforge Build Service''), revise el reciente [https://lists.wikimedia.org/hyperkitty/list/cloud-announce@lists.wikimedia.org/thread/EMYTA32EV2V5SQ2JIEOD2CL66YFIZEKV/ correo en la lista cloud-announce] y actualice su configuración de construcción si es necesario para asegurar la compatibilidad de sus herramientas. [https://wikitech.wikimedia.org/w/index.php?title=Help:Toolforge/Building_container_images&oldid=2392097#Buildpack_environment_upgrade_process][https://phabricator.wikimedia.org/T380127] * El [https://api.wikimedia.org/wiki/Main_Page Portal de documentación de la API] se cerrará en junio de 2026. Las llaves de API (''API keys'') creadas en dicho portal seguirán funcionando con normalidad. Los puntos de conexión (''endpoints'') de api.wikimedia.org se marcarán como obsoletos de forma progresiva a partir de julio de 2026. La documentación del portal de la API se trasladará a [[mw:Wikimedia APIs|mediawiki.org]]. Puede obtener más información sobre este cambio en [[wikitech:API Portal/Deprecation|la página del proyecto]]. * [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Elemento recurrente]] Actualizaciones detalladas de código de esta semana: [[mw:MediaWiki 1.46/wmf.21|MediaWiki]] '''A fondo''' * Los [[m:Special:MyLanguage/WMDE Technical Wishes|deseos técnicos de WMDE]] están considerando mejoras a [[m:WMDE Technical Wishes/References/VisualEditor automatic reference names|la generación automática de nombres en las referencias del Editor Visual]]. Revisa las [[m:WMDE Technical Wishes/References/VisualEditor automatic reference names#Proposed solutions|soluciones propuestas]] y participa en esta [[m:Talk:WMDE Technical Wishes/References/VisualEditor automatic reference names#Request for comment|solicitud de comentarios]]. ''Las '''[[m:Special:MyLanguage/Tech/News|Noticias Técnicas]]''' son preparadas por [[m:Special:MyLanguage/Tech/News/Writers|los escritores de Noticias Técnicas]] y publicadas con un [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]]&nbsp;• [[m:Special:MyLanguage/Tech/News#contribute|Colabore]]&nbsp;• [[m:Special:MyLanguage/Tech/News/2026/13|traduzca]]&nbsp;• [[m:Tech|obtenga ayuda]]&nbsp;• [[m:Talk:Tech/News|denos su opinión]]&nbsp;• [[m:Global message delivery/Targets/Tech ambassadors|suscríbase o cancele su suscripción]].'' </div><section end="technews-2026-W13" /> <bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 16:51 23 mar 2026 (UTC) <!-- Mensaje enviado por Usuario:UOzurumba (WMF)@metawiki mediante la lista en https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=30268305 --> == Noticias técnicas: 2026-14 == <section begin="technews-2026-W14"/><div class="plainlinks"> Las últimas '''[[m:Special:MyLanguage/Tech/News|noticias técnicas]]''' desde la comunidad técnica de Wikimedia. Por favor, comenta estos cambios con otros usuarios. No todos los cambios te afectarán. [[m:Special:MyLanguage/Tech/News/2026/14|Traducciones en varios idiomas]] están disponibles. '''Lo más destacado de la semana''' * Una versión beta de [[abstract:|Abstract Wikipedia]], un nuevo proyecto de Wikimedia independiente del idioma, se lanzó la semana pasada. El proyecto permite que las comunidades creen artículos de Wikipedia en sus idiomas nativos con el fin de que puedan ser leídos por personas que hablan otras lenguas. La wiki funciona mediante instrucciones de Wikifunciones y se basa también en el contenido estructurado de Wikidata. [[:f:Special:MyLanguage/Wikifunctions:Status updates/2026-03-26|Más información]]. '''Actualizaciones para editores''' * El equipo de Growth está realizando una prueba A/B para evaluar si un mensaje más claro y amigable fomenta la creación de cuentas en las wikis. Actualmente, cuando los usuarios de la versión móvil que no han iniciado sesión comienzan a editar, ven un mensaje de advertencia que puede resultar brusco y desalentador. Además, este mensaje presenta la edición con cuentas temporales como la opción predeterminada en lugar de incentivar la creación de una cuenta. La prueba se está llevando a cabo en diez Wikipedias, entre ellas las ediciones en árabe, francés, español y alemán. [[mw:Special:MyLanguage/Contributors/Account Creation Experiments#2. Improve logged-out warning message (T415160)|Más información]]. * El equipo de Wikimedia Apps invita a dejar comentarios sobre [[mw:Special:MyLanguage/Wikimedia Apps/Team/Future of Editing on the Mobile Apps|cómo debería funcionar la edición en las aplicaciones móviles de Wikipedia]]. La discusión se centra en mejorar la forma en que los usuarios acceden a las herramientas de edición al pulsar «Editar». Esto forma parte de un esfuerzo mayor para convertir a los lectores interesados en editores, ofreciéndoles un camino más amigable para comenzar a contribuir. * [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Elemento recurrente]] Revisa las {{formatnum:45}} {{PLURAL:45|tarea enviada|tareas enviadas}} por la comunidad que fueron [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resueltas la semana pasada]]. Por ejemplo, se ha solucionado un problema que impedía la obtención de citas del archivo de prensa [https://www.newspapers.com Newspapers.com] debido a un bloqueo en las solicitudes de [[mw:Special:MyLanguage/Citoid|Citoid]]. [https://phabricator.wikimedia.org/T419903] '''Actualizaciones para los colaboradores técnicos''' * [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Elemento recurrente]] Actualizaciones detalladas de código de esta semana: [[mw:MediaWiki 1.46/wmf.22|MediaWiki]] ''Las '''[[m:Special:MyLanguage/Tech/News|Noticias Técnicas]]''' son preparadas por [[m:Special:MyLanguage/Tech/News/Writers|los escritores de Noticias Técnicas]] y publicadas con un [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]]&nbsp;• [[m:Special:MyLanguage/Tech/News#contribute|Colabore]]&nbsp;• [[m:Special:MyLanguage/Tech/News/2026/14|traduzca]]&nbsp;• [[m:Tech|obtenga ayuda]]&nbsp;• [[m:Talk:Tech/News|denos su opinión]]&nbsp;• [[m:Global message delivery/Targets/Tech ambassadors|suscríbase o cancele su suscripción]].'' </div><section end="technews-2026-W14"/> <bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 19:25 30 mar 2026 (UTC) <!-- Mensaje enviado por Usuario:STei (WMF)@metawiki mediante la lista en https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=30329462 --> == Request for bot flag == (Apologies for writing in English.)<br /> Hello, there are more than 68000 [[Special:LintErrors|lint errors]] on your wiki, many of which could be fixed by my bot, [[m:User:DelintBot|DelintBot]]; some of these errors have even made some entries partially unreadable in dark mode (you could see it if you tried to read the note under the conjugation tables in [[blejal]] and [[aberzhañ]], for example). The bot is currently flagged on a number of other wikis (Bengali Wiktionary, Wikidata, Croatian Wiktionary, and also Bengali Wikibooks under a [[wikibooks:bn:Special:Contributions/RedminBot|different username]]). Please let me know if you want me to make some test edits. [[Usuario:Redmin|Redmin]] ([[Usuario discusión:Redmin|discusión]]) 15:20 1 abr 2026 (UTC) :Hello, @[[Usuario:Redmin|Redmin]], thank you for your offer. I believe you are referring to [[Special:LintErrors/night-mode-unaware-background-color]]. I have just fixed a couple of [[Special:LintTemplateErrors/night-mode-unaware-background-color|templates]] which should cover a significant number of occurrences. Let's evaluate the scale of this in a few days, after the next update. [[Usuario:Peter Bowman|Peter Bowman]] ([[Usuario discusión:Peter Bowman|discusión]]) 16:37 1 abr 2026 (UTC) ::Thank you, that sounds good to me. For future reference, there were 42024 according to the database replicas (so this count is not cached) as of the time of writing this (which I think is already a great improvement thanks to your changes). By the way, the bot also replaces obsolete HTML tags. :-) [[Usuario:Redmin|Redmin]] ([[Usuario discusión:Redmin|discusión]]) 16:51 1 abr 2026 (UTC) ::@[[Usuario:Peter Bowman|Peter Bowman]] Podrías encargarte de los otros tipos de errores? Intenté corregirlos pero no tengo permiso en las pags de Mediawiki. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 17:30 1 abr 2026 (UTC) :::@[[Usuario:Tmagc|Tmagc]]: ¿te refieres a [[Especial:Errores de sintaxis/missing-end-tag]]? Ya los he corregido. [[Usuario:Peter Bowman|Peter Bowman]] ([[Usuario discusión:Peter Bowman|discusión]]) 18:56 1 abr 2026 (UTC) :@[[Usuario:Redmin|Redmin]] one thing you could do is to replace {{ep|marcar sin referencias}} with {{ep|cita requerida}} (which require also a change in the format). The highlighting produce a linting error. I agree with project for removing/changing all the templates that use colors, they are very hard to mantain due to the night mode. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 17:28 1 abr 2026 (UTC) ::It seems like that has the potential to be a controversial change; I have added a color declaration to “marcar sin referencias” instead so it should no longer produce any lint error. [[Usuario:Redmin|Redmin]] ([[Usuario discusión:Redmin|discusión]]) 17:57 2 abr 2026 (UTC) == Action Required: Update templates/modules for electoral maps (Migrating from P1846 to P14226) == Hello everyone, This is a notice regarding an ongoing data migration on Wikidata that may affect your election-related templates and Lua modules (such as <code>Module:Itemgroup/list</code>). '''The Change:'''<br /> Currently, many templates pull electoral maps from Wikidata using the property [[:d:Property:P1846|P1846]], combined with the qualifier [[:d:Property:P180|P180]]: [[:d:Q19571328|Q19571328]]. We are migrating this data (across roughly 4,000 items) to a newly created, dedicated property: '''[[:d:Property:P14226|P14226]]'''. '''What You Need To Do:'''<br /> To ensure your templates and infoboxes do not break or lose their maps, please update your local code to fetch data from [[:d:Property:P14226|P14226]] instead of the old [[:d:Property:P1846|P1846]] + [[:d:Property:P180|P180]] structure. A [[m:Wikidata/Property Migration: P1846 to P14226/List|list of pages]] was generated using Wikimedia Global Search. '''Deadline:'''<br /> We are temporarily retaining the old data on [[:d:Property:P1846|P1846]] to allow for a smooth transition. However, to complete the data cleanup on Wikidata, the old [[:d:Property:P1846|P1846]] statements will be removed after '''May 1, 2026'''. Please update your modules and templates before this date to prevent any disruption to your wiki's election articles. Let us know if you have any questions or need assistance with the query logic. Thank you for your help! [[User:ZI Jony|ZI Jony]] using [[Usuario:MediaWiki message delivery|MediaWiki message delivery]] ([[Usuario discusión:MediaWiki message delivery|discusión]]) 17:11 3 abr 2026 (UTC) <!-- Mensaje enviado por Usuario:ZI Jony@metawiki mediante la lista en https://meta.wikimedia.org/w/index.php?title=Distribution_list/Non-Technical_Village_Pumps_distribution_list&oldid=29941252 --> az85cct4a5kznijpwpfdq3anygz3a0h tarde 0 2582 6076701 5925588 2026-04-05T02:46:01Z TMCbot 164594 . 6076701 wikitext text/x-wiki {{desambiguación|tardé|tardee|tardeé}} == {{lengua|es}} == {{pron-graf}} === Etimología 1 === {{etimología|la|tarde|lentamente}}, ("{{l|es|tardíamente}}", "{{l|es|tarde}}"). ==== {{adverbio de tiempo|es}} ==== ;1 {{csem|tiempo}}: A última hora, cuando el tiempo propicio ya ha pasado o cuando ya se cumplió un plazo acordado. {{uso|Con frecuencia es complemento de los verbos [[llegar]], [[ser]] y [[hacer|hacerse]]|también con frecuencia aparece calificado por el adverbio [[demasiado]]}}. {{sinónimos|tardíamente}}, con [[retraso]]. {{antónimo|pronto|temprano}}. {{relacionado|tardanza|tardío|tardíamente|retardo|retardar|retardarse|tardo-|tardón|tardísimo}}. {{ejemplo|Has perdido el tren, llegaste ''tarde''. ¡Qué ''tarde'' es, se me ha ido el tiempo sin darme cuenta! Vámonos ya, que si no, se nos va a hacer demasiado ''tarde''.}} ==== {{sustantivo femenino|es}} ==== {{es.sust}} ;2: {{plm|intervalo}} de [[tiempo]] que transcurre desde el [[mediodí­a]] hasta el [[anochecer]]. {{relacionado|atardecer|tardear|tardecer}}. ;3: Intervalo de tiempo entre el [[almuerzo]] y la [[cena]]. {{uso|Empléase sin artículo junto la preposición [[de]], y con el mismo junto a la preposición [[por]]|califica a las horas comprendidas entre la 1 pm (una de la ''tarde'') y las 8 pm (ocho de la ''tarde'') o hasta que anochece|se subdivide en: "primera hora de la tarde", "media tarde" y "última hora de la tarde}}. {{relacionado|madrugada|mañana|noche|vespertino}}. {{ejemplo|Fuimos al parque ''de tarde'', después de comer.}} ==== Locuciones ==== {{trad-arriba|Locuciones con «tarde»}} *[[tardes negras]]: Tarde en que acontecen uno o varios sucesos muy desagradables o trágicos. *[[buenas tardes]] *[[de tarde en tarde]]: Cada cierto tiempo sin mucha frecuencia. *[[demasiado tarde]]: Ya pasó el tiempo estipulado o ya se cumplió el plazo. *[[tarde, mal y nunca]] *[[nunca es tarde si la dicha es buena]]: {{plm|refrán}} con que se pondera el hecho de que el disfrutar de algo bueno o deseado bien vale su tardanza. *[[más vale tarde que nunca]] {{trad-abajo}} ==== Véase también ==== {{w}} {{Wikiquote}} ==== Traducciones ==== {{trad-arriba}} {{t|af|t1=aand}} {{t|sh|t1=vecer|t2=вече}} {{t|sq|t1=mbrëmje}} {{t|de|a1=1|t1=spät|a2=2|t2=Nachmittag|g2=m|t3=Abend|g3=m}} {{t|ar|t1=مَسَاء}} {{t|ast|a1=2,3|t1=tarde}} {{t|be|t1=вечар}} {{t|br|a1=1|t1=diwezhat|a2=3|t2=serr-noz|g2=m}} {{t|bg|t1=вечер}} {{t|ca|t1=vespre}} {{t|cs|t1=večer}} {{t|ko|t1=저녁}} {{t|zh|t1=晚上}} {{t|da|t1=aften}} {{t|sl|t1=pozno|t2=popoldne|g2=n|t3=vecer|g3=m}} {{t|eo|t1=vespero}} {{t|et|t1=õhtu}} {{t|eu|t1=ilunabar}} {{t|fi|t1=ilta}} {{t|fr|a1=2-3|t1=soir|g1=m|a2=2-3|t2=après-midi|g2=m}} {{t|cy|t1=min nos}} {{t|el|t1=βράδυ}} {{t|he|t1=ערב}} {{t|he|t1=מאוחר|a1=1}} {{t|hi|t1=सांझ}} {{t|hu|t1=este}} {{t|yua|a1=2|t1=okaank’iin}} {{t|en|a1=2-3|t1=evening|a2=1|t2=late}} {{t|ga|t1=tráthnóna}} {{t|is|t1=kvöld}} {{t|it|a1=2-3|t1=sera|g1=f|a2=1|t2=tardi}} {{t|ja|t1=夜}} {{t|la|a1=1|t1=vesper}} {{t|lt|a1=1|t1=vakaras}} {{t|mk|t1=вечер}} {{t|nl|t1=avond|a2=1|t2=laat}} {{t|nb|t1=kveld}} {{t|oc|t1=sera}} {{t|fa|t1=عصر}} {{t|pl|t1=wieczór}} {{t|pt|a1=2|t1=tarde}} {{t|ro|t1=seară}} {{t|ru|t1=вечер}} {{t|sv|t1=kväll}} {{t|sw|t1=jioni}} {{t|tr|t1=akşam}} {{t|uk|t1=вечір}} {{t|wa|t1=vèsprêye}} {{t|yi|t1=ovnt}} {{trad-abajo}} === Forma flexiva === ==== Forma verbal ==== ;1: {{forma verbo|tardar|p=1s|t=presente|m=subjuntivo}}. ;2: {{forma verbo|tardar|p=3s|t=presente|m=subjuntivo}}. ;3: {{forma verbo|tardar|p=2su|t=imperativo}}. == {{lengua|gl}} == {{pron-graf|leng=gl}} === Etimología === {{etimología|leng=gl}}, ==== {{adverbio de tiempo|gl}} ==== ;1: {{plm}}.<ref>{{DRAG}}</ref> {{ejemplo|Polas tres da '''tarde''' xantei a desexo coa miña muller Aurora.|trad=A las tres de la '''tarde''' tuve un delicioso almuerzo con mi mujer Aurora.}} ==== {{sustantivo femenino|gl}} ==== {{gl.sust}} ;2 {{csem|tiempo|leng=gl}}: {{plm}}. === Véase también === {{W|idioma=gl}} == {{lengua|pt}} == {{pron-graf|leng=pt|1audio=LL-Q5146 (por)-Juliano P. Junho (Jjunho)-tarde.wav|2audio=LL-Q5146 (por)-Santamarcanda-tarde.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-tarde.wav}} === Etimología 1 === {{etimología|leng=pt|roa-opt|tarde}}, {{etim|leng=pt|la|tarde|alt=tardē}}. ==== {{adverbio de tiempo|pt}} ==== ;1: {{plm|tarde}}. ==== {{sustantivo femenino|pt}} ==== {{pt.sust}} ;2 {{csem|tiempo|leng=pt}}: {{plm|tarde}}. == Referencias y notas == <references /> 2ss9pmj9yaxiw9642j9hlsk6kfw8h4q seis 0 3162 6076698 5925455 2026-04-05T02:45:51Z TMCbot 164594 . 6076698 wikitext text/x-wiki {{desambiguación|séis|sèis}} == {{lengua|es}} == {{pron-graf}} === Etimología 1 === {{etimología|osp|seis||osp|seys|glosa2=seis}}, estos {{etim|la|sex}}, y este a su vez {{etim|ine-pro|*swéḱs}}. Comparése el judeoespañol {{l+|lad|sesh}}. ==== {{adjetivo cardinal|es}} ==== {{tabla-cardinal|6|ord=sexto|nprev=5|nsig=7|r=VI|prev=cinco|sig=siete}} ;1 {{csem|números}}: {{plm|cinco}} y [[uno]]. ;2: Que ocupa el sexto lugar en una serie. {{sinónimo|sexto}} {{ejemplo|El capítulo ''seis''.}} ;3: Que está seis veces. Se usa delante de un sustantivo, pero también puede ir solo. {{ejemplo|Vinieron los ''seis'' hermanos.}} {{ejemplo|Vinieron los ''seis''.}} ==== {{sustantivo masculino|es}} ==== {{es.sust}} ;4: Signo o signos usados para representar al número que tiene seis unidades. {{ejemplo|En números romanos el ''seis'' se escribe '''VI''', y en números árabes es '''6'''.}} ;5: Nombre del número '''6'''. ;6: En las barajas, las cartas que llevan seis marcas que indican su sexto lugar en una serie del mismo palo. {{ejemplo|Tengo el ''seis'' de tréboles.}} ;7: Cada uno de los seis regidores que tenían algunas villas españolas. ;8: Baile popular zapateado de Puerto Rico. ==== Locuciones ==== *[[compás de seis por ocho]]: El que dura seis corcheas. *[[madero de a seis]]: El que tiene la sexta parte de una vara por canto. ==== Véase también ==== {{w}} ==== Traducciones ==== {{trad-arriba}} {{t|de|t1=sechs}} {{t|hy|t1=վեց}} {{t|az|t1=altı}} {{t|my|t1=ခြောက်|tl1=hkrauk}} {{t|br|t1=c'hwec'h}} {{t|bg|t1=шест}} {{t|chr|i1=s|t1=ꮡꮣꮅ}} {{t|ctu|t1=wäkp'ej}} {{t|da|t1=seks}} {{t|dv|t1=ހަ|tl1=ha|t2=ސަ|tl2=sa}} {{t|sl|t1=šest}} {{t|eo|t1=ses}} {{t|fi|t1=kuusi}} {{t|fr|t1=six}} {{t|ka|t1=ექვსი}} {{t|ha|t1=shida}} {{t|hu|t1=hat}} {{t|en|t1=six}} {{t|it|t1=sei}} {{t|km|t1=ប្រាំមួយ|tl1=pram muəy}} {{t|ky|t1=алты}} {{t|ku|t1=şeş}} {{t|lo|t1=ຫົກ|tl1=hok}} {{t|mnc|t1=ᠨᡳᠩᡤᡠᠨ|tl1=ninggun}} {{t|arn|a1=1,3-5|t1=kayu}} {{t|yua|a1=1|t1=wak}} {{t|mn|t1=зургаа}} {{t|nhn|a1=1|t1=chicuace}} {{t|nci|a1=1|t1=chicuace}} {{t|ngu|a1=1|t1=chikuasen}} {{t|nch|a1=1|t1=chikuasej}} {{t|nhw|a1=1|t1=chikuase}} {{t|nhe|t1=chikuaseh}} {{t|nl|t1=zes}} {{t|nb|t1=seks}} {{t|fa|t1=شش}} {{t|pl|t1=sześć}} {{t|pt|t1=seis}} {{t|rhg|t1=só}} {{t|sa|t1=षष्|tl1=ṣaṣ}} {{t|sh|t1=šest}} {{t|sv|t1=sex}} {{t|tl|t1=anim}} {{t|blt|t1=ꪶꪬꪀ}} {{t|th|t1=หก|tl1=hòk}} {{t|nod|t1=ᩉᩫ᩠ᨠ}} {{t|bo|t1=དྲུག|tl1=drug}} {{t|tok|t1=luka wan}} {{t|uk|t1=шість}} {{t|ug|t1=ئالتە|tl1=alte}} {{t|uz|t1=olti}} {{t|eu|t1=sei}} {{t|vi|t1=sáu}} {{trad-abajo}} == {{lengua|an}} == {{pron-graf|leng=an}} === Etimología 1 === {{etimología|leng=an}}. ==== {{adjetivo cardinal|an}} ==== ;1 {{csem|números|leng=an}}: {{plm}}. == {{lengua|ast}} == {{pron-graf|leng=ast|v1=seyes}} === Etimología 1 === {{etimología|leng=ast|roa-ole|seis||roa-ole|seys|glosa2=seis}}. ==== {{adjetivo cardinal|ast}} ==== ;1 {{csem|números|leng=ast}}: {{plm}}. ==== Véase también ==== {{w|leng=ast}} == {{lengua|osp}} == {{pron-graf|leng=osp}} === Etimología 1 === ==== {{adjetivo cardinal|osp}} ==== ;1: {{grafía|leng=osp|seys}}. == {{lengua|roa-opt}} == {{pron-graf|leng=roa-opt|g1=seys}} === Etimología 1 === {{etimología|leng=roa-opt|la|sex|seis}}. ==== {{adjetivo cardinal|roa-opt}} ==== ;1 {{csem|números|leng=roa-opt}}: {{plm}}. ==== Descendientes ==== {{trad-arriba|Descendientes}} {{d|gl|niv=1|d1=seis}} {{d|pt|niv=1|d1=seis}} {{trad-abajo}} == {{lengua|gl}} == {{pron-graf|leng=gl|1audio1=Gl-seis.ogg}} {{gl.tabla-cardinal|6|ord=|nprev=5|nsig=7|r=VI|prev=cinco|sig=sete}} === Etimología 1 === {{etimología|leng=gl|roa-opt|seis||roa-opt|seys|glosa2=seis}}, y estos {{etim|leng=gl|la|sex}}. ==== {{adjetivo cardinal|gl}} ==== {{gl.adj|p}} ;1: {{plm}}.<ref>{{DRAG}}</ref> ==== {{sustantivo masculino|gl}} ==== ;2 {{csem|números|leng=gl}}: {{plm}}. {{ejemplo|En numeración romana, o seis escríbese '''VI''' e en numeración arábiga é '''6'''.}} ==== Véase también ==== {{w|leng=gl}} [[Categoría:GL:Adjetivos]] == {{lengua|roa-ole}} == {{pron-graf|leng=roa-ole|g1=seys|g2=sseys}} === Etimología 1 === {{etimología|leng=roa-ole|la|sex|seis}}. ==== {{adjetivo cardinal|roa-ole}} ==== ;1 {{csem|números|leng=roa-ole}}: {{plm}}. == {{lengua|mwl}} == {{pron-graf|leng=mwl}} === Etimología 1 === {{etimología|leng=mwl}}. ==== {{adjetivo cardinal|mwl}} ==== ;1 {{csem|números|leng=mwl}}: {{plm}}. == {{lengua|pap}} == {{pron-graf|leng=pap}} === Etimología 1 === {{etimología|leng=pap|es|seis||pt|seis|glosa2=seis}}. ==== {{adjetivo cardinal|pap}} ==== ;1 {{csem|números|leng=pap}}: {{plm}}. == {{lengua|pt}} == {{pron-graf|leng=pt|g1=seix|gnota1=obsoleta|g2=seys|gnota2=obsoleta|audio=Pt 6.ogg|2audio=LL-Q5146 (por)-Nelson Ricardo 2500-seis.wav|2audio2=LL-Q5146 (por)-Santamarcanda-seis.wav}} === Etimología 1 === {{etimología|leng=pt|roa-opt|seis||roa-opt|seys|glosa2=seis}}, y estos {{etim|leng=pt|la|sex}}. ==== {{adjetivo cardinal|pt}} ==== ;1 {{csem|números|leng=pt}}: {{plm}}. ==== {{sustantivo masculino|pt}} ==== {{pt.sust|inv}} ;2 {{csem|números|leng=pt}}: {{plm}}. ==== Véase también ==== {{w|leng=pt}} == {{lengua|pro}} == {{pron-graf|leng=pro|1fone1=sɛjs}} === Etimología 1 === {{etimología|leng=pro|la|sex|seis}}. ==== {{adjetivo cardinal|pro}} ==== ;1 {{csem|números|leng=pro}}: {{plm}}. ==== Descendientes ==== {{trad-arriba|descendientes}} {{d|ca|d1=sis}} {{d|oc|d1=sièis}} {{trad-abajo}} == {{lengua|rm}} == {{pron-graf|leng=rm|v1=ses|vnota1=alto engadino y bajo engadino|v2=sis|vnota2=grisón, subsilvano, sursilvano}} === Etimología 1 === {{etimología|leng=rm|la|sex|seis}}. ==== {{adjetivo cardinal|rm}} ==== ;1 {{csem|números|leng=rm}}: {{plm}}. {{ámbito|leng=rm|surmirano}} == {{lengua|tl}} == {{pron-graf|leng=tl}} === Etimología 1 === {{etimología|leng=tl|es|seis}}. ==== {{adjetivo cardinal|tl}} ==== ;1 {{csem|números|leng=tl}}: {{plm}}. {{sinónimo|leng=tl|anim}} == Referencias y notas == <references /> p14391lof39su8ws7rbvyaesxqt0qn4 carro 0 3164 6076647 5893594 2026-04-05T02:43:42Z TMCbot 164594 . 6076647 wikitext text/x-wiki {{desambiguación|Carro}} == {{lengua|es}} == {{pron-graf}} [[Archivo:Australian cart.jpg|thumb|[1]]] === Etimología === {{etimología|la|carrus}}, {{etim|cel-gau|*karros}},<ref>{{DRAE2001}}</ref> {{etim|cel-pro|*karros}}, {{etim|ine-pro|*ḱr̥sós}} y este de {{l+|ine-pro|*ḱrs-}}.<ref>{{DeVaan|157}}</ref> ==== {{sustantivo masculino|es}} ==== {{es.sust}} ;1 {{csem|vehículos}}: {{plm|vehículo}} de uno o dos ejes impulsado por [[bestia]]s de [[tiro]]. {{sinónimo|carruaje|coche}} ;2 {{csem|vehículos}}: Vehículo de cuatro [[rueda]]s, propulsado por un [[motor]] de [[combustión]] interna, destinado al [[transporte]] individual o familiar. {{ámbito|América Central|Caribe|Colombia|Ecuador|México|Perú|Venezuela}} {{sinónimo|auto|nota1=Argentina, Bolivia, Chile, Paraguay, Uruguay|automóvil|buga|coche|nota4=España|turismo|nota5=España|máquina|nota6=Cuba}} ;3 {{csem|vehículos}}: {{plm|bus}} o minivan usado en el transporte público interurbano de una ciudad. {{ámbito|Perú}} {{uso|informal}} {{sinónimo|bondi|colectivo}} ;4: Parte móvil de una [[máquina de escribir]] donde se coloca el [[papel]]. ;5 {{csem|vehículos}}: Vehículo pequeño con cuatro [[rueda]]s, abierto, empujado por una persona, para transportar objetos. {{sinónimos|chango|nota=Argentina}} ==== Locuciones ==== {{trad-arriba|Locuciones con «carro»}} *[[carro de combate]]: Vehículo contemporáneo de ataque, motorizado y blindado. *[[carro de tierra]]: Medida agraria superficial muy utilizada en Cantabria (España), cuyo lado oscila entre 44 y 48 pies. * pasar o sufrir [[carros y carretas]]: pasar o sufrir muchas dificultades o penalidades. * [[parada de carros]] * [[parar el carro]] o [[parar los carros]] * [[subirse al carro]]: meterse en un asunto que parece beneficioso. * [[tirar del carro]]: sacar alguien adelante un proyecto o empresa en el que se supone que tendría que colaborar más gente. {{trad-abajo}} ==== Información adicional ==== {{derivad|carrito|carricoche|acarrear|carreta|carruaje|carromato}} ==== Véase también ==== {{Wikipedia}} *[[carruaje]] *[[diligencia]] ==== Traducciones ==== {{trad-arriba}} {{t|ast|t1=carru}} {{t|nds-de|a1=1|t1=Koor}} {{t|ca|t1=carro}} {{t|bg|a1=2|t1=autó}} {{t|gl|a1=1|t1=carro}} {{t|eo|a1=2|t1=aŭto|t2=aŭtomobilo}} {{t|eu|t1=gurdi|t2=orga}} {{t|fr|a1=1-2|t1=voiture}} {{t|en|a1=1|t1=cart|a2=2|t2=car}} {{t|it|a1=1|t1=carro}} {{t|mn|a1=2|t1=машин}} {{t|nl|t1=kar}} {{t|pl|a1=1|t1=wóz|a2=2|t2=samochód|t3=auto|a4=4|t4=wózek}} {{t|pt|t1=carro}} {{trad-abajo}} == {{lengua|gl}} == {{pron-graf|leng=gl}} === Etimología === {{etimología|leng=gl}} ==== {{sustantivo masculino|gl}} ==== {{gl.sust}} ;1 {{csem|vehículos}}: {{plm}}.<ref>{{DRAG}}</ref> ==== Véase también ==== {{W|idioma=gl}} == {{lengua|pt}} == {{pron-graf|leng=pt|audio=Pt-br-um carro.oga|aunota="um carro"|1audio2=LL-Q5146 (por)-Juliano P. Junho (Jjunho)-carro.wav|2audio1=LL-Q5146 (por)-Santamarcanda-carro.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-carro.wav}} === Etimología === {{etimología|leng=pt|roa-opt|carro}}, {{etim|leng=pt|la|carrus}}, {{etim|leng=pt|cel-gau|*karros}}, {{etim|leng=pt|cel-pro|*karros}}, {{etim|leng=pt|ine-pro|*ḱr̥sós}} y este de {{l+|ine-pro|*ḱrs-}}. ==== {{sustantivo masculino|pt}} ==== {{pt.sust}} ;1 {{csem|leng=pt|vehículos}}: {{plm|carro}}, [[carruaje]]. {{sinónimo|leng=pt|carroça}} ;2 {{csem|leng=pt|vehículos}}: {{plm|automóvil}}. {{sinónimo|leng=pt|auto|automóvel|veículo|viatura}} == Referencias y notas == <references /> 9uxpx8kib34xnzhyxwyzrjkc42ndsgw ninguno 0 6303 6076719 5908324 2026-04-05T03:54:05Z Tmagc 158167 6076719 wikitext text/x-wiki == {{lengua|es}} == {{pron-graf|v=ningún}} === Etimología 1 === {{etimología|osp|ninguno|nadie}}, y este de la locución latina {{l+|la|nec|glosa=ni}} {{l+|la|unus|ūnum|glosa=uno}}. Compárense el portugués {{l+|pt|ninguém|glosa=nadie}}, el italiano {{l+|it|nessuno|glosa=nadie}}, y el francés antiguo {{l+|fro|negun}}, {{l+|fro|neün|glosa=ningún}}. ==== {{adjetivo indefinido|es}} ==== {{es.adj}} ;1: Ni una sola de las cosas o personas señaladas por el sustantivo al que acompaña o sustituye este adjetivo indefinido. {{uso|delante de un sustantivo masculino se apocopa en ningún|el plural se usa poco}} {{ejemplo|No han hecho ninguna pregunta. No ha llegado tren ninguno.}} ==== {{pronombre|es|indefinido|singular}} ==== ;2: Ni una sola de las cosas o personas indicadas por el sustantivo al que reemplaza. {{uso|requiere la doble negación cuando va pospuesto|pero no si va antepuesto al verbo se usa solamente en singular.}} {{ejemplo|De sus perros no ha traído ninguno.}} ;3: {{plm|cualquiera}} de las personas indicadas por el sustantivo al que reemplaza. {{ejemplo|Es difícil pedirle a '''ninguno''' de mis empleados que lo haga, pero se me ocurrió que ustedes —uno de ustedes— podría hacerlo.|c=libro|t=Sinfín|a=Martín Caparrós|f=2020|isbn=9789877691030|editorial=Penguin Random House|p=306|parte=4|cap=5}} ==== Locuciones ==== {{trad-arriba|Locuciones con «ninguno»}} *[[como ninguno]] <!-- like no one else --> *[[de ningún modo]]<!-- in no way, not at all, by no means--> *[[de ninguna manera]] *[[en ninguna parte]]<!-- nowhere--> *[[ninguna cosa del otro mundo]] *[[no caber ninguna duda]] *[[no hacer ninguna gracia]] *[[no ir a ninguna parte]] {{trad-abajo}} ==== Traducciones ==== {{trad-arriba}} {{t|en|t2=nobody|a2=2}} {{trad-abajo}} == Referencias y notas == <references /> 8ot4iqi64m67axzld5u16614zifznpz Plantilla:abecedario 10 7785 6076632 5630117 2026-04-05T01:10:51Z Tmagc 158167 6076632 wikitext text/x-wiki {| style="padding:2px; font-size:105%; border: 1px dotted teal; {{#if:{{{borde-arriba|}}}||border-top: 0}}" align="center" width=70% ![[#A|A]] ![[#B|B]] ![[#C|C]] ![[#D|D]] ![[#E|E]] ![[#F|F]] ![[#G|G]] ![[#H|H]] ![[#I|I]] ![[#J|J]] ![[#K|K]] ![[#L|L]] ![[#M|M]] ![[#N|N]] ![[#Ñ|Ñ]] ![[#O|O]] ![[#P|P]] ![[#Q|Q]] ![[#R|R]] ![[#S|S]] ![[#T|T]] ![[#U|U]] ![[#V|V]] ![[#W|W]] ![[#X|X]] ![[#Y|Y]] ![[#Z|Z]] |} <noinclude>[[Categoría:Plantillas de vocabulario temático]]</noinclude> fgmj5rc3yxf4njizavcfhcdrasvs4qy ido 0 9232 6076724 5735533 2026-04-05T04:14:10Z Tmagc 158167 6076724 wikitext text/x-wiki {{desambiguación|-́ido|-ido|Ido|idō|īdõ|idő|I do}} == {{lengua|es}} == {{pron-graf}} [[Categoría:ES:Palabras formadas por acortamiento]] === Etimología 1 === {{etimología|sufijo|ir|ido}}. ==== {{adjetivo|es}} ==== {{es.adj}} ;1: {{plm|pasado}}. {{ejemplo|...los chinos eran menos nostálgicos a la hora de planearlas, que no querían escenarios tradicionales pastorales ecokitsch, que no querían tanta naturaleza ni tiempos '''idos''' no sociedades ya pasadas ni caprichitos personales; que pedían porvenir, tecnología, sexo y plata.|c=libro|t=Sinfín|a=Martín Caparrós|f=2020|isbn=9789877691030|editorial=Penguin Random House|p=333|parte=5|cap=2}} ;2: {{plm|loco}}, falto de [[cordura]].<ref name=dle>{{DLE}}</ref> {{wikisauro|loco}} ==== Traducciones ==== {{trad-arriba}} {{trad-abajo}} === Etimología 2 === {{etimología|ACORT|esperantido}} ("[[descendiente]] del [[esperanto]]"). ==== {{sustantivo masculino|es}} ==== {{es.sust}} ;1 {{csem|lenguas}}: Lengua artificial construida a partir de reformas del [[esperanto]] a principios del siglo XX. ==== Véase también ==== *[[ida]] {{w}} ==== Traducciones ==== {{trad-arriba}} {{t|tok|t1=toki Ito}} {{trad-abajo}} === Forma flexiva === ==== Forma verbal ==== ;1: {{participio|ir}}. == {{lengua|so}} == {{pron-graf|leng=so}} === Etimología 1 === ==== {{sustantivo|so}} ==== ;1 {{csem|animales|leng=so}}: {{plm|oveja}}. ==== Locuciones ==== * {{l|so|hilib ido}}: ''cordero'' == {{lengua|ha}} == {{swadesh|ha|074ido}} {{pron-graf|leng=ha}} === Etimología 1 === ==== {{sustantivo masculino|ha}} ==== {{inflect.sust.sg-pl|leng=ha|ido<br><small>/idoː˨/</small>|{{l|ha|idanu}}<br><small>/idaː˨nuː/</small>}} ;1 {{csem|anatomía|leng=ha}}: {{ucf|ojo}}.<ref name="MH-ED/SƘNHZT">{{Newman1988}}</ref> == Referencias y notas == <references /> r7p8u2dvnk1ehid2powl8p0db8qbf5e 6076725 6076724 2026-04-05T04:14:54Z Tmagc 158167 6076725 wikitext text/x-wiki {{desambiguación|-́ido|-ido|Ido|idō|īdõ|idő|I do}} == {{lengua|es}} == {{pron-graf}} [[Categoría:ES:Palabras formadas por acortamiento]] === Etimología 1 === {{etimología|sufijo|ir|ido}}. ==== {{adjetivo|es}} ==== {{es.adj}} ;1: {{plm|pasado}}. {{ejemplo|...los chinos eran menos nostálgicos a la hora de planearlas, que no querían escenarios tradicionales pastorales ecokitsch, que no querían tanta naturaleza ni tiempos '''idos''' ni sociedades ya pasadas ni caprichitos personales; que pedían porvenir, tecnología, sexo y plata.|c=libro|t=Sinfín|a=Martín Caparrós|f=2020|isbn=9789877691030|editorial=Penguin Random House|p=333|parte=5|cap=2}} ;2: {{plm|loco}}, falto de [[cordura]].<ref name=dle>{{DLE}}</ref> {{wikisauro|loco}} ==== Traducciones ==== {{trad-arriba}} {{trad-abajo}} === Etimología 2 === {{etimología|ACORT|esperantido}} ("[[descendiente]] del [[esperanto]]"). ==== {{sustantivo masculino|es}} ==== {{es.sust}} ;1 {{csem|lenguas}}: Lengua artificial construida a partir de reformas del [[esperanto]] a principios del siglo XX. ==== Véase también ==== *[[ida]] {{w}} ==== Traducciones ==== {{trad-arriba}} {{t|tok|t1=toki Ito}} {{trad-abajo}} === Forma flexiva === ==== Forma verbal ==== ;1: {{participio|ir}}. == {{lengua|so}} == {{pron-graf|leng=so}} === Etimología 1 === ==== {{sustantivo|so}} ==== ;1 {{csem|animales|leng=so}}: {{plm|oveja}}. ==== Locuciones ==== * {{l|so|hilib ido}}: ''cordero'' == {{lengua|ha}} == {{swadesh|ha|074ido}} {{pron-graf|leng=ha}} === Etimología 1 === ==== {{sustantivo masculino|ha}} ==== {{inflect.sust.sg-pl|leng=ha|ido<br><small>/idoː˨/</small>|{{l|ha|idanu}}<br><small>/idaː˨nuː/</small>}} ;1 {{csem|anatomía|leng=ha}}: {{ucf|ojo}}.<ref name="MH-ED/SƘNHZT">{{Newman1988}}</ref> == Referencias y notas == <references /> 1pib8f4mle22kvu7zedx6krtexhaass dos 0 10132 6076659 6060381 2026-04-05T02:44:13Z TMCbot 164594 . 6076659 wikitext text/x-wiki == {{lengua|es}} == {{pron-graf|1audio1=LL-Q1321 (spa)-Rodelar-dos.wav|1audio2=Es-dos-mx-México.OGG|1aunota2=México}} {{swadesh|es|023dos}} [[Categoría:ES:Números]] === Etimología 1 === {{etimología|la|duo}}, y este del {{etim|ine-pro|*duwóh₁}}. ==== {{adjetivo cardinal|es}} ==== {{es.adj|p}} {{tabla-cardinal|2|nprev=1|nsig=3|ord=segundo|prev=uno|r=II|sig=tres}} ;1: Que consta de uno más que la unidad (1+1). ==== {{adjetivo ordinal|es}} ==== {{es.adj|inv}} ;2: Que ocupa el segundo lugar en una serie. {{sinónimo|segundo}} {{ejemplo|El capítulo dos.}} ==== {{adjetivo|es}} ==== {{es.adj|p}} ;3: Que es escaso, poco abundante, corto. {{sinónimo|poco}}, un [[par]] de. {{ejemplo|Te llevo. Mi auto está a dos pasos.}} ==== {{sustantivo masculino|es}} ==== {{es.sust}} ;4: {{plm|signo}} o signos que representan esta cantidad{{-sub|1}}. {{ejemplo|En números romanos el dos se escribe II, y en números árabes es 2.}} ;5: En las barajas, las cartas que llevan dos marcas que indican su segundo lugar en una serie del mismo palo. {{ejemplo|Tengo el dos de tréboles.}} ==== {{sustantivo|es|masculino|femenino}} ==== {{es.sust|ng}} ;6: {{plm|ayudante}} o [[asistente]] principal de alguien. {{sinónimo|ayudante|asistente|mano derecha}} {{ejemplo|Tras conocerse que la inflación bajó a 3,5% en septiembre, quien fue el número '''dos''' de Sergio Massa en el Ministerio de Economía, Gabriel Rubinstein, criticó al Gobierno por achacarles a ellos el 25,5% que marcó el indicador en diciembre.|c=noticia|f=2024-10-11|sitio=La Nación|t=Rubinstein, ex dos de Massa, contradijo al Gobierno pero le dedicó un elogio|u=https://www.lanacion.com.ar/economia/inflacion-rubinstein-ex-dos-de-massa-contradijo-al-gobierno-pero-le-dedico-un-elogio-nid11102024/}} ==== Locuciones ==== {{trad-arriba|Locuciones con ''dos''}} * [[a cada dos por tres]]: Frecuentemente, a menudo, cada dos por tres. * [[a dos]]: : En deportes, empatado dos a dos (2-2). : En la pelota vasca, igualados a 30 en ambos partidos. (España) * [[a dos haces]]: con una segunda intención. * [[a dos por tres]]: de forma rápida demostrativa. (España, coloquial) * [[ambos a dos]]: ambos (Forma redundante más común en España) * [[arma de dos filos]] * [[cada dos por tres]]: continuamente. * [[cara con dos haces]]: que procede con falsedad y doblez. * [[comer a dos carrillos]]: comer con ansia, gran apetito, llenándose la boca. * [[comer en dos bocados]]: comer muy de [[prisa]], muy [[apurado]]. * [[como dos y dos son cuatro]]: se dice de un argumento [[irredargüible]], [[irrefutable]], de una verdad absoluta. * [[cuatro ojos ven más que dos]] * [[de dos caras]]: de diferente opinión o actitud frente a dos personas o situaciones diferentes. * [[de dos en dos]]: en pares, por parejas, separados en grupos de dos. * [[dos a dos]]: : En deportes, empatados a dos tantos por lado (2-2). : En diversos juegos de cuatro jugadores, se dice del juego en parejas. * [[dos letras]]: unas pocas palabras, una carta o escrito breve. * [[dos puntos]]: signo ortográfico: ''':'''. Indica que la oración está gramaticalmente completa y que lo que viene después completa el sentido lógico. Se usa también para introducir una cita. * [[en dos palabras]]: brevemente. * [[en dos patadas]]: fácilmente, en un dos por tres. * [[entre dos]]: a dúo, al [[alimón]] * [[entre dos aguas]]: en una situación dudosa, poco clara, que provoca cautela. * [[entre dos fuegos]]: estar entre dos peligros. * [[en un dos por tres]]: en un [[santiamén]] * [[estar a dos velas]]: estar sin dinero o escaso de él. (España) * [[hacer a dos caras]]: proceder con hipocresía, doblez. * [[jugar a dos puntas]] * [[jugar con dos barajas]]: proceder con hipocresía, doblez. * [[mamar a dos tetas]] * [[más ven cuatro ojos que dos]] * [[matar dos pájaros de un tiro]]: resolver dos situaciones con una sola acción. * [[nadar entre dos aguas]]: * [[no aguantarse dos pedidas]] * [[número dos]]: el segundo mejor en un deporte, profesión u otra actividad. * [[quedar como dos de queso]]: de escaso valor o utilidad. * [[quedarse a dos velas]]: : Estar sin dinero o escaso de él.(España) : Quedarse s comprender. (España) * [[que le den dos duros]] * [[ser chancha de dos caras]] * [[real de a dos]]: real de plata que valía la mitad del real de a [[cuatro]]. * [[ser de dos haces]]: obrar con doblez, decir una cosa y hacer otra. (España) * [[tener dos dedos de frente]]: tener un mínimo de inteligencia para no decir o hacer insensateces. * [[una de dos]]: expresión con la que se oponen dos cosas de las cuales hay que elegir una. {{trad-abajo}} ==== Véase también ==== {{w}} ==== Traducciones ==== {{trad-arriba}} {{t|ay|a1=1|t1=paya}} {{t|ain|a1=1|t1=ツ゚ㇷ゚/ト゚ㇷ゚/トゥㇷ゚/tup}} {{t|de|a1=1|t1=zwei}} {{t|ar|g1=m|g2=f|t1=اثنان|t2=اثنتان|tl1=iṯnān|tl2=iṯnatāni}} {{t|br|a1=1|g1=m|g2=f|t1=daou|t2=div}} {{t|bg|a1=1|g1=m|g2=fn|t1=два|t2=две|tl1=dva|tl2=dve}} {{t|ca|a1=1|g1=m|g2=f|t1=dos|t2=dues}} {{t|cs|a1=1|t1=dva}} {{t|chr|a1=1|t1=ꮤꮅ}} {{t|ctu|t1=cha'p'ej}} {{t|da|t1=to}} {{t|dv|t1=dheiy}} {{t|sk|a1=1|t1=dva}} {{t|sl|a1=1|t1=dva}} {{t|eo|a1=1|a2=2|t1=du|t2=dua}} {{t|fi|a1=1|t1=kaksi}} {{t|fr|a1=1|t1=deux}} {{t|fy|a1=1|t1=twa}} {{t|gl|a1=1|g1=m|g2=f|t1=dous|t2=dúas}} {{t|el|t1=δύο}} {{t|gn|a1=1|t1=mokõi}} {{t|ha|a1=1|t1=biyu}} {{t|hi|a1=1|t1=दो}} {{t|hu|a1=1|t1=kettő}} {{t|id|a1=1|t1=dua}} {{t|en|a1=1|t1=two}} {{t|it|a1=1|t1=due}} {{t|ja|a1=1|t1=二|tl1=[[に]], [[ni]]}} {{t|alc|a1=1|t1=wokstou}} {{t|ku|a1=1|t1=du}} {{t|la|a1=1|t1=duo}} {{t|ln|a1=1|t1=míbalé}} {{t|ms|a1=1|t1=dua}} {{t|cmn|a1=1|t1=二|t2=两|tl1=èr|tl2=liǎng}} {{t|arn|a1=1, 3, 5-7|t1=epu}} {{t|yua|a1=1|t1=kaʼa}} {{t|mit|a1=1|t1=ùi}} {{t|mn|a1=1|t1=хоёр}} {{t|nhn|t1=ome}} {{t|nci|a1=1|t1=ome|t2=ōme}} {{t|ngu|t1=ome}} {{t|nch|t1=ome}} {{t|nhw|t1=ome}} {{t|nhe|t1=ome}} {{t|nlv|t1=ome}} {{t|nv|a1=1|t1=naaki}} {{t|nl|a1=1|t1=twee}} {{t|nb|a1=1|t1=to}} {{t|nn|a1=1|t1=to}} {{t|fa|t1=دو|tl1=do}} {{t|pl|a1=1|t1=dwa}} {{t|pt|a1=1|g1=m|g2=f|t1=dois|t2=duas}} {{t|quz|a1=1|t1=iskay}} {{t|rhg|t1=dui}} {{t|ru|a1=1|g=mn|g2=f|t1=два|t2=две|tl1=dva|tl2=dve}} {{t|sa|a1=1|t1=द्व|t2=द्वि|tl1=dvá|tl2=dvi}} {{t|sh|a1=1|t1=dva}} {{t|sw|a1=1|t1=mbili}} {{t|sv|a1=1|t1=två}} {{t|tl|a1=1|t1=dalawa}} {{t|crh|t1=eki}} {{t|tr|a1=1|t1=iki}} {{t|uk|a1=1|g=mn|g2=f|t1=два|t2=дві|tl1=dva|tl2=dvi}} {{t|xum|a1=1|t1=𐌕𐌖𐌚|tl1=tuf}} {{t|eu|a1=1|t1=bi}} {{trad-abajo}} == {{lengua|ca}} == {{pron-graf|leng=ca}} {{swadesh|ca|023dos}} [[Categoría:CA:Números]] === Etimología 1 === {{etimología|leng=ca|la|duo}}. ==== {{adjetivo|ca}} ==== ;1: {{plm|dos}}. == {{lengua|kw}} == {{swadesh|kw|122dos}} {{pron-graf|leng=kw}} === Etimología 1 === {{etimología|leng=kw}}. ==== {{verbo intransitivo|kw}} ==== ;1: {{plm|venir}}. == {{lengua|fr}} == {{pron-graf|leng=fr|1audio1=Fr-dos.ogg}} {{swadesh|fr|088dos}} === Etimología 1 === {{etimología|leng=fr|la|dorsum}}. ==== {{sustantivo masculino|fr}} ==== {{fr.sust}} ;1 {{csem|leng=fr|anatomía}}: {{plm|espalda}}. == {{lengua|gl}} == {{pron-graf|leng=gl}} [[Categoría:GL:Contracciones]] === Forma flexiva === ==== Contracción ==== ;1: {{contracción|leng=gl|de|os|c1=preposición|c2=artículo}}: {{l*|es|de}} {{l*|es|los}}. == {{lengua|la}} == {{pron-graf|leng=la}} === Etimología 1 === {{etimología|leng=la|endo|*dóh₃tis}}, de la raíz {{l+|ine-pro|*deh₃-|alt=*deh₃-|glosa=dar}}. ==== {{sustantivo femenino|la}} ==== ;1: {{plm|dote}}. ;2: {{plm|don}} ([[talento]]). ==== Descendientes ==== {{trad-arriba|descendientes}} {{d|es|d1=dote}} {{d|fr|d1=dot}} {{d|it|d1=dote}} {{d|pt|d1=dote}} {{trad-abajo}} ==== Declinación ==== {{la.sust|dōs.3|gen_pl=dōtum|gen_pl2=dōtium}} == {{lengua|pt}} == {{pron-graf|leng=pt|1audio=LL-Q5146 (por)-Juliano P. Junho (Jjunho)-dos.wav|2audio=LL-Q5146 (por)-Santamarcanda-dos.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-dos.wav|2audio3=LL-Q5146 (por)-JnpoJuwan-dos.wav|audio2=LL-Q5146 (por)-Sillim-dos.wav}} [[Categoría:PT:Contracciones]] === Forma flexiva === ==== Contracción ==== ;1: {{contracción|leng=pt|de|os|c1=preposición|c2=artículo}}, véase [[do]]. == {{lengua|ro}} == {{pron-graf|leng=ro}} {{swadesh|ro|088dos}} === Etimología 1 === {{etimología|leng=ro|la|dorsum|espalda}}. ==== {{sustantivo neutro|ro}} ==== ;1 {{csem|leng=ro|anatomía}}: {{plm|espalda}}. {{sinónimo|leng=ro|spate}} ;2: {{plm|trasero}} (humano). {{sinónimo|leng=ro|fund}} ;3: {{plm|dorso}}, [[reverso]]. ;4: {{plm|sello}} (de una moneda). == Referencias y notas == <references /> 0n2013hdvsywnnclxfatd26q1wgaosx Plantilla:Bienvenido usuario 10 10661 6076633 5629606 2026-04-05T01:12:23Z Tmagc 158167 6076633 wikitext text/x-wiki <div style="padding:10px; font-size:101%; border: 1px dotted teal;" > Hola, {{<includeonly>subst:</includeonly>PAGENAME}}. Te damos la [[Wikcionario:Bienvenido, nuevo visitante|bienvenida a ''Wikcionario'']]. <small style="padding-left:150px">[[Wikcionario:Embajada|If you don't speak Spanish, please visit our Embassy]]</small> Gracias por participar en el proyecto. Puedes encontrar algunas guías útiles aquí: :<small>&#x25B6;</small> El '''[[Ayuda:Tutorial|tutorial del Wikcionario]]''' te ofrece una introducción básica sobre la manera de editar con el lenguaje "wiki"; si ya has editado en ''Wikipedia'', mira '''[[Wikcionario:Para editores de Wikipedia|para editores de Wikipedia]]''' en cambio. :<small>&#x25B6;</small> La '''[[Wikcionario:Ayuda|página de ayuda]]''' explica la filosofía básica del proyecto, cómo explorarlo y cómo colaborar; hay muchos otros recursos en el '''[[Ayuda:Mapa de ayuda|Mapa de ayuda]]'''. :<small>&#x25B6;</small> Las '''[[Wikcionario:Cómo se edita una página|instrucciones para editar una página]]''' explican cómo hacer ediciones; :<small>&#x25B6;</small> La '''[[Wikcionario:Guía de estilo|guía de estilo]]''' es esencial para orientar la redacción; :<small>&#x25B6;</small> Recuerda también que casi siempre las entradas se crean con [[minúscula]]s. Mira '''[[Wikcionario:Convenciones para nombrar entradas|cómo nombrar entradas]]''' para más detalles. Si quieres saber algo más, puedes dirigirte a la comunidad en el '''[[Wikcionario:Café|Café]]'''. No temas preguntar, estamos aquí para ayudarte. Puedes también conectarte con otros editores en el '''{{IRC|wiktionary-es|canal IRC}}''' o en el {{IRC|wikimedia-ayuda|canal de ayuda}}. {| | Esta es tu página de discusión, donde otros wikcionaristas pueden contactarte. Debes responder a un mensaje de otro usuario en '''su''' página de discusión, porque así le saldrá el aviso de «mensajes nuevos» y podrá enterarse de tu respuesta. No olvides '''[[Wikcionario:Cómo se edita una página#Firmar un comentario|firmar tu mensaje]]''' con cuatro tildes <nowiki>(&#126;&#126;&#126;&#126;)</nowiki>, con la combinación de teclas {{tecla|Alt Gr|4}}, o usando el botón correspondiente que hay en la parte superior de la caja de edición. || [[Archivo:Signature button.png|right|Para firmar usa el botón indicado|link=]] |} Esperamos que pases buenos momentos por aquí y que la colaboración te resulte agradable.<br /> Saludos muy cordiales, <includeonly>~~</includeonly><includeonly>~~</includeonly>.</div><noinclude>[[Categoría:Plantillas de notificaciones, intimaciones y denuncias]]</noinclude> knhsdl77y2f7kdja89hmqqb15sbrxcn Plantilla:Usuario bloqueado 10 14049 6076629 5943959 2026-04-05T01:07:56Z Tmagc 158167 6076629 wikitext text/x-wiki {| width="100%" border="0" cellspacing="8" cellpadding="0" style="border: 1px solid; clear: both" | style="width: 24px" | [[Imagen:Crystal Clear action lock (SVG version).svg|35px]] | '''Este usuario ha sido bloqueado.'''<br>La razón está alegada <span class="plainlinks">[http://es.wiktionary.org/w/index.php?title=Especial:Log&type=block&user=&page=Usuario:{{PAGENAMEE}} aquí]</span>; el Administrador allí puede darte más información.__NOINDEX__ |}<includeonly>[[Categoría:Usuarios bloqueados]]</includeonly> jz0bq0ncubz6woi2wfphj0mv1segpcq que 0 17494 6076577 5929196 2026-04-04T17:58:50Z Adelpine 34679 Agrega una pronunciación AFI tomada de [[fr:que]] 6076577 wikitext text/x-wiki == {{lengua|es}} == {{swadesh|es}} {{pron-graf|1audio1=Es-mx-que.ogg|g1=q̃|gnota1=abreviatura obsoleta|h1=qué}} === Etimología 1 === {{etimología|la}}. Confluencia de: el pronombre relativo {{l+|la|quem}} (acusativo masculino de {{l+|la|quis}}), la conjunción copulativa {{l+|la|quid}} (neutro de {{l+|la|quis}}) y la conjunción comparativa (adverbio comparativo en otras obras) {{l+|la|quam}}.<ref>{{Corominas-breve|año=1967|ed=2|485}}</ref> ==== {{pronombre relativo|es|invariable}} ==== {{es.adj|inv}} ;1: Palabra utilizada para hacer referencia a una palabra o frase expresada anteriormente conocida como [[antecedente]], conectándola con una idea que será expresada posteriormente. {{sinónimo|el que|la que|los que|las que|lo que|el cual|los cuales|la cual|las cuales|lo cual}} {{ejemplo|la mujer con la que yo hablé.}} ==== {{conjunción|es|subordinante}} ==== ;2: Introduce una oración subordinada sustantiva con función de sujeto o complemento directo. {{ejemplo|Es necesario que acabes pronto el informe.}} ;3: Enlaza el verbo con otras partes de la oración. {{ejemplo|Espero que esté bien.}} ;4: Se utiliza para construir frases comparativas. {{ejemplo|Es más alto que tú.}} ;5: Coloquialmente puede sustituir a la expresión ''[[de manera que]]''. {{ejemplo|Tiene la cabeza que le estalla.}} {{uso|coloquial}} ;6: Coloquialmente sustituye a ''[[porque]]''. {{ejemplo|Vámonos, [[ya que]] se hace tarde.}} {{uso|coloquial}} ;7: Introduce una oración subordinada consecutiva. ==== Traducciones ==== {{trad-arriba}} {{t|br|a1=4|t1=eget|t2=evit}} {{t|eo|a1=1|t1=kiukio|a2=3|t2=ke|a3=4|t3=ol}} {{t|fr|a1=1-4|t1=que}} {{t|he|t1=ש־ מה}} {{t|en|a1=1-3|t1=that|a2=4|t2=than|a3=5|t3=so that}} {{t|yua|a1=3|t1=ka|a2=3|t2=de ke}} {{t|nci|a1=1|t1=tlein}} {{t|nhw|a1=1|t1=tlen}} {{t|nb|a1=1ac|a2=1b|a3=2-3|a4=4|a5=5|t1=som|t2=hvem|t3=at|t4=enn|t5=slik at}} {{t|pt|t1=que}} {{trad-abajo}} == {{lengua|fr}} == {{pron-graf|leng=fr|1fono1=kə|1fone2=kø|1audio2=Fr-que.ogg|1aunota2=París}} === Etimología 1 === {{etimología|leng=fr|fro|que}}, {{etim|leng=fr|la|quid}}, {{l+|la|quam}}. ==== {{pronombre relativo|fr|invariable}} ==== ;1: {{plm|que}}. ==== {{pronombre interrogativo|fr|neutro}} ==== ;2: {{plm|qué}}. ==== {{conjunción|fr|subordinante}} ==== ;3: {{plm|que}}. ==== Locuciones ==== * {{l|fr|alors que}} == {{lengua|gl}} == {{pron-graf|leng=gl}} === Etimología 1 === {{etimología|leng=gl|la|quid}}. ==== {{adjetivo interrogativo|gl|invariable}} ==== ;1: {{plm|qué}}.<ref>{{DRAG}}</ref> ==== {{pronombre interrogativo|gl|neutro|invariable}} ==== ;2: {{plm|qué}}. {{ejemplo|'''Que''' cobizaba pois?|trad= ¿'''Qué''' codiciaba entonces?}} [[Categoría:FR:Lista Swadesh]] == {{lengua|pt}} == {{pron-graf|leng=pt}} === Etimología 1 === {{etimología|leng=pt|la|quid}}. ==== {{pronombre interrogativo|pt|neutro|invariable}} ==== ;1: {{plm|qué}}. ==== Véase también ==== * [[quê]] == Referencias y notas == <references /> mf7jtopea0a34tpmzukbks56bt9eyh3 tomar 0 20017 6076704 6068044 2026-04-05T02:46:08Z TMCbot 164594 . 6076704 wikitext text/x-wiki {{desambiguación|Tomar}} == {{lengua|es}} == {{pron-graf}} === Etimología 1 === {{etimología|incierta}}. Corominas propone una aféresis del latín [[autumo|autumāre]] ('afirmar (el derecho de posesión sobre algún bien)'), con varias dificultades semánticas.<ref>{{DCECH}}</ref> Teniendo en cuenta que se comenzó usando como sinónimo de [[apropiar]]se (de algo), la hipótesis de Walsh resulta más simple y directa: una alteración de [[domar]].<ref>{{referencia|c=articulo|t=The Etymology of Hispano-Romance Tomar 'To Take'|a=Thomas J. Walsh|f=2000|u=https://www.jstor.org/stable/474499|doi=10.2307/474499|revista=Hispanic Review|vol=68|n=3|p=243}}</ref> ==== {{verbo transitivo|es}} ==== ;1: {{plm|coger}} alguna [[cosa]] con la mano.<ref name="novísimo">{{Labernia1866}} Pág. 890</ref> {{ejemplo|''Toma'' el libro que está ahí y llévatelo; es todo tuyo.}} ;2: {{plm|coger}}, aunque no sea con la mano.<ref name="drae1914">{{DLC1914|992}}</ref> ;3: {{plm|recibir}} o [[aceptar]].<ref name="novísimo" /> {{ejemplo|Sabes que yo ''tomo'' todo lo que ustedes me den.}} ;4: {{impropia|Unido con los nombres de alimentos, significa alimentarse con ellos, comerlos o beberlos, como tomar chocolate, café, etc.}}<ref name="novísimo" /> {{sinónimo|beber|comer}} {{ejemplo|''Tomar'' un desayuno, ''tomar'' un almuerzo.}} ;5: {{impropia|Junto con ciertos nombres, como fuerza, vigor, espíritu , aliento , libertad y otros semejanIes, vale recibir o adquirir lo que los mismos nombres significan.}}<ref name="dlc1842" /> {{ejemplo|''Toma'' fuerza para continuar.}} ;6: {{plm|utilizar}} un medio de transporte. {{sinónimo|agarrar|coger}} {{ejemplo|''Tomar'' el tren.}} ;7: {{plm|ocupar}} algún punto para [[atajar]] o [[cortar]] un [[camino]].<ref name="novísimo" /> {{ejemplo|''Tomar'' a la izquierda.}} ;8: {{plm|cobrar}}.<ref name="novísimo" /> {{ejemplo|Puso también término a los cambios que fatigaban y consumían a muchos, con mandar a que el acreedor ''tomase'' las dos partes de las rentas.|autor=Ambrosio de Morales|c=libro|capítulo=23|título=Sus obras}} ;9: {{plm|conquistar}} por las armas algún punto, plaza, etc.<ref name="novísimo" /> ;10: {{plm|interpretar}} en determinado sentido.<ref name="novísimo" /> {{ejemplo|Por eso te pido, una vez más<br>Tomátelo con tranquilidad<br>Puede ser ayer, nunca o después<br>Pero tu amor dame alguna vez|a=Juan Carlos Baglietto|c=canción|f=2006|t=La casa de al lado}} ;11: {{plm|considerar}} o [[tener]] por.<ref name="novísimo" /> ;12: {{plm|quitar}} o [[hurtar]]<ref name="novísimo" /> {{ejemplo|Esos malditos ladrones ''han tomado'' mi cartera.}} ;13: {{plm|comprar}}.<ref name="novísimo" /> ;14: {{plm|adoptar}} alguna [[carrera]].<ref name="novísimo" /> ;15: {{plm|cubrir}} el macho a la hembra.<ref name="novísimo" /> ;16: {{plm|ganar}} la [[baza]] en el juego de [[naipe]]s.<ref name="novísimo" /> ;17 {{csem|deporte}}: {{plm|suspender}} la [[pelota]] que se ha sacado, sin volverla ni jugarla, por no estar los jugadores en su lugar.<ref name="novísimo" /> ;18 {{csem|náutica}}: {{plm|arribar}} o llegar a algún [[fondeadero]] o lugar conveniente.<ref name="novísimo" /> ;19: {{impropia|Es susceptible de una infinidad de acepciones que dependen de las palabras con que se une, como: "tomar descanso", "descansar", etc.}}<ref name="novísimo" /> ;20: Sobrevenirle a alguno de nuevo alguna especie de [[afecto]] que le incita o mueve [[violentamente]].<ref name="dlc1842">{{DLC1842}} pág.850</ref> {{ejemplo|''Tomarle'' a uno el sueño. ''Tomarle ''a uno la risa. ''Tomarle'' a uno la gana.}} ;21: Recibir en sí los efectos de algunas cosas, consintiéndolos o padeciéndolos.<ref name="dlc1842" /> {{ejemplo|''Tomar'' frío. ''Tomar'' pesadumbre.}} ;22: {{plm|emprender}} alguna cosa, o encargarse de alguna dependencia o negocio.<ref name="dlc1842" /> ;23: {{plm|sobrecoger}} o sorprender el ánimo por algún accidente u otra aflicción.<ref name="dlc1842" /> {{ejemplo|La muerte de su madre la ''tomó'' por sorpresa.}} ;24: {{plm|escoger}} entre varias cosas que se ofrecen al arbitrio alguna de ellas.<ref name="dlc1842" /> ;25: Desear que suceda alguna cosa del modo que se propone como envidiándola.<ref name="dlc1842" /> ;26: {{impropia|Junto con los nombres que significan el instrumento con que se hace alguna cosa, vale ejercitarse en ella o ponerse a hacerla}}<ref name="dlc1842" /> {{ejemplo|''Tomar'' la pluma, escribir. ''Tomar'' la aguja, coser.}} ;27: {{plm|llevar}} a alguno en su compañía.<ref name="dlc1842" /> ;28: {{plm|hallar}} o [[coger]] a alguno en [[culpa]] o delito.<ref name="dlc1842" /> {{uso|anticuado}} {{ejemplo|Lo ''tomaron'' a la salida con 100 dólares en la cartera.}} ;29: {{plm|tener}} relaciones sexuales, posiblemente sin consentimiento.{{cita requerida}}. ==== {{verbo intransitivo|es}} ==== ;30: Ingerir [[alcohol]]. {{ámbito|América|Guinea Ecuatorial|Filipinas}} {{sinónimo|beber}} {{ejemplo|No tienen ni dónde caerse muertos; pero aun así ''toman''.}} ==== Locuciones ==== {{trad-arriba|Locuciones con «tomar»}} * [[tomar aires]] * [[tomar rizos]]: (Náutica) Aferrar a la verga una parte de las velas, disminayendo su dimensión.<ref name="novísimo" /> * [[tomar la vuelta de tierra]]: (Náutica) Virar con dirección a la costa.<ref name="novísimo" /> * [[tomar tierra]]: (Náutica) Acercarse a la costa, aportar.<ref name="novísimo" /> * [[tomar algo por donde quema]]: Entenderlo y tomarlo en el sentido contrario y picante a la intención del que lo hace y dice.<ref name="novísimo" /> * [[tomar de más alto alguna cosa]]: Acercarse más al origen o principio de ella.<ref name="novísimo" /> * [[tomar dos de Lías y Juan danzante]]: Ausentarse impensadamente o hacer fuga.<ref name="novísimo" /> * [[tomar enmienda]]: (Anticuado) Castigar.<ref name="novísimo" /> * [[tomarla con alguno]]: Tener tema con él.<ref name="novísimo" /> * [[tomar las de Villadiego]]: Ausentarse impensadamente o hacer fuga.<ref name="novísimo" /> * [[tomar por avante]]: (Náutica) Virar la nave involuntariamente o de propósito por la parte por donde viene el viento.<ref name="novísimo" /> * [[tomarla con alguno]]: Contradecirle o culparle en cuanto dice o hace.<ref name="novísimo" /> * ¡[[toma]]! o ¡[[tome]]!: Interjección, para significar la extrañeza que hace alguna especie.<ref name="novísimo" /> * [[tómate esa]]: Expresión que se usa cuando a alguno se le da algún golpe, o se hace con él otra acción que sienta, para dar a entender que lo merecía el que la recibe, o el acierto del que la ejecuta, suele añadirse, y vuelve por otra.<ref name="novísimo" /> * [[tomarse con alguno]]: Reñir o tener contienda o cuestión con él.<ref name="novísimo" /> * [[más vale un toma que dos te daré]]: Refrán que enseña que el bien presente que se disfruta es preferible a las esperanzas y promesas, aunque sean mayores y mas halagüeñas.<ref name="dlc1842" /> * ir o [[tomar las duras con las maduras]]: Refrán que se usa para significar que debe llevar las incomodidades de un empleo u oficio el que tiene las utilidades y los provechos.<ref name="dlc1842" /> * [[tomar el camino]]: Empezar a caminar.|| Atajar.<ref name="Terreros">{{referencia|editor=imprenta de la Viuda de Ibarra, Hijos y Compañia|u=http://books.google.es/books?id=7yU0LNL0F4UC&q=|t=Diccionario castellano con las voces de ciencias y artes y sus correspondientes en las tres lenguas francesa, latina é italiana: P-Z|a=Esteban Terreros y Pando|f=1787|c=libro}}</ref> * [[tomar la palabra]]: Hablar después de otro.<ref name="Terreros" /> * [[tomar a arrendamiento]]: Arrendar.<ref name="Terreros" /> * [[tomar horror a]] alguna cosa: Aborrecer.<ref name="Terreros" /> * [[tomar sobre sí]] alguna deuda, culpa: Tomarla a su cargo, encargarse.<ref name="Terreros" /> * [[tomar los frutos]] de los árboles: Recogerlos.<ref name="Terreros" /> * [[tomar de nuevo el hilo]]: Volver al tema.<ref name="Terreros" /> * [[tomar carne]]: Se dice en la Teología hablando de la Segunda Persona de la Trinidad Beatísima, que tomó carne humana.<ref name="Terreros" /> * [[tomar carnes]]: Engordar.<ref name="Terreros" /> * [[tomar con la mano]]: Empuñar.<ref name="Terreros" /> * [[tomar una cosa a risa]]: Reírse, no enfadarse, burlarse, despreciar.<ref name="Terreros" /> * [[tomar por su cuenta]] un pleito, causa: Defenderlo.<ref name="Terreros" /> * [[tomar a su cargo]] alguna cosa: Encargarse.<ref name="Terreros" /> * [[tomar por su cuenta una casa]]: Alquilarla.<ref name="Terreros" /> * [[tomar por su cuenta una casa]] o niños: Mantener la casa, educar los niños.<ref name="Terreros" /> * [[tomar consejo]]: Pedirlo, aconsejarse.<ref name="Terreros" /> * [[tomar mujer]] o marido: Casarse.<ref name="Terreros" /> * [[tomar disciplina]]: Azotarse.<ref name="Terreros" /> * [[tomar licencia]]: Pedirla, despedirse.<ref name="Terreros" /> * [[tomar la delantera]]: Aventajarse, adelantarse.<ref name="Terreros" /> * [[tomar la izquierda]] o la derecha: Sentarse, ponerse, o caminar a la derecha, o izquierda.<ref name="Terreros" /> * [[tomar a mano derecha]] o a mano izquierda: Según estos caminos, caminar hacia la izquierda, o derecha.<ref name="Terreros" /> * [[tomar por escrito]]: Anotar, o escribir alguna cosa.<ref name="Terreros" /> * [[tomar al pie de la letra]]: En todo rigor, sin interpretación.<ref name="Terreros" /> * [[tomarlo todo al revés]]: Pervertirlo , invertir y trastocar las cosas.<ref name="Terreros" /> * [[tomar el rábano por las hojas]] o [[tomar el badil por donde quema]]<ref name="Terreros" /> * [[tomar la ocasión por los cabellos]]: Aprovecharla , no dejarla perder.<ref name="Terreros" /> * [[tomarse la libertad]]: Tomar demasiada libertad, propasarse, salir de lo justo, desmedirse, descomedirse.<ref name="Terreros" /> * [[tomar el partido de alguno]]: Seguir, defender.<ref name="Terreros" /> * [[tomar las malas mañas de otros]]: Los criados sirven bien al principio, pero después toman las mañas de los antiguos.<ref name="Terreros" /> * [[tomar la farinatura]] de alguna arte: Enharinarse. * [[tomar el sol]]: Ponerse al sol.<ref name="Terreros" /> * [[tomar el aire]] o [[tomar aire]] o [[tomar el fresco]]: Exponerse a esto, o ponerse donde da.<ref name="Terreros" /> * [[tomar tierra]]: Desembarcar.<ref name="Terreros" /> * [[tomar perfiles]]: En la pintura, pasar con carmín, u otro color al óleo todos los contornos de una pintura para que se impriman en el papel que se coloca, de modo que salgan ordenados.<ref name="Terreros" /> * [[tomar medida]]: Medir.<ref name="Terreros" /> * [[tomar el estilo]], modales: Imitar.<ref name="Terreros" /> * [[tomar a pechos]]: Con ahínco.<ref name="Terreros" /> * [[tomar el pulso]]: Pulsar, tantear.<ref name="Terreros" /> * [[tomar a pulso]]: <ref name="Terreros" /> * [[tomar calor]]: Acalorarse.<ref name="Terreros" /> * [[tomar color]]: Teñirse.<ref name="Terreros" /> * [[tomar color las frutas]]: Empezar a madurar, colorirse.<ref name="Terreros" /> * [[tomar cuentas]]: Examinarlas, comprobarlas.<ref name="Terreros" /> * [[tomar cuerpo]] la ira, enemistad, un pleito: Encenderse más, agriarse.<ref name="Terreros" /> * [[tomar asiento]] o [[tomar lugar]]: Sentarse.<ref name="Terreros" /> * [[tomar el cielo con las manos]]: Irritarse, enfadarse, quejarse con ira de algún agravio.<ref name="Terreros" /> * [[tomar el medio]] o los medios: Practicarlos, usarlos, ponerlos en ejecución.<ref name="Terreros" /> * [[tomar el pelo]] a alguno: Burlarse de él. * [[tomar el trote]]: Trotar.<ref name="Terreros" /> * [[tomar el viento]]: (Náutica) Disponer las velas, según él.||(Caza) Rastrear, indagar el rastro.<ref name="Terreros" /> * [[tomar figura]] o [[tomar traza]]: Representar esto, o lo otro, revestirse, disfrazarse de.<ref name="Terreros" /> * [[tomar la lección]]: Tener cuidado de como se da, oirla.||Aprenderla , aprender alguna cosa de otro.<ref name="Terreros" /> * [[tomar lección]] de algún instrumento, baile: Aprenderlo, estudiarlo.<ref name="Terreros" /> * [[tomar puntos]]: Picar en algún libro para defender según aquello que salga, estas, o las otras cuestiones que elija leyendo de oposición.<ref name="Terreros" /> * [[tomar rabia]], cólera, furia o contento, etc: Enfurecerse, encolerizarse, divertirse, etc.<ref name="Terreros" /> * [[tomar la voz]]: Hablar por otro, en nombre de alguno.<ref name="Terreros" /> * [[tomarse del vino]]: Emborracharse.<ref name="Terreros" /> * [[tomarse la muerte por sus manos]] o el mal por sus manos: Matarse, o dañarse voluntariamente.<ref name="Terreros" /> * [[tomarse licencia]]: Ejecutar por sí aquello que se debía hacer con el beneplácito de otro.<ref name="Terreros" /> * [[tomar una cosa por donde quema]]: Equivale a mirarla de un modo perjudicial, pudiendo mirarla de otro.<ref name="Terreros" /> * [[tomar la taba]]: Además del sentido recto de tomarla para jugar, significa empezar a hablar con alguna precipitación, o al dejarlo otro.<ref name="Terreros" /> * [[tomar lengua]] o [[tomar voz]] o [[tomar señas]]: Informarse en alguna materia.<ref name="Terreros" /> * [[tomar paso]]: se dice de una caballería que vuelve, o empieza un paso suave en que está instruida, o la enseñan, o le empieza dejando el trote.<ref name="Terreros" /> * [[tomar un paso]] o [[tomar un portante]]: Frase que significa la priesa que alguno lleva.<ref name="Terreros" /> * [[tomar el portante]]: Irse de alguna parte, marchar de ella.<ref name="Terreros" /> * [[tomar en la boca]] esto o estotro: Callar acerca de ello.<ref name="Terreros" /> * [[volver a tomar]]: Conquistar, recuperar.<ref name="Terreros" /> {{trad-abajo}} ==== Conjugación ==== {{es.v}} ==== Véase también ==== * [[toma]] {{w}} ==== Traducciones ==== {{trad-arriba}} {{t|de|a2=4|i1=s|t1=nehmen|t2=zu sich nehmen}} {{t|ast|a1=1,2|t1=agarrar|t2=coyer|t3=pañar}} {{t|az|a1=1,2,4,10,11,16|t1=almaq}} {{t|bg|a3=5|t1=вземам|t2=взема|t3=пия}} {{t|ca|i1=s|t1=prendre}} {{t|fr|i1=s|t1=prendre}} {{t|gl|a1=1|t1=tomar}} {{t|en|i1=s|t1=take}} {{t|yua|a1=1|t1=chʼaʼ}} {{t|pt|a1=1-6,9,10,12-14,19,20,22,24,28|t1=tomar}} {{trad-abajo}} == {{lengua|ast}} == {{pron-graf|leng=ast}} === Etimología 1 === {{etimología|leng=ast}}. ==== {{verbo transitivo|ast}} ==== ;1: {{plm|beber}}. ;2: {{plm}}, {{l|es|coger}}. ;3: {{plm|cubrir}}. ;4: {{plm|irse}}, {{l|es|viajar}}. ==== Conjugación ==== {{ast.v}} == {{lengua|osp}} == {{pron-graf|leng=osp}} === Etimología 1 === {{etimología|leng=osp|incierto}}. ==== {{verbo transitivo|osp}} ==== ;1: {{plm}}, {{l|es|coger}}. == {{lengua|ca}} == {{pron-graf|leng=ca|h1=tomà}} === Etimología 1 === {{etimología|leng=ca|roa-oca|pomar|coger}}, relacionado con {{l+|ca|palnmell}}.<ref name="GDLC">{{GDLC}}</ref> ==== {{verbo transitivo|ca}} ==== ;1: {{plm|coger}} o {{l|es|atrapar}}. {{sinónimo|leng=ca|empomar|entomar}}. === Etimología 2 === {{etimología|leng=ca|fonética|tombar}}.<ref name="GDLC" /> ==== {{verbo transitivo|ca}} ==== ;1: {{plm|derribar}}. ==== Conjugación ==== {{ca.v}} == {{lengua|ceb}} == {{pron-graf|leng=ceb}} === Etimología 1 === {{etimología}}. ==== {{verbo transitivo|ceb}} ==== ;1: {{grafía|leng=ceb|tumar}}. == {{lengua|roa-opt}} == {{pron-graf|leng=roa-opt|1fone1=to.ˈmaɾ}} === Etimología 1 === {{etimología|leng=roa-opt|incierto}}, pero cognado del vocablo castellano. ==== {{verbo transitivo|roa-opt}} ==== ;1: {{plm}}, {{l|es|coger}}. {{ejemplo|e logo chegar.a alma tomar demões q̇ a leuarõ. mui toſte ſẽ tardar.|a=Alfonso X de Castilla|c=libro|título=Cantigas de Santa Maria|u=http://www.pbm.com/~lindahl/cantigas/facsimiles/E/099.html}} == {{lengua|gl}} == {{pron-graf|leng=gl}} === Etimología 1 === {{etimología|leng=gl|roa-opt|tomar|tomar}}. ==== {{verbo transitivo|gl}} ==== ;1: {{plm}}, {{l|es|coger}}.<ref>{{DRAG}}</ref> {{ejemplo|Non chores, mai queridiña, '''Toma''' folgo, '''toma''' calma.|trad= No llores, querida madre, respira, '''tóma'''telo con calma.}} ==== Conjugación ==== {{gl.v}} == {{lengua|lad}} == {{pron-graf|leng=lad}} === Etimología 1 === {{etimología|leng=lad|osp|tomar|tomar}}. ==== {{verbo transitivo|lad}} ==== ;1: {{plm}}. == {{lengua|pt}} == {{pron-graf|leng=pt|1audio=LL-Q5146 (por)-Juliano P. Junho (Jjunho)-tomar.wav|2audio=Pt tomar.ogg|2audio2=LL-Q5146 (por)-Santamarcanda-tomar.wav|h1=Tomar}} === Etimología 1 === {{etimología|leng=pt|roa-opt|tomar|tomar}}. ==== {{verbo transitivo|pt}} ==== ;1: {{plm}}, {{l|es|coger}}, {{l|es|sacar}}. {{sinónimo|leng=pt|pegar}}. {{ejemplo|Fui ao banco '''tomar''' meu dinheiro.}} ;2 {{csem|leng=pt|milicia}}: {{plm|conquerir}} (tomar a fuerza). {{sinónimo|leng=pt|conquerer|conquirer|conquistar|nota=obsoleta|nota2=obsoleta}}. {{ejemplo|Os cruzados '''tomaram''' Jerusalém.}} ;3: {{plm|robar}} (tomar ilegalmente). {{sinónimo|leng=pt|roubar}}. {{ejemplo|O ladrão '''tomou''' todo o meu dinheiro!}} ;4: {{plm|recibir}} (como victima). {{ejemplo|'''Tomei''' um soco na cara.}} ;5: {{plm|ejecutar}}, {{l|es|practicar}}. {{ejemplo|'''tomar''' uma decisão; '''tomar''' medidas.}} ;6: {{plm|considerar}}. (Usado con la preposición {{l|pt|por}}). {{sinónimo|leng=pt|considerar}}. {{ejemplo|Eu '''tomei''' a Maria por corrupta.}} ;7: {{plm|consumir}} (tomar en el cuerpo). ;8: {{plm|beber}}. {{sinónimo|leng=pt|beber}}. {{ejemplo|Eu '''tomei''' suco.}} ;9: {{plm|tomar}} (un medicamento). {{ejemplo|Esqueci de '''tomar''' meus antidepressivos.}} ==== {{verbo intransitivo|pt}} ==== ;10: {{plm|beber}} ({{l|es|bebido}}s {{l|es|espirituoso}}s, especialmente habitualmente). {{sinónimo|leng=pt|beber}}. {{ejemplo|Ele '''toma''' muito, durante os finais de semana.}} ==== Conjugación ==== {{pt.v}} ==== Información adicional ==== {{derivad|leng=pt|retomada|retomador|retomar|tomada|tomador}} == Referencias y notas == <references /> 5inlp45aw2d4ha1uzjbf7dhd0xswcw8 paz 0 20285 6076689 6059783 2026-04-05T02:45:25Z TMCbot 164594 . 6076689 wikitext text/x-wiki {{desambiguación|Paz}} == {{lengua|es}} == {{pron-graf}} === Etimología 1 === {{etimología|la|pax|sig=no}}. [[Archivo:Peace dove.png|thumb|200px|La paloma blanca con con una rama de olivo, símbolo de la ''paz'' [2] ]] ==== {{sustantivo femenino|es}} ==== {{es.sust}} ;1: Condición espiritual o anímica de [[tranquilidad]] o [[quietud]]. {{sinónimo|quietud|sosiego}}. {{ejemplo|Encontrar la ''paz'' interior.}} ;2: Ausencia de disturbios o agitación. {{sinónimo|calma|quietud}}. {{antónimo|conflicto}}. {{ejemplo|La ''paz'' que reina en las montañas.}} ;3: Estado de no beligerancia entre estados. {{sinónimo|concordia}}. {{antónimo|guerra}}. ;4: Acuerdo o tratado que pone fin a una guerra. {{ejemplo|firmar la ''paz''.}} ;5: Espíritu de conciliación y colaboración. {{sinónimo|reconciliación}}. ;6 {{csem|religión}}: En la misa católica, saludo ritual deseándose mutuamente la paz<sub>1</sub>. ;7 {{csem|religión}}: Esta parte de la misa. ;8: Figura en relieve sobre una placa, que se besaba en dicho rito. {{uso|anticuado}} {{sinónimo|portapaz}}. ==== {{interjección|es}} ==== ;9: ''Se usa para poner fin a una disputa''. ==== Locuciones ==== {{trad-arriba|Locuciones con ''paz''}} *[[a la paz de Dios]] *[[andar la paz por el coro]] *[[aquí paz y después gloria]] *[[bandera de paz]] *[[beso de paz]] *[[con paz sea dicho]] *[[dar la paz]] a alguien *[[dar paz]] a alguien *[[dejar en paz]] *[[descansar en paz]] *[[en paz]] *[[en paz y en haz]] *[[estar en paz]] *[[gente de paz]] *[[hacer las paces]] *[[ir en la paz de Dios]] *[[ir en paz]] *[[iris de paz]] *[[juez de paz]] *[[la paz de los cementerios]] *[[meter paz]] *[[moro de paz]] *[[no dar paz a la mano]] *[[paloma de la paz]] *[[paz octaviana]] *[[paz y pan]] *[[paz y salvo]] *[[poner en paz]] *[[poner paz]] *[[quedar en paz]] *[[que en paz descanse]] *[[reposar en paz]] *[[sacar a paz y a salvo]] *[[saludo de la paz]] *[[tener la fiesta en paz]] *[[tratado de paz]] *[[vaya en paz]] *[[venir de paz]] *[[y en paz]] {{trad-abajo}} ==== Información adicional ==== {{derivad|pacífico|apaciguar|pacifista}} ==== Véase también ==== {{Wikiquote}} {{W}} ==== Traducciones ==== {{trad-arriba}} <small><u>'''Para ver la lista de traducciones pendientes de verificación, pulse [[Discusión:paz#Traducciones pendientes de comprobación|aquí]]'''</u></small> {{t|af|a1=1|t1=vrede}} {{t|ay|a1=1|t1=moxsa kamaña|t2=hacana}} {{t|sh|a1=1|t1=mir mir мир|g1=m}} {{t|sq|t1=paqe|g1=f}} {{t|de|a1=1,2|t1=Ruhe Frieden Friede}} {{t|gsw|a1=1|t1=fréda}} {{t|alq|a1=1|t1=ᐙᑭ ᐃᒋᐌᐱᔅᐃ|tl1=wāki ićiwēpis'i}} {{t|hsb|a1=1|t1=měr}} {{t|am|t1=ሰሳም|tl1=selam}} {{t|ar|t1=سلام|tl1=salām}} {{t|hy|t1=խաղաղություն|tl1=khaghaghouthyoun}} {{t|ast|t1=paz|g1=f}} {{t|ae|a1=1|t1=âxshti|tl1=râma}} {{t|az|a1=1|t1=сүлһ|tl1=sülh}} {{t|ban|a1=1|t1=shanti}} {{t|bal|a1=1|t1=sala}} {{t|bm|a1=1|t1=hèrè}} {{t|bas|a1=1|t1=nsaŋ}} {{t|bem|a1=1|t1=mutenden}} {{t|bn|a1=1|t1=ষনত|tl1=śānti}} {{t|tmz|a1=1|t1=ⵜⴰⵍⵡⵉⵜ}} {{t|be|t1=пакой|tl1=pakoy|t2=мір|tl2=mir}} {{t|br|a1=1|t1=peoc'h|g1=m}} {{t|bg|t1=мир|tl1=mir}} {{t|kab|a1=1|t1=laafya}} {{t|km|a1=1|t1=សនតភព|tl1=sântĕphéapô}} {{t|ca|a1=1|t1=pau}} {{t|ceb|a1=1|t1=kalinaw}} {{t|ce|a1=1|t1=машар|tl1=maşar}} {{t|cs|t1=mír|g1=m}} {{t|chr|a1=1|t1=ꮕꮹꮩ ꭿꮿꮫ}} {{t|chy|a1=1|t1=nanomonsetotse}} {{t|ny|a1=1|t1=mtendere}} {{t|yue|a1=1|t1=sai gaai òh pìhng}} {{t|zh|t1=和平}} {{t|cho|a1=1|t1=achukma}} {{t|chk|a1=1|t1=амаравкэвагыргын|tl1=amaravkevagyrgyn}} {{t|si|a1=1|t1=සමය|tl1=sāmaya}} {{t|ko|t1=평화|tl1=pyeong-hwa}} {{t|co|a1=1|t1=pace|t2=paci}} {{t|cr|a1=1|t1=ᐌᑕᔅᑭᐎᓐ|tl1=wētaskiwin|t2=ᒌᔮᒣᐃᑕᒨᓐ|tl2=ćīyāmēitamōn}} {{t|ht|a1=1|t1=lapé}} {{t|da|a1=1|t1=fred}} {{t|umu|i1=s|t1=achwangundowagan}} {{t|din|a1=1|t1=dɔɔr}} {{t|dua|a1=1|t1=musango}} {{t|efi|a1=1|t1=emen}} {{t|egy|a1=1|t1=hetep}} {{t|sk|a1=1|t1=mier}} {{t|sl|a1=1|t1=mir}} {{t|eo|a1=1|t1=paco}} {{t|et|a1=1|t1=rahu}} {{t|eu|a1=1|t1=bake}} {{t|ewo|a1=1|t1=foè}} {{t|fan|a1=1|t1=mvoghé}} {{t|fo|a1=1|t1=friður}} {{t|fi|a1=1|t1=rauha}} {{t|fj|a1=1|t1=vakacegu}} {{t|fon|a1=1|t1=fífá}} {{t|fr|a1=1|t1=paix|g1=f}} {{t|fur|a1=1|t1=pac}} {{t|fy|a1=1|t1=frede}} {{t|gaa|a1=1|t1=hejole}} {{t|cy|t1=hedd|t2=heddwch}} {{t|gd|a1=1|t1=sìth}} {{t|gl|a1=1|t1=paz}} {{t|ka|t1=მშვიდობა|tl1=mšvidoba}} {{t|got|a1=1|t1=|tl1=friþu}} {{t|grc|t1=εἰρήνη}} {{t|el|t1=ειρήνη}} {{t|gn|a1=1|t1=ñerane'i|t2=moñera'ÿ|t3=py'guapy}} {{t|gu|t1=shanti}} {{t|ha|t1=lùmana}} {{t|haw|t1=malu|t2=maluhia|t3=la‘i}} {{t|he|t1=שלום|a1=1|tl1=shalom}} {{t|hz|a1=1|t1=o-hange}} {{t|hil|a1=1|t1=paghidaet}} {{t|hi|t1=शांति|tl1=šānti}} {{t|mww|a1=1|t1=kev thajyeeb nyab xeeb|t2=kev sib haum xeeb}} {{t|hu|a1=1|t1=béke}} {{t|io|a1=1|t1=paco}} {{t|ig|a1=1|t1=ùdo}} {{t|ilo|a1=1|t1=kappia}} {{t|id|a1=1|t1=damai|t2=perdamaian}} {{t|ang|a1=1|t1=friþ|t2=griþ|t3=sibb}} {{t|en|a1=1|t1=peace}} {{t|ia|a1=1|t1=pace}} {{t|iu|t1=ᑐᑦᑭᐳᓐ|tl1=totkipon}} {{t|ik|a1=1|t1=kiñuiñak}} {{t|ga|a1=1|t1=síocháin}} {{t|is|a1=1|t1=kyrrð|g1=f|a2=1-2|t2=friður|g2=m}} {{t|it|a1=1|t1=pace|g1=f}} {{t|ja|t1=平和|t2=へいわ|nota2=heiwa}} {{t|jv|a1=1|t1=rukun rahayuning gesang}} {{t|lad|a1=1|t1=pesc}} {{t|kn|a1=1|t1=shanti}} {{t|kr|a1=1|t1=kelafia}} {{t|kk|a1=1|t1=бейбичилик|tl1=beybiychiyliyk}} {{t|ki|a1=1|t1=thayũ|t2=ngemba}} {{t|ky|a1=1|t1=tyntschtyk}} {{t|tlh|a1=1|t1=roj}} {{t|kok|a1=1|t1=soukaasaai}} {{t|ku|a1=1|t1=aştî|g1=f}} {{t|lo|a1=1|t1=ສັນຕິພາບ}} {{t|la|a1=1|t1=pax|g1=f}} {{t|lv|a1=1|t1=miers|g1=m}} {{t|ln|a1=1|t1=bobóto|t2=kímyá|a3=1|t3=bognilé}} {{t|lt|a1=1|t1=taika}} {{t|jbo|a1=1|t1=kampanpi}} {{t|lb|a1=1|t1=Fridden}} {{t|ml|a1=3|t1=സമാധാനം}} {{t|mt|a1=1|t1=paċi}} {{t|ms|a1=1|t1=мир}} {{t|mg|a1=1|t1=fiadanana}} {{t|gv|a1=1|t1=shee}} {{t|mi|a1=1|t1=whakaaio}} {{t|arn|a1=1|t1=kemelen|t2=uvchin}} {{t|mh|a1=1|t1=aenomman}} {{t|yua|a1=1|t1=ets'a'an'olal}} {{t|mic|a1=1|t1=wôntôkóde}} {{t|lol|a1=1|t1=boóto}} {{t|mn|a1=1|t1=энх тайван}} {{t|mos|a1=1|t1=lafi}} {{t|nhn|t1=tlamatcanemiliztli}} {{t|na|a1=1|t1=iow}} {{t|nv|a1=1|t1=k'é}} {{t|nl|a1=1|t1=vrede|t2=vree}} {{t|ne|a1=1|t1=शनत}} {{t|nez|i1=s|t1='éyewi}} {{t|niu|a1=1|t1=mafola}} {{t|nb|a1=1|t1=fred}} {{t|nn|a1=1|t1=fred}} {{t|nov|a1=1|t1=pase}} {{t|oc|a1=1|t1=patz}} {{t|or|a1=1|t1=santi}} {{t|ote|a1=1|t1=hmetho}} {{t|om|a1=1|t1=nagaa}} {{t|pau|a1=1|t1=búdech}} {{t|pi|a1=1|t1=nirudho}} {{t|pag|a1=1|t1=kareenan}} {{t|pa|a1=1|t1=ਸਤ}} {{t|pap|a1=1|t1=pas}} {{t|ps|a1=1|t1=صلح}} {{t|pon|a1=1|t1=meleilei}} {{t|fa|a1=1|t1=آشتی|t2=fa صلح|a2=3}} {{t|pl|a1=1|t1=pokój|t2=spokój}} {{t|pt|a1=1|t1=paz}} {{t|pim|t1=cohqwaivwh}} {{t|qu|t1=sunqu tiaykuy|t2=qasikay}} {{t|qya|a1=1|t1=}} {{t|rap|a1=1|t1=pava}} {{t|rom|a1=1|t1=shand}} {{t|rw|a1=1|t1=amahoro|t2=horo|t3=nimuhóre}} {{t|rm|a1=1|t1=pasch}} {{t|ro|t1=pace|g1=f}} {{t|ru|t1=мир}} {{t|sma|a1=1|t1=raeffie}} {{t|se|a1=1|t1=ráfi}} {{t|sms|a1=1|t1=rääuh}} {{t|sm|a1=1|t1=filamu}} {{t|sg|a1=1|t1=siriri}} {{t|sa|a1=1|t1=स्वास्थ्य|tl1=svāsthya|t2=शान्ति|tl2=śānti|a3=2|t3=संधि|tl3=sa.mdhi}} {{t|sc|a1=1|t1=paghi}} {{t|sas|a1=1|t1=aman}} {{t|sh|a1=1|t1=mir}} {{t|st|t1=kgotso|t2=khotso}} {{t|tn|a1=1|t1=kagisô|a2=1|t2=khotso}} {{t|sn|a1=1|t1=runyaro}} {{t|sjn|a1=1|t1=}} {{t|so|a1=1|t1=nabad-da|t2=nabadu}} {{t|snk|a1=1|t1=jamu}} {{t|sv|a1=1|t1=fred}} {{t|sw|t1=amani}} {{t|ss|a1=1|t1=kgòtsò|a2=1|t2=kuthula}} {{t|tl|a1=1|t1=katahimíkan|t2=mabuhay|t3=kapayapaan|t4=katahimikan}} {{t|ty|a1=1|t1=hau}} {{t|th|t1=สันติภาพ}} {{t|ta|t1=அமைதி|tl1=amaiti/omoyti|t2=சமாதானம்|tl2=ćamātānama/ćomātānomo}} {{t|tt|a1=1|t1=дуслик}} {{t|tg|a1=1|t1=сулҳ}} {{t|bo|t1=ཞི་བདེ་ནི་}} {{t|ti|a1=1|t1=selam}} {{t|tli|a1=1|t1=li-k'ei}} {{t|tpi|t1=taim}} {{t|to|a1=1|t1=melino}} {{t|tmh|a1=1|t1=əlxer}} {{t|tpn|a1=1|t1=tecócatú}} {{t|tr|t1=barış|t2=sulh}} {{t|tk|a1=1|t1=asudalyk}} {{t|ak|t1=asomdwie|a1=1}} {{t|uk|a1=1|t1=мир}} {{t|ug|a1=1|t1=saq}} {{t|ur|t1=امن}} {{t|uz|a1=1|t1=тинчлик}} {{t|wa|a1=1|t1=påye}} {{t|vi|t1=hòa bình}} {{t|vo|a1=1|t1=püd}} {{t|wo|t1=jaama|t2=jàmm}} {{t|xh|t1=uxolo}} {{t|yi|t1=פרידן|tl1=fridn|t2=שלום|tl2=sholem}} {{t|yo|a1=1|t1=àlãfíà}} {{t|esu|a1=1|t1=илакулъык'}} {{t|zai|a1=1|t1=layéni}} {{t|zu|t1=ukuthula}} {{trad-abajo}} == {{lengua|an}} == {{pron-graf|leng=an}} === Etimología 1 === {{etimología|leng=an}}. ==== {{sustantivo|an}} ==== ;1: {{plm}}. ==== Véase también ==== {{W|idioma=an}} == {{lengua|ast}} == {{pron-graf|leng=ast}} === Etimología 1 === {{etimología|leng=ast}}. ==== {{sustantivo femenino|ast}} ==== ;1: {{plm}}. ==== Véase también ==== {{W|idioma=ast}} == {{lengua|br}} == {{pron-graf|leng=br|1fono1=ˈpɑːs}} === Etimología 1 === {{etimología|leng=br}}. ==== {{sustantivo masculino|br}} ==== {{br.sust|irreg|paziou}} ;1 {{csem|medicina|leng=br}}: {{plm|tos}}. ;2: {{plm|paso}}. ==== Véase también ==== {{W|idioma=br}} == {{lengua|gl}} == {{pron-graf|leng=gl}} === Etimología 1 === {{etimología|leng=gl}}. ==== {{sustantivo|gl}} ==== ;1: {{plm}}. ==== Véase también ==== {{W|idioma=gl}} == {{lengua|pt}} == {{pron-graf|leng=pt|2audio=Pt paz.ogg|2audio2=LL-Q5146 (por)-Santamarcanda-paz.wav}} === Etimología 1 === {{etimología|leng=pt|la|pax|alt=pāx}}. ==== {{sustantivo femenino|pt}} ==== {{pt.sust}} ;1: {{plm}}. ==== Refranes ==== * {{l|pt|se queres a paz prepara a guerra}} ==== Véase también ==== {{w|idioma=pt}} == Referencias y notas == <references /> 1crh7kv3jlvm2bnbd9h445zuw3ftqzo real 0 22323 6076713 5920749 2026-04-05T03:30:26Z Tmagc 158167 6076713 wikitext text/x-wiki {{desambiguación|Real}} == {{lengua|es}} == {{pron-graf}} === Etimología 1 === {{etimología|la|regalis}}, y este de {{l+|la|rex}}, "[[rey]]", y en última instancia del protoindoeuropeo {{l+|ine-pro|*h₃rēǵs}}, "[[soberano]], [[rey]]" ==== {{adjetivo|es}} ==== {{es.adj|ng}} ;1: Propio de o relativo al [[rey]], la [[realeza]] o el [[reino]] ;2: Por extensión, [[digno]] de un rey {{sinónimo|opulento|regio|suntuoso}}. ;3: Por extensión, [[útil]] o [[agradable]] en su [[género]] {{uso|coloquial}} {{sinónimo|excelente}}. ;4: Dicho de una persona o bando, [[partidario]] de la realeza {{uso|utcs}} {{sinónimo|realista}}. ;5 {{csem|náutica}}: Dicho de un navío, que porta el [[estandarte]] del rey ;6 {{csem|náutica}}: Dicho de un navío de guerra, de tres puentes y al menos 120 cañones {{uso|obsoleto}} ;7: Que existe, ajustado a la [[realidad]]. {{sinónimo|auténtico|verdadero}} {{antónimo|fantasioso|fantástico|ilusorio|imaginario|quimérico}} ==== {{sustantivo masculino|es}} ==== {{es.sust}} ;8 {{csem|monedas}}: {{plm|unidad}} [[monetario|monetaria]] del Brasil ;9 {{csem|monedas}}: Moneda venezolana equivalente a 50 céntimos de [[bolívar]] ;10 {{csem|monedas}}: Antigua moneda española y portuguesa de la época colonial, equivalente a un cuarto de [[peseta]] ;11 {{csem|monedas}}: Antigua moneda mexicana del siglo XIX, equivalente a un octavo de [[peso]] ;12 {{csem|monedas}}: Por antonomasia, dinero en efectivo {{uso|coloquial}} {{ámbito|Venezuela}} {{sinónimo|chavos|churupos|ñere ñere|nota1=Puerto Rico|nota2=Venezuela, coloquial|nota3=Venezuela, coloquial}} ==== Locuciones ==== {{trad-arriba|Locuciones con «real»}} * [[real cañada]] * [[real de a cincuenta]] * [[real de a cuatro]] * [[real de a dos]] * [[real de a ocho]] * [[real de agua]] * [[real de ardite]] * [[real de minas]] * [[real de plata]] * [[real de plata doble]] * [[real de plata vieja]] * [[real de vellón]] * [[real decreto]] * [[real fontanero]] * [[real fuerte]] * [[real orden]] * [[real sitio]] * [[real valenciano]] * [[águila real]] * [[alférez del pendón real]] * [[ánade real]] * [[aparejo real]] * [[brazo real]] * [[cabaña real]] * [[camino real]] * [[capellán real]] * [[capilla real]] * [[carabineros reales]] * [[carga real]] * [[carta real]] * [[casa real]] * [[cemento real]] * [[chillón real]] * [[cimiento real]] * [[codo real]] * [[Consejo Real]] * [[consuelda real]] * [[consólida real]] * [[corona real]] * [[coronilla real]] * [[cuartel real]] * [[cuchillada de cien reales]] * [[cuco real]] * [[cédula real]] * [[díctamo real]] * [[endecha real]] * [[escala real]] * [[escalera real]] * [[estandarte real]] * [[Estatuto Real]] * [[estoque real]] * [[facultad real]] * [[fiestas reales]] * [[garza real]] * [[granada real]] * [[grillo real]] * [[guarda mayor del cuerpo real]] * [[hila real de agua]] * [[jazmín real]] * [[laurel real]] * [[león real]] * [[malva real]] * [[manjar real]] * [[manta real]] * [[marcha real]] * [[marcha real fusilera]] * [[marco real]] * [[muelle real]] * [[método real]] * [[octava real]] * [[oficial real]] * [[ordenamiento real]] * [[palma real]] * [[paloma real]] * [[pato real]] * [[patrimonio real]] * [[patronato real]] * [[pavo real]] * [[perdiz real]] * [[peso real]] * [[pinzón real]] * [[privilegio real]] * [[romance real]] * [[secansa real]] * [[sitio real]] * [[tablas reales]] * [[tapia real]] * [[tercera real]] * [[tercias reales]] * [[vale real]] * [[zorzal real]] * [[con mi real y mi pala]] * [[no valer un real]] * [[por cuatro reales]] * [[un real sobre otro]] {{trad-abajo}} ==== Información adicional ==== {{femenino|reginal}} ==== Traducciones ==== {{trad-arriba}} {{t|ast|a1=8–12|t1=real}} {{t|br|a1=7|t1=gwir}} {{t|bg|a1=1–2|t1=кралски|t2=царски}} {{t|ca|a1=1–2|a2=7–10|a3=11|g2=m|g3=m|g4=m|n3=p|n4=p|t1=reial|t2=real|t3=diners|t4=cèntims}} {{trad-abajo}} === Etimología 2 === {{etimología|la-lat|realis}}, y este de {{l+|la|res}}, "[[cosa]]". ==== {{adjetivo|es}} ==== {{es.adj|ng}} ;1: Propio de, relativo a o perteneciente a la [[realidad]] {{antónimo|conceptual|ficticio|ideal|imaginario}} ;2 {{csem|matemática}}: Dicho de un número: que está apoyado completamente sobre la recta real y así mismo forma [[cuerpo]] con el resto de [[número real|números reales]]. {{cohipónimo|imaginario}} ==== Locuciones ==== {{trad-arriba|Locuciones con «real»}} * [[activo real]] * [[cantidad real]] * [[contrato real]] * [[derecho real]] * [[foco real]] * [[imagen real]] * [[número real]] * [[parte real]] {{trad-abajo}} ==== Traducciones ==== {{trad-arriba}} {{t|bg|a1=1|t1=действителен|t2=реален}} {{t|sga|a1=1|t1=derb}} {{trad-abajo}} === Etimología 3 === {{etimología|xaa|raḥál|campamento}}, y este del clásico {{l+|ar|رحل}} (''raħl''). Compárese {{l+|es|almirante}} ==== {{sustantivo masculino|es}} ==== {{es.sust}} ;1: {{plm|campamento}} de una [[fuerza]] [[armada]], en especial la que incluye los aposentos del [[comandante]] ;2: Por extensión, [[predio]] donde se celebra una [[feria]] ==== Locuciones ==== * [[asentador de real]] * [[asentamiento de real]] * [[alzar el real]] * [[alzar los reales]] * [[asentar los reales]] * [[como a real de enemigo]] * [[levantar el real]] * [[sentar el real]] * [[sentar los reales]] ==== Traducciones ==== {{trad-arriba}} {{trad-abajo}} == {{lengua|de}} == {{pron-graf|leng=de|1fone1=ʀeˈaːl|2fone1=reˈaːl|2pron1=Austria/Baviera}} === Etimología === {{etimología|leng=de|la-lat|realis}}, y este de {{l+|la|res}}, "[[cosa]]".<ref>{{DWDS}}</ref> === {{adjetivo|de}} === ;1: {{plm}} (propio de o perteneciente a la realidad). {{sinónimos|leng=de|wirklich}} {{antónimos|leng=de|imaginär}} === Declinación === {{de.adj|comp=+}} == {{lengua|ca}} == {{pron-graf|leng=ca}} === Etimología === {{etimología|leng=ca|la-lat|realis}}, y este de {{l+|la|res}}, "[[cosa]]". === {{adjetivo|ca}} === {{ca.adj}} ;1: {{plm}}. == {{lengua|en}} == {{pron-graf|leng=en|1audio4=en-uk-real.ogg|1audio5=LL-Q1860 (eng)-Back ache-real.wav|1aunota4=Londres|1aunota5=Londres|1fone4=ɹɪɫ|1fono1=ˈɹiː.əl|1fono2=ɹiːl|1fono3=ɹɪə̯l|1pron1=Reino Unido, Australia|2audio5=en-us-real.ogg|2audio6=LL-Q1860 (eng)-Wodencafe-real.wav|2audio7=LL-Q1860 (eng)-Grendelkhan-real.wav|2aunota5=California|2aunota6=Texas|2aunota7=Connecticut|2fone5=ɹɪɫ|2fono1=ˈɹi.əl|2fono2=ɹil|2fono4=ɹɪə̯l|2pron1=EE. UU., Canadá|h1=reel|hnota1=algunos acentos|ls=1}} === Etimología === {{etimología|leng=en|enm|real}}, {{etim|leng=en|fro|reel}}, {{etim|leng=en|la-lat|realis|real|alt=reālis}}, y a su vez de {{l+|la|res|rēs|glosa=cosa}}. === {{adjetivo|en}} === {{en.adj|cl}} ;1: {{plm}} (propio de o perteneciente a la realidad). {{antónimo|leng=en|unreal}}. === {{sustantivo|en}} === {{en.sust|c}} ;2: {{plm|número real}}. ;3 {{csem|leng=en|monedas}}: {{plm}} (moneda de Brasil). === {{adverbio|en}} === {{en.adv|inc}} ;4: {{plm|mucho}}, [[extremadamente]]. {{uso|leng=en|coloquial}} == {{lengua|pt}} == {{pron-graf|leng=pt}} === Etimología 1 === {{etimología|leng=pt|la|regalis}}, y este de {{l+|la|rex}}, "[[rey]]", y en última instancia del protoindoeuropeo {{l+|ine-pro|*h₃rēǵs}}, "[[soberano]], [[rey]]" ==== {{adjetivo|pt}} ==== {{pt.adj}} ;1: {{plm}}. ==== {{sustantivo masculino|pt}} ==== {{pt.sust}} ;2 {{csem|leng=pt|monedas}}: {{plm}}. === Etimología 2 === {{etimología|leng=pt|la-lat|realis}}, y este de {{l+|la|res}}, "[[cosa]]". ==== {{adjetivo|pt}} ==== {{pt.adj}} ;1: {{plm}}. == Referencias y notas == <references /> 0yrhtripl5xco9pxprc5rgow4q0d2e2 terra 0 25956 6076703 6072798 2026-04-05T02:46:05Z TMCbot 164594 . 6076703 wikitext text/x-wiki {{desambiguación|tera|téra|Tera|terá|terä|tera-|téra-|tērā|Terra|}} == {{lengua|ca}} == {{pron-graf|leng=ca|2pron1=Occidental|1pron1=Oriental}} === Etimología === {{etimología|leng=ca|la|terra}}. === {{sustantivo|ca|femenino}} === {{ca.sust|f}} ;1: {{plm|tierra}}. === Véase también === {{w|leng=ca}} == {{lengua|gl}} == {{pron-graf|leng=gl}} === Etimología === {{etimología|leng=gl|la|terra}}. === {{sustantivo femenino|gl}} === {{gl.sust}} ;1: {{plm|tierra}}. === Véase también === {{w|leng=gl}} == {{lengua|it}} == {{pron-graf|leng=it}} === Etimología === {{etimología|leng=it|la|terra}}<ref>{{Pianigiani}}</ref>. === {{sustantivo|it|femenino}} === {{it.sust|f}} ;1: {{plm|tierra}}. === Véase también === {{w|leng=it}} == {{lengua|la}} == {{pron-graf|leng=la}} === Etimología === {{etimología|leng=la}} === {{sustantivo femenino|la}} === ;1: {{plm|tierra}} (superficie emergida). {{antónimo|leng=la|mare}}. {{sinónimo|leng=la|tellus}}. ;2: {{plm|tierra}}, [[suelo]]. {{sinónimo|leng=la|solum}}. {{antónimo|leng=la|caelum}}. ;3: {{plm|tierra}} (material). {{sinónimo|leng=la|humus}}. ;4: {{plm|tierra}}, [[región]]. {{sinónimo|leng=la|regio}}. ;5 {{csem|leng=la|astronomía}}: [[Tierra]] (planeta). {{sinónimo|leng=la|tellus}}. === Véase también === {{w|leng=la}} === Declinación === {{la.sust|terra.1}} == {{lengua|pt}} == {{pron-graf|leng=pt|1audio1=LL-Q5146 (por)-Juliano P. Junho (Jjunho)-terra.wav|2audio1=LL-Q5146 (por)-Santamarcanda-terra.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-terra.wav}} === Etimología === {{etimología|leng=pt|la|terra}}. ==== {{sustantivo femenino|pt}} ==== {{pt.sust}} ;1 {{csem|leng=pt|geografía}}: {{plm|tierra}}. ==== Véase también ==== {{w|leng=pt}} == {{lengua|rm}} == {{pron-graf|leng=rm}} === Etimología === {{etimología|leng=rm|la|terra}}. === {{sustantivo|rm}} === ;1: {{plm|tierra}}. == Referencias y notas == <references /> 0uaspeqv7000qi7zav7r67smxoyq0mh dia 0 25976 6076655 5921623 2026-04-05T02:44:05Z TMCbot 164594 . 6076655 wikitext text/x-wiki {{desambiguación|día}} == {{lengua|ca}} == {{pron-graf|leng=ca}} === Etimología === {{etimología|leng=ca|la|dies}}. === {{sustantivo|ca|masculino}} === {{ca.sust|m}} ;1 {{csem|leng=ca|tiempo}}: {{plm|día}} (24 horas). {{relacionado|leng=ca|diari|jornada}} ;2 {{csem|leng=ca|tiempo}}: {{plm|día}} (período entre el amanecer y el ocaso). {{antónimo|leng=ca|nit}} {{relacionado|leng=ca|diürn|eclipsi|jornada}} === Refranes === * {{l|ca|Roma no es pogué fer en un dia}} === Véase también === {{w|leng=ca}} == {{lengua|ga}} == {{pron-graf|leng=ga|fone=ˈdiɐ}} === Etimología 1 === {{etimología|leng=ga}}. ==== {{sustantivo masculino|ga}} ==== ;1 {{csem|leng=ga|mitología}}: {{plm|dios}}, [[deidad]]. ==== Véase también ==== {{w|leng=ga}} ==== Declinación ==== {{ga.sust|m-irreg|dia|dé|déithe|déithe|dat_pl=déithibh}} === Etimología 2 === {{etimología|leng=ga}}. ==== {{sustantivo|ga}} ==== ;1 {{csem|leng=ga|tiempo}}: {{plm|día}}. {{uso|leng=ga|literario|nota=excepto en su forma adverbializada {{l+|ga|dé}}, que sustituye a {{l+|ga|lá}} con los días de la semana: {{l+|ga|Máirt|glosa=martes}} → ''Dé Máirt'' ("en martes; el martes")}} {{sinónimo|leng=ga|lá}} ==== {{adverbio|ga}} ==== ;2 {{csem|leng=ga|tiempo}}: El día de, en el día de. {{variante|leng=ga|dé}} {{relacionado|leng=ga|lá}} ==== Declinación ==== {{ga.sust|m-irreg|dia|dé|déithe|déithe|dat_pl=déithibh}} == {{lengua|lfn}} == {{pron-graf|leng=lfn}} === Etimología === {{etimología|leng=lfn}}. === {{sustantivo|lfn}} === {{lfn.sust}} ;1: {{plm|día}}. == {{lengua|oc}} == {{pron-graf|leng=oc}} === Etimología === {{etimología|leng=oc}}. === {{sustantivo|oc}} === ;1 {{csem|leng=oc|tiempo}}: {{plm|día}}. == {{lengua|pt}} == {{pron-graf|leng=pt|2audio=LL-Q5146 (por)-Santamarcanda-dia.wav|1audio1=LL-Q5146 (por)-Sillim-dia.wav}} === Etimología === {{etimología|leng=pt|la|dia}}.<ref>{{MICHAELIS}}</ref> === {{sustantivo masculino|pt}} === {{pt.sust}} ;1 {{csem|leng=pt|tiempo}}: {{plm|día}}. === Locuciones === * {{l|pt|Dia das Mães}} * {{l|pt|qualquer dia desses}} === Véase también === {{w|leng=pt}} == Referencias y notas == <references /> 467fsofcbqk8b1z13ray1573h0ualkg pluma 0 26060 6076732 5946338 2026-04-05T06:57:31Z Apisite 115465 /* Traducciones */ + Volapük 6076732 wikitext text/x-wiki == {{lengua|es}} == {{pron-graf|1audio1=LL-Q1321 (spa)-Rodelar-pluma.wav}} === Etimología 1 === {{etimología|la|pluma}}, y esta {{etim|ine-pro|*pleus-}}.<ref name="auto_ref_id_1">{{Mallory}}</ref> Compárese el francés {{l+|fr|plume}}, o para cognados más remotos, el inglés {{l+|en|fleece}} o el lituano {{l+|lt|plùskos}}. [[Archivo:Pen (AM 686187-1).jpg|thumb|[3]]] [[Archivo:Dip pens and penholders.jpg|thumb|[4]]] [[Archivo:The write thing Project 365(2) Day 12 (4355765412).jpg|thumb|[5]]] ==== {{sustantivo femenino|es}} ==== {{es.sust}} ;1: Cada una de las piezas córneas con un tubo central y ramillas laterales que conforman una suerte de hoja alargada, que en gran cantidad recubren el cuerpo de las aves. Les dan protección, aislamiento térmico y son de utilidad para el vuelo. ;2: Conjunto de estas piezas córneas, cuando son utilizadas en rellenos de vestimenta, cojines y otros objetos. ;3: Pluma{{subíndice|1}} de ave, convenientemente cortada en su punta, que antiguamente se usaba para escribir. ;4: Instrumento metálico que reemplazó a la pluma{{subíndice|3}} de ave para escribir: tiene un mango de cualquier material (llamado [[portaplumas]]), y un punta metálica ([[plumilla]]) que se divide por donde va corriendo la tinta cuando se escribe o dibuja. La [[tinta]] se toma de un [[tintero]]. ;5: Instrumento para escribir que evolucionó del anterior, y que incorpora un [[cartucho]] de [[tinta]] [[recargable]]. {{sinónimo|pluma estilográfica}}. ;6: {{plm|punta}} metálica de estos instrumentos para escribir. {{sinónimo|plumín|plumilla}} ;7: Pluma natural de ave o imitación de ella, usada como adorno. ;8: {{plm|adorno}} hecho con una o más de estas plumas. ;9: Habilidad para escribir con una bella letra. ;10: Forma característica de escribir que posee un escritor. {{sinónimo|estilo}}. ;11: {{plm|escritor}} confirmado. {{sinónimo|autor}}. ;12: Oficio o [[profesión]] de escritor. ;13: Técnica de [[dibujo]] que utiliza finos trazos hechos con tinta negra y pluma. ;14: Llave para dar paso o cortar el paso del agua. {{ámbito|Colombia|Cuba|Panamá|Puerto Rico}} {{sinónimo|canilla|grifo|llave}}. ;15: Estructura vertical de una grúa. {{sinónimo|mástil}}. ;16: {{plm|viruta}} de madera producida por el [[torno]]. ;17: {{plm|concha}} interna de los cefalópodos, como el calamar, cuyo aspecto recuerda un poco a la pluma de un ave. ;18: Conducta con rasgos afeminados. {{ámbito|España}} {{uso|coloquial}} {{sinónimo|amaneramiento}}. ;19: Gas expelido por el ano. {{ámbito|España|México}} {{uso|coloquial}} {{sinónimo|pedo|ventosidad}}. ;20: {{plm|cebo}} artificial con diversas formas usado para la pesca con caña. ;21: Barrera que se levanta o baja para dejar pasar o detener a los automóviles, usada en sitios de peaje y control. {{ámbito|México|El Salvador}} ;22: Pequeña vara metálica móvil, con borde de goma, que tienen los automóviles en sus parabrisas delanteros para barrer las gotas de lluvia y limpiarlos. {{ámbito|México}} {{sinónimo|limpiaparabrisas}}. ;23: {{plm|uña}} de plástico o hueso usada para tocar la guitarra y otros instrumentos. {{ámbito|México}} {{sinónimo|uñeta}}. ;24: {{plm|acusación}} destinada a manchar la honra de un persona. {{ámbito|El Salvador}} {{sinónimo|calumnia}}. ;25: '''Plumas''' Chaqueta acolchada, impermeable y cerrada, para practicar deportes de invierno y usar en clima muy frío. {{ámbito|España}} ;26 {{csem|lgbt}}: {{plm|amaneramiento}} percibido de una persona [[homosexual]]. {{uso|coloquial}} ==== Locuciones ==== {{trad-arriba|Locuciones con «pluma»}} * [[alumbre de pluma]] * [[carne de pluma]] * [[clavellina de pluma]] * [[gente de pluma]] * [[papel pluma]] * [[pasante de pluma]] * [[peso pluma]] * [[pluma atómica]]: {{plm|bolígrafo}} (México) * [[pluma de agua]] * [[pluma de mar]]; Colonia de pólipos blancos sobre una superficie calcárea roja. * [[pluma en sangre]] * [[pluma estilográfica]] * [[pluma fuente]] * [[pluma viva]]: Pluma arrancada a un ave viva, usada para rellenar prendas y objetos. * [[al correr la pluma]]: Escrito rápidamente. * [[a vuela pluma]]: Escrito rápidamente. Hecho a la rápida. * [[como el gallo de Morón, sin plumas y cacareando]] * [[dejar correr la pluma]]: Escribir largo, extenderse. * [[echar buena pluma]]: Prosperar. * [[engalanarse con plumas ajenas]] * [[hacer a pluma y pelo]]: Hacerle a todo. * [[llevarle la pluma]] a alguien: Ser amanuense o secretario de alguien. * [[poner la pluma bien]] o mal: Expresarse bien (o mal) por escrito. * [[tomar la pluma]]: Ponerse a escribir. * [[vestirse con plumas ajenas]] * [[vivir de su pluma]]: Vivir del oficio de escritor. {{trad-abajo}} ==== Información adicional ==== '''Análisis''': Sustantivo, común, contable, concreto, individual, femenino, singular. ==== Véase también ==== {{w}} ==== Traducciones ==== {{trad-arriba}} {{t|af|t1=veer}} {{t|de|a1=1|t1=Feder}} {{t|de|t1=Füllfederhalter}} {{t|ar|g1=f|t1=ريشة|tl1=rīshâ}} {{t|az|a1=1|t1=lələk}} {{t|br|a1=1|g1=f|t1=pluñvenn}} {{t|ca|g1=f|t1=ploma}} {{t|chr|a1=1|t1=ꭴꭹꮣꮅ|tl1=ugidali}} {{t|da|t1=fjer}} {{t|fr|a1=3|a2=5|t1=plume|t2=stylo}} {{t|fy|a1=1|t1=fear}} {{t|gd|g1=f|g2=f|t1=ite|t2=cleite}} {{t|cy|g1=f|g2=m|t1=pluen|t2=plufyn}} {{t|grc|g1=n|t1=πτερόν|tl1=pterón}} {{t|gn|a1=1|a2=1|t1=tague|t2=áva}} {{t|he|g1=f|t1=נוצה|tl1=notsá}} {{t|en|t1=feather}} {{t|ga|g1=m|t1=cleite}} {{t|is|a1=1|g1=f|t1=fjöður}} {{t|it|a1=1|a2=1|g1=f|t1=piuma|t2=penna}} {{t|kuz|a1=1|t1=ackiu}} {{t|gv|g1=f|g2=f|t1=clooie|t2=fedjag}} {{t|arn|a1=1|t1=pichuñ}} {{t|nci|t1=ihhuitl}} {{t|azd|t1=iwit}} {{t|nch|t1=ijuitl}} {{t|ona|t1=sèètr}} {{t|ro|g1=f|g2=m|t1=pană|t2=fulg}} {{t|sv|t1=fjäder}} {{t|sw|t1=unyoya}} {{t|nai-tip|t1=mreem}} {{t|vo|a1=1|t1=plüm}} {{t|yag|a1=1|t1=uftúku}} {{trad-abajo}} == {{lengua|an}} == {{pron-graf|leng=an}} === Etimología 1 === {{etimología|leng=an|la|pluma}}, y esta {{etim|leng=an|ine-pro|*pleus-}}. ==== {{sustantivo femenino|an}} ==== {{an.sust}} ;1: {{plm}}. == {{lengua|gl}} == {{pron-graf|leng=gl}} === Etimología 1 === {{etimología|leng=gl|la|pluma}}, y esta {{etim|leng=gl|ine-pro|*pleus-}}. ==== {{sustantivo femenino|gl}} ==== {{gl.sust}} ;1: {{plm}}. == {{lengua|ga}} == {{pron-graf|leng=ga}} === Etimología 1 === {{etimología|leng=ga|en|plum}}, y esta {{etim|leng=ga|ang|plume}}, {{etim|leng=ga|gem-pro|*pruma}}. ==== {{sustantivo masculino|ga}} ==== ;1 {{csem|leng=ga|alimentos}}: {{plm|pruna}}, [[ciruela]]. ==== Declinación ==== {{ga.sust|m4|pluma|plumaí}} == {{lengua|la}} == {{pron-graf|leng=la}} === Etimología 1 === {{etimología|leng=la|ine-pro|*pleus-}}<ref name="auto_ref_id_1" />. Compárese el inglés antiguo {{l+|ang|fleos}}, el inglés {{l+|en|fleece}}, el lituano {{l+|lt|plùskos}} o el neerlandés {{l+|nl|vlies}}. ==== {{sustantivo femenino|la}} ==== ;1: {{plm}}, [[plumón]]. ;2: Por extensión, [[cosa]] [[insignificante]]. ;3: {{plm|pelusa}} de la primera [[barba]]. {{uso|leng=la|literario}} ;4: {{plm|escama}} de [[armadura]]. ==== Declinación ==== {{la.sust|plūma.1}} == {{lengua|oc}} == {{pron-graf|leng=oc}} === Etimología 1 === {{etimología|leng=oc|la|pluma}}, y esta {{etim|leng=oc|ine-pro|*pleus-}}. ==== {{sustantivo femenino|oc}} ==== {{oc.sust|f}} ;1: {{plm}}. == Referencias y notas == <references /> * {{Lewis&Short}} cb7j3iszr2l1obdxdwcupsbu6rjsy0s nós 0 26169 6076685 5923245 2026-04-05T02:45:15Z TMCbot 164594 . 6076685 wikitext text/x-wiki {{desambiguación|nos|NOS|ños|nòs|ñós|noś|nōs|nös|nős|nǫs|nøs|nôș}} == {{lengua|gl}} == {{pron-graf|leng=gl|ayuda=nòs}} === Etimología === {{etimología|leng=gl|roa-opt|nós|nosotros(as)}}, {{etim|la|nos|leng=gl}}, plural {{etim|leng=gl|la|ego}}. === {{pronombre personal|gl}} === ;1: {{plm|nosotros}}, {{plm|nosotras}} ''(primera persona del plural, nominativo).''<ref>{{DRAG}}</ref> {{ejemplo| Ao fin '''nós''' fixemos ben.|trad= Al final '''nosotros''' lo hicimos bien.}} ==== Declinación ==== {{gl.pron}} ==== Locuciones ==== {{trad-arriba|Locuciones con «nós»}} *[[nós mesmos]] : nosotros mismos {{trad-abajo}} == {{lengua|pt}} == {{pron-graf|leng=pt|audio=LL-Q5146 (por)-JnpoJuwan-nós.wav|audio2=LL-Q5146 (por)-Juliano P. Junho (Jjunho)-nós.wav|2audio=LL-Q5146 (por)-Santamarcanda-nós.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-nós.wav}} === Etimología === {{etimología|leng=pt|roa-opt|nos}}, {{etim|leng=pt|la|nos|alt=nōs}}. ==== {{pronombre personal|pt}} ==== ;1: {{plm|nosotros}}, {{l|es|nosotras}}. === Declinación === {{pt.pron}} == Referencias y notas == <references /> sy1krgma5l7ibllmbxnjwgteqgcxu9v onde 0 26175 6076688 6052781 2026-04-05T02:45:20Z TMCbot 164594 . 6076688 wikitext text/x-wiki {{desambiguación|ondé|ónde}} == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología|osp|onde|de donde}}, y este {{etim|la|unde|glosa=de dónde}}<ref name="DRAE">{{DRAE}}</ref>, {{etim|la|*cunde}}. Ahora visto como {{etim|aféresis|donde}}.<ref name="damer">{{Damer}}</ref> ==== {{adverbio|es|interrogativo|lugar}} ==== {{es.sust}} ;1: {{plm|donde}}.<ref name="damer"/> {{uso|coloquial|rural}} {{ámbito|América}} ;2: {{plm|de donde}} (de cualquier lugar).<ref name="DRAE">{{DRAE}}</ref> {{uso|obsoleto|anticuado}}. ;3: {{plm|en donde}} (en cualquier lugar).<ref name="DRAE">{{DRAE}}</ref> {{uso|obsoleto}}. ==== {{conjunción|es}} ==== ;4: {{plm|por lo cual}}.<ref name="DRAE">{{DRAE}}</ref> {{uso|obsoleto}}. == {{lengua|ast}} == {{pron-graf|leng=ast}} === Etimología === {{etimología|leng=ast|la|unde|de dónde}}. ==== {{adverbio|ast|lugar}} ==== ;1: {{plm|donde}}. {{sinónimo|leng=ast|u}}. == {{lengua|osp}} == {{pron-graf|leng=osp}} === Etimología === {{etimología|leng=osp|la|unde|de dónde}} {{etim|leng=osp|la|*cunde}}. ==== {{adverbio|osp|lugar}} ==== ;1: {{plm|de donde}}. {{hiperónimo|leng=osp|o}}. == {{lengua|fr}} == {{pron-graf|leng=fr|1audio1=Fr-onde.ogg|1fone1=ɔ̃d|h1=ondes}} === Etimología === {{etimología|leng=fr|frm|onde}}, y este {{etim|leng=fr|fro|onde}} o {{l+|fro|unde}}, {{etim|leng=fr|la|unda|alt=undam}}, {{etim|leng=fr|itc-pro|*udōr}}, {{l+|itc-pro|*udn-}} (compárense el umbro {{l+|xum|utur|glosa=agua|tr=acc.sg.}}, {{l+|xum|une|glosa=agua|tr=abl.sg.}}), {{etim|leng=fr|ine-pro|*ud-ōr|ine=x}}, {{etim|leng=fr|ine-pro|*ud-n-|glosa=agua}} (o bien {{etim|leng=fr|ine-pro|*wódr̥}}). ==== {{sustantivo|fr|femenino}} ==== ;1: {{ucf|onda}}, {{l|es|ola}}, {{l|es|oleada}}, {{l|es|agua}} {{l|es|agitada}}. ;2: {{plm|agua}} (especialmente el agua calmada). {{uso|leng=fr|literario}}. {{sinónimo|leng=fr|eau}}. ==== Locuciones ==== {{trad-arriba|Locuciones}} * {{l+|fr|longueur d’onde}} * {{l+|fr|onde de choc}} * {{l+|fr|onde noire}} * {{l+|fr|passer l’onde noire}} {{trad-abajo}} ==== Información adicional ==== {{derivad|ondée|onder|ondoyer|ondulateur|ondulation|onduler|ondulé|onduleur}} ==== Véase también ==== {{w|leng=fr}} == {{lengua|fro}} == {{pron-graf|leng=fro}} === Etimología === {{etimología|leng=fro|la|unda|alt=undam}}. === {{sustantivo|fro|femenino}} === {{inflect.fro.sust.f}} ;1: {{grafía|leng=fro|unde}}. == {{lengua|frm}} == {{pron-graf|leng=frm}} === Etimología === {{etimología|leng=frm|fro|unde||fro|onde}}, y estos {{etim|leng=frm|la|unda|alt=undam}}, {{etim|leng=frm|itc-pro|*udōr}}, {{l+|itc-pro|*udn-}} (compárense el umbro {{l+|xum|utur|glosa=agua|tr=acc.sg.}}, {{l+|xum|une|glosa=agua|tr=abl.sg.}}), {{etim|leng=frm|ine-pro|*ud-ōr|ine=x}}, {{etim|leng=frm|ine-pro|*ud-n-|glosa=agua}} (o bien {{etim|leng=frm|ine-pro|*wódr̥}}). ==== {{sustantivo|frm|femenino}} ==== {{inflect.frm.sust.reg}} ;1: {{ucf|onda}}, {{l|es|ola}}, {{l|es|oleada}}, {{l|es|agua}} {{l|es|agitada}}. == {{lengua|fur}} == {{pron-graf|leng=fur}} === Etimología === {{etimología|leng=fur|la|unda|alt=undam}}. ==== {{sustantivo|fur|femenino}} ==== ;1: {{ucf|onda}}, {{l|es|ola}}, {{l|es|oleada}}, {{l|es|agua}} {{l|es|agitada}}. == {{lengua|roa-opt}} == {{pron-graf|leng=roa-opt|g=unde}} === Etimología === {{etimología|leng=roa-opt|la|unde|de dónde}}, {{etim|leng=roa-opt|la|*cunde}}. ==== {{adverbio|roa-opt|lugar}} ==== ;1: {{plm|de donde}}. {{sinónimo|leng=roa-opt|donde}}. {{hiperónimo|leng=roa-opt|u}}. ;2: {{plm|donde}} u {{l|es|onde}}. {{sinónimo|leng=roa-opt|u}}. {{hipónimo|leng=roa-opt|donde}}. == {{lengua|gl}} == {{pron-graf|leng=gl}} === Etimología === {{etimología|leng=gl|roa-opt|onde|donde}}, y este {{etim|leng=gl|la|unde|glosa=de dónde}}, {{etim|leng=gl|la|*cunde}}. ==== {{adverbio|gl|lugar}} ==== ;1: {{plm|donde}}.<ref name="DRAG">{{DRAG}}</ref> ==== {{adverbio|gl|interrogativo}} ==== ;2: {{plm|dónde}}.<ref name="DRAG">{{DRAG}}</ref> {{ejemplo|E '''onde''' deixache a o noso Xeneral Mina?|trad= ¿Y '''dónde''' dejaste a nuestro general Mina?}} == {{lengua|it}} == {{pron-graf|leng=it|2fone1=ˈon̪.d̪e|1fone1=ˈon.de}} === Etimología === {{etimología|leng=it|roa-oit|onde|de donde}}, y este {{etim|leng=it|la|unde|glosa=de dónde}}, {{etim|leng=it|la|*cunde}}. ==== {{adverbio|it|lugar}} ==== ;1: {{plm|de donde}}.<ref name="Treccani">{{Treccani}}</ref> {{uso|leng=it|anticuado}}. {{sinónimo|leng=it|donde}}. {{hiperónimo|leng=it|dove|ove}}. {{relacionado|leng=it|ondeché}}. ==== {{conjunción|it}} ==== ;2: {{plm|por lo cual}}. {{uso|leng=it|anticuado}}. ;3: {{plm|para que}}. {{uso|leng=it|anticuado}}. === Forma flexiva === ==== Forma sustantiva ==== ;1: {{f.s.p|leng=it|onda}}. == {{lengua|roa-oit}} == {{pron-graf|leng=roa-oit}} === Etimología === {{etimología|leng=roa-oit|la|unde|de dónde}}, y este {{etim|leng=roa-oit|la|*cunde}}. ==== {{adverbio|roa-oit|lugar}} ==== ;1: {{plm|de donde}}. == {{lengua|lad}} == {{pron-graf|leng=lad|fgraf=ónde|v=ande}} === Etimología === {{etimología|leng=lad|osp|onde|de donde}}. ==== {{adverbio|lad|lugar}} ==== ;1: {{plm|donde}}. == {{lengua|pt}} == {{pron-graf|leng=pt|2audio1=LL-Q5146 (por)-Santamarcanda-onde.wav|2audio2=LL-Q5146 (por)-Waldyrious-onde.wav|1audio1=Pt-onde.ogg|1audio2=LL-Q5146 (por)-Sillim-onde.wav}} === Etimología === {{etimología|leng=pt|roa-opt|onde|donde}}, y este {{etim|leng=pt|la|unde|glosa=de dónde}}, {{etim|leng=pt|la|*cunde}}. ==== {{adverbio|pt|lugar}} ==== ;1: {{plm|donde}}.<ref name="Aulete">{{Aulete}}</ref> {{sinónimo|leng=pt|u|nota=obsoleta}}. {{hipónimo|leng=pt|aonde|donde}}. ==== {{adverbio|pt|interrogativo}} ==== ;2: {{plm|dónde}}. ==== Locuciones ==== {{trad-arriba|Locuciones}} * {{l+|pt|de onde a onde}} * {{l+|pt|de onde em onde}} * {{l+|pt|fazer por onde}} * {{l+|pt|onde elétrico}} * {{l+|pt|onde espacial}} * {{l+|pt|onde quer que}} * {{l+|pt|por onde}} {{trad-abajo}} ==== Información adicional ==== {{derivad|leng=pt|aonde|donde}}. == {{lengua|wa}} == {{pron-graf|leng=wa|2fone=ɔ̃p|3fone=ãt|fone=ɔ̃t}} === Etimología 1 === {{etimología|leng=wa|fro|unde||fro|onde}}, y estos {{etim|leng=wa|itc-pro|*udōr}}, {{l+|itc-pro|*udn-}} (compárense el umbro {{l+|xum|utur|glosa=agua|tr=acc.sg.}}, {{l+|xum|une|glosa=agua|tr=abl.sg.}}), {{etim|leng=wa|ine-pro|*ud-ōr|ine=x}}, {{etim|leng=wa|ine-pro|*ud-n-|glosa=agua}} (o bien {{etim|leng=wa|ine-pro|*wódr̥}}). ==== {{sustantivo|wa|femenino}} ==== ;1: {{ucf|onda}}, {{l|es|ola}}, {{l|es|oleada}}, {{l|es|agua}} {{l|es|agitada}}. {{sinónimo|leng=wa|wache|wague}}. === Etimología 2 === {{etimología|leng=wa|fro|oindre}}. ==== {{verbo|wa}} ==== ;2: {{grafía|leng=wa|oende}}. ==== Locuciones ==== {{trad-arriba|Locuciones}} * {{l+|wa|so les ondes}} {{trad-abajo}} ==== Información adicional ==== {{derivad|leng=wa|alondon|enondaedje|enonder|enondeu}}. == Referencias y notas == <references /> 4j7fax8cb9pi8jrr7z2346zkncbbkkx cinco 0 26184 6076651 5889190 2026-04-05T02:43:52Z TMCbot 164594 . 6076651 wikitext text/x-wiki == {{lengua|es}} == {{swadesh|es}} {{pron-graf|2audio1=LL-Q1321 (spa)-Rodelar-cinco.wav}} === Etimología 1 === {{etimología|la-vul|cinque|alt=cīnque}}, {{etim|la|quinque||alt=quīnque}}, {{etim|ine-pro|*pénkʷe}}. Compárese con {{l+|grc|πέντε|tr=pente}} en griego, {{l+|got|𐍆𐌹𐌼𐍆|tr=fimf}} en gótico y {{l+|en|five}} en inglés. ==== {{adjetivo cardinal|es}} ==== {{tabla-cardinal|5|ord=quinto|nprev=4|nsig=6|r=V|prev=cuatro|sig=seis}} ;1: {{plm|cuatro}} y [[uno]]. ;2: Que ocupa el quinto lugar en una serie. {{sinónimo|quinto}} {{ejemplo|El capítulo [[número]] ''cinco''.}} ;3: Que está cinco veces. Se usa delante de un sustantivo, pero también puede ir solo. {{ejemplo|Vinieron los ''cinco'' hermanos.}} {{ejemplo|Vinieron los ''cinco''.}} ==== {{sustantivo masculino|es}} ==== {{es.sust}} ;4 {{csem|números}}: Signo o signos usados para representar al número que tiene cinco unidades. {{ejemplo|En números romanos el ''cinco'' se escribre '''V''', y en números árabes es '''5'''.}} ;5 {{csem|números}}: Nombre del número '''5''', [[número natural]] que sigue al [[cuatro]] y precede al [[seis]]. ;6 {{csem|naipes}}: En las barajas, las cartas que llevan cinco marcas que indican su quinto lugar en una serie del mismo palo. {{ejemplo|Tengo el ''cinco'' de tréboles.}} ;7 {{csem|monedas}}: {{plm|moneda}} antigua de cinco [[centavo]]s. {{ámbito|Chile|México}}. ;8: Cosa de poco valor. {{ámbito|Chile}}. {{ejemplo|Ese disco rayado no vale un ''cinco''.}} ;9 {{csem|monedas}}: {{plm|moneda}} con valor de cinco [[céntimos]]. {{ámbito|Costa Rica}}. ;10 {{csem|juegos}}: Juego infantil con bolitas de cristal, barro u otro material con las que los niños hacen juegos de puntería arrojándolas unas contra otras, o tratando de introducirlas en un agujero. {{ámbito|Guatemala}}. ;11 {{csem|instrumentos musicales}}: Instrumento de cuerdas venezolano, similar a una guitarra pequeña, con cinco cuerdas. ;12 {{csem|bolos}}: Bolo que se pone frente a los otros, en el juego de bolos. ==== Locuciones ==== * [[carnero de cinco cuernos]]: * [[cinco primeras]]: En varios juegos, el hecho de ganar las cinco primeras [[baza]]s de forma consecutiva. * [[compás de cinco por ocho]]: Compás con la duración de cinco corcheas. * [[buscarle cinco pies al gato]]: ::Buscar razones o soluciones falsas y carentes de sentido ::Empeñarse en crearse dificultades en donde no las hay. * [[como tres y dos son cinco]]: Se dice de un argumento [[irredargüible]], [[irrefutable]], de una verdad absoluta. * [[con los cinco sentidos]]: ::Con toda la atención y cuidado. ::De forma eficiente. * [[decir a uno cuantas son cinco]]: {{plm|conminar}}, [[amenazar]] (España) * [[esos cinco|esos]] o [[los cinco]]: los cinco dedos de una mano, y por extensión, la mano misma * [[estar sin cinco]] o [[estar sin un cinco]]: Sin dinero. * [[no tener ni cinco]]: No tener dinero. * [[no vale un cinco]]: No valer gran cosa. * tener o [[poner los cinco sentidos en]] algo o alguien: Dedicarle todo el cariño o atención. * [[quedarse sin un cinco]]: ::Sin dinero. ::Mal de salud o de ánimo. (Guatemala) ==== Información adicional ==== {{derivad|cinca|cincoenrama|cinconegritos|cincuenta|cincuentaina|cincuentañal|cincuentavo|cincuentén|cincuentena|cincuentenario|cincuenteno|cincuentín|cincuentón|cincuesma|cinquén|cinquena|cinqueno|cinqueño|cinquillo|cinquina|cinquino|decimoquinto|quince|quinceañero|quinceaños|quinceavo|quincena|quincenal|quincenario|quinceno|quincuagena|quincuagenario|quincuagésima|quincuagésimo|quincunce|quincuncial|quinto|quinzal|quinzavo|veinticinco|vigesimoquinto}}. ==== Véase también ==== {{w}} ==== Traducciones ==== {{trad-arriba}} {{t|ay|a1=1|t1=pisqa}} {{t|de|a1=1|t1=fünf|a2=4|t2=Fünfer|g2=m}} {{t|an|a1=1|t1=zinco}} {{t|ast|a1=1|t1=cincu}} {{t|az|a1=1|t1=beş}} {{t|yue|a1=1|t1=五|tl1=ng⁵}} {{t|cs|a1=1|t1=pět|a2=4, 9|t2=pětka|g2=f}} {{t|ctu|a1=1|t1=jo'p'ej}} {{t|dv|a1=1|t1=faheh}} {{t|eo|a1=1|t1=kvin}} {{t|et|a1=1|t1=viis}} {{t|fi|t1=viisi}} {{t|fr|a1=1|t1=cinq}} {{t|fy|a1=1|t1=fiif}} {{t|cy|a1=1|t1=pump}} {{t|ha|a1=1|t1=biyar}} {{t|haw|i1=s|t1=ʻelima}} {{t|hu|i1=s|t1=öt}} {{t|id|a1=1|t1=lima}} {{t|en|a1=1|t1=five}} {{t|ga|a1=1|t1=cúig}} {{t|it|a1=1|t1=cinque}} {{t|ja|a1=1|t1=五|tl1=[[ご]], [[go]]|t2=いつつ|tl2=[[itsutsu]]}} {{t|ku|a1=1|t1=pênc}} {{t|la|a1=1|t1=quinque}} {{t|jbo|a1=1|t1=mu}} {{t|cmn|a1=1|t1=五|tl1=wǔ}} {{t|mi|a1=1|t1=rima}} {{t|arn|a1=1|a2=2|t1=kechu|t2=kechuchi}} {{t|yua|a1=1|t1=joʼo}} {{t|mn|a1=1|t1=тав}} {{t|nhn|a1=1|t1=macuilli}} {{t|nci|a1=1|t1=macuilli}} {{t|ngu|a1=1|t1=makuijli}} {{t|nch|a1=1|t1=makuili}} {{t|nhw|a1=1|t1=makuili}} {{t|nhe|t1=makuilli}} {{t|nl|a1=1|t1=vijf}} {{t|fa|i1=s|t1=پنج|tl1=[[panj#Transliteración del persa|panj]]}} {{t|pl|a1=1|t1=pięć}} {{t|pt|a1=1|t1=cinco}} {{t|quz|a1=1|t1=pisqa}} {{t|qwh|t1=pitsqa}} {{t|rap|a1=1, 3|a2=5|t1=erima|t2=karima}} {{t|rhg|t1=fañs}} {{t|sa|i1=s|t1=पञ्च}} {{t|sh|a1=1|t1=pet}} {{t|tl|i1=s|t1=lima}} {{t|tok|t1=luka}} {{t|xum|a1=1|t1=𐌐𐌈𐌌𐌐𐌄}} {{t|eu|a1=1|t1=bost}} {{t|vo|i1=s|t1=lul}} {{trad-abajo}} == {{lengua|roa-opt}} == {{pron-graf|leng=roa-opt}} === Etimología 1 === {{etimología|leng=roa-opt|la|quinque|alt=quīnque|cinco}}. ==== {{adjetivo cardinal|roa-opt}} ==== ;1 {{csem|números|leng=roa-opt}}: {{plm}}. ==== Descendientes ==== {{trad-arriba|Descendientes}} {{d|gl|niv=1|d1=cinco}} {{d|pt|niv=1|d1=cinco}} {{trad-abajo}} == {{lengua|gl}} == {{swadesh|gl}} {{pron-graf|leng=gl}} {{gl.tabla-cardinal|5|ord=|nprev=4|nsig=6|r=V|prev=catro|sig=seis}} === Etimología 1 === {{etimología|leng=gl|roa-opt|cinco|cinco}}, del anterior {{l+|roa-opt|cinquo}}, y {{etim|leng=gl|la-vul|cinque|alt=cīnque}}, y esta {{etim|leng=gl|la|quinque}}. ==== {{adjetivo cardinal|gl}} ==== {{gl.adj|p}} ;1: {{plm}}.<ref>{{DRAG}}</ref> ==== {{sustantivo masculino|gl}} ==== ;2 {{csem|leng=gl|números}}: {{plm}}. {{ejemplo|En numeración romana, o cinco escríbese '''V''' e en numeración arábiga é '''5'''.}} === Véase también === {{W|idioma=gl}} [[Categoría:GL:Adjetivos]] == {{lengua|pt}} == {{swadesh|pt}} {{pron-graf|leng=pt|1audio=LL-Q5146 (por)-Juliano P. Junho (Jjunho)-cinco.wav|2audio=LL-Q5146 (por)-Santamarcanda-cinco.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-cinco.wav|2audio3=Pt 5.ogg}} === Etimología 1 === {{etimología|leng=pt|la-vul|cinque|alt=cīnque}} y este {{etim|leng=pt|la|quinque|alt=quīnque}}, {{etim|leng=pt|ine-pro|*pénkʷe}}. ==== {{adjetivo cardinal|pt}} ==== ;1 {{csem|leng=pt|números}}: {{plm}}. ==== {{sustantivo masculino|pt}} ==== {{pt.sust}} ;2 {{csem|números|leng=pt}}: {{plm}}. == Referencias y notas == <references /> denug0mock0051quodufv7xvhsmkqef pequeno 0 26186 6076691 5899122 2026-04-05T02:45:29Z TMCbot 164594 . 6076691 wikitext text/x-wiki {{desambiguación|pequeño}} == {{lengua|roa-opt}} == {{pron-graf|leng=roa-opt}} === Etimología 1 === {{etimología|leng=roa-opt|la-vul|*peccuinus|alt=*peccuīnum}}, y este {{etim|leng=roa-opt|la|*pittinus}}, posiblemente céltico. ==== {{adjetivo|roa-opt}} ==== ;1 {{csem|metrología|leng=roa-opt}}: {{plm|chico}} o {{l|es|pequeño}}. == {{lengua|gl}} == {{pron-graf|leng=gl}} === Etimología 1 === {{etimología|leng=gl|roa-opt|pequeno}}, y este del latín vulgar {{l+|la|*peccuinus|*peccuīnum}}, de {{l+|la|*pittinus|*pittīnum}}, posiblemente céltico. Compárese el castellano {{l+|la|pequeño}}, el francés {{l+|fr|petit}} y el italiano {{l+|it|piccolo}}. ==== {{adjetivo|gl}} ==== {{gl.adj}} ;1 {{csem|metrología|leng=gl}}: {{plm|chico}} o {{l|es|pequeño}}. {{sinónimo|leng=gl|baixo|breve|cativo|curto|exiguo|miúdo}}. {{antónimo|leng=gl|alto|amplo|cumprido|extenso|grande|longo}}. ;2: De poco valor o importancia. ;3: {{plm|chico}}, {{l|es|joven}}, {{l|es|niño}} o {{l|es|pequeño}}. {{sinónimo|leng=gl|novo}}. ==== {{sustantivo|gl|masculino|femenino}} ==== {{gl.sust|mf}} ;4: {{plm|cabro}}, {{l|es|chamaco}}, {{l|es|chaval}}, {{l|es|chavo}}, {{l|es|chico}}, {{l|es|muchacho}} o {{l|es|niño}}. {{sinónimo|leng=gl|cativo|neno|petís}}. ==== Locuciones ==== {{trad-arriba|locuciones}} * {{l|gl|de pequeno}} {{trad-abajo}} == {{lengua|pt}} == {{pron-graf|leng=pt|2audio1=Pt pequeno.ogg}} === Etimología 1 === {{etimología|leng=pt|roa-opt|pequeno}}, y este del latín vulgar {{l+|la|*peccuinus|*peccuīnum}}, de {{l+|la|*pittinus|*pittīnum}}, posiblemente céltico. Compárese el castellano {{l+|la|pequeño}}, el francés {{l+|fr|petit}} y el italiano {{l+|it|piccolo}}. ==== {{adjetivo|pt}} ==== {{pt.adj|sup=pequeníssimo}} ;1 {{csem|metrología|leng=pt}}: {{plm|chico}} o {{l|es|pequeno}}. {{sinónimo|leng=pt|pichinchinho|pichititinho|nota1=Acores|nota2=Brasil}}. {{antónimo|leng=pt|grande}}. ;2: {{plm|mezquino}}. {{sinónimo|leng=pt|mesquinho|reles|vil}}. ;3: De poco valor o importancia. ;4: {{plm|humilde}} o {{l|es|modesto}}. {{sinónimo|leng=pt|modesto}}. ==== {{sustantivo masculino y femenino|pt}} ==== {{pt.sust|mf}} ;5: Persona de pequeño tamaño. {{hiperónimo|leng=pt|pessoa}}. ;6: {{plm|objeto}} de importancia o tamaño reducido. {{hiperónimo|leng=pt|objeto}}. ;7: {{plm|cabro}}, {{l|es|chamaco}}, {{l|es|chaval}}, {{l|es|chavo}}, {{l|es|chico}}, {{l|es|muchacho}} o {{l|es|niño}}. {{uso|leng=pt|coloquial}}. {{sinónimo|leng=pt|criança|menino}}. ==== Locuciones ==== {{trad-arriba|locuciones}} * {{l|pt|pequeno-almoço}} * {{l|pt|pequenos lábios}} {{trad-abajo}} ==== Información adicional ==== {{derivad|leng=pt|pequenada|pequenez}} == Referencias y notas == <references /> *{{Aulete}} *{{DRAG}} 1b8araznyrk1vfhm22u1aqo8048tgi6 peixe 0 26190 6076690 5852826 2026-04-05T02:45:27Z TMCbot 164594 . 6076690 wikitext text/x-wiki == {{lengua|gl}} == {{pron-graf|leng=gl}} === Etimología === {{etimología|leng=gl}}. ==== {{sustantivo masculino|gl}} ==== {{gl.sust}} ;1 {{csem|zoología|leng=gl}}: {{plm|pez}}, [[pescado]] == {{lengua|pt}} == {{pron-graf|leng=pt|2audio=LL-Q5146 (por)-Santamarcanda-peixe.wav}} === Etimología === {{etimología|roa-opt|peixe|leng=pt}}, {{etim|la|piscis|leng=pt}}. === {{sustantivo masculino|pt}} === {{pt.sust}} ;1: {{plm|pez}}, [[pescado]] == Referencias y notas == <references /> qnnupaowyw576qfga89yb9etecol0q9 noite 0 26265 6076683 5861485 2026-04-05T02:45:12Z TMCbot 164594 . 6076683 wikitext text/x-wiki == {{lengua|gl}} == {{pron-graf|leng=gl}} === Etimología === {{etimología|leng=gl|roa-opt|noite}}, {{etim|leng=gl|la|nox|alt=noctem}}. ==== {{adverbio de tiempo|gl}} ==== ;1: {{plm|noche}}.<ref>{{DRAG}}</ref> {{ejemplo|Serían as dez da '''noite''' algo menos.|trad= Serían poco menos de las diez de la '''noche'''.}} ==== {{sustantivo femenino|gl}} ==== {{gl.sust}} ;2 {{csem|tiempo|leng=gl}}: {{plm|noche}}. === Véase también === {{W|idioma=gl}} == {{lengua|pt}} == {{pron-graf|leng=pt|audio=LL-Q5146 (por)-Sillim-noite.wav|audio2=LL-Q5146 (por)-Juliano P. Junho (Jjunho)-noite.wav|2audio=LL-Q5146 (por)-Santamarcanda-noite.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-noite.wav}} === Etimología === {{etimología|leng=pt|roa-opt|noite}}, {{etim|leng=pt|la|nox|alt=noctem}}.<ref>{{MICHAELIS}}</ref> === {{sustantivo femenino|pt}} === {{pt.sust}} ;1 {{csem|tiempo|leng=pt}}: {{plm|noche}}. == Referencias y notas == <references /> k7swb8m8wqt2ql1hhdzai10l36o2olu você 0 26307 6076708 6072962 2026-04-05T02:46:21Z TMCbot 164594 . 6076708 wikitext text/x-wiki == {{lengua|pt}} == {{pron-graf|leng=pt|1audio1=LL-Q5146 (por)-Juliano P. Junho (Jjunho)-você.wav|1audio2=LL-Q5146 (por)-Sillim-você.wav|2audio1=LL-Q5146 (por)-Santamarcanda-você.wav|1fone1=voˈse|1pron1=Brasil}} === Etimología 1 === {{etimología|leng=pt|roa-opt|vossa mercee}}, luego ''vossa mercê'' ("[[vuestro|vuestra]] [[merced]]"), con [[elisión]] en {{l+|pt|vosmecê}}, hasta la [[síncopa]] ''você''. Compárese con ''[[usted]]'' (vuestra merced) en español y el catalán {{l+|ca|vostè|glosa=usted}}. ==== {{pronombre personal|pt}} ==== {{pt.sust}} ;1: {{plm|usted}}. {{uso|semiformal}} {{ámbito|Portugal|Brasil}} {{sinónimo|o senhor}} ;2: {{plm|tú}}, [[vos]]. {{ámbito|leng=pt|Brasil}} {{sinónimo|tu}} ;3: {{plm|alguien}}, persona no especificada (equivalente a "[[uno]]" o el "[[tú]]" impersonal en español). {{ámbito|leng=pt|Brasil}}. {{ejemplo|se você não paga a conta, eles cortam o fornecimento.|trad=si no pagas la cuenta, te cortan el suministro.}} ==== Información adicional ==== * En Portugal y zonas de Brasil, ''você'' indica un grado intermedio de informalidad entre '''{{l+|pt|tu}}''' (familiar) y '''{{l+|pt|o senhor}}''' (muy formal). * En muchas partes de Brasil (especialmente en zonas del sudeste), ''você'' es el pronombre informal de segunda persona del singular, y '''{{l+|pt|tu}}''' queda relegado al lenguaje literario, religioso o arcaico. En [[Río de Janeiro]] se usa el '''{{l+|pt|tu}}''' en situaciones muy informales, pero con la forma verbal de la tercera persona del singular. * En el lenguaje informal de Brasil, ''você'' se usa como sujeto tónico, mezclado con la forma átona '''{{l+|pt|te}}'''. * La forma plural, '''{{l+|pt|vós}}''' ("[[vosotros]]") casi nunca se usa en Brasil, y hoy se limita su uso al norte de Portugal. * "Você" y '''{{l+|pt|vocês}}''', como sus contrapartes ''usted'' y ''ustedes'' en español, se usan con las formas verbales de tercera persona. ==== Declinación ==== {{pt.pron}} == Referencias y notas == <references /> mce6i2d3ssq2h48mvt792fsclf3aosz vocês 0 26309 6076709 5828249 2026-04-05T02:46:23Z TMCbot 164594 . 6076709 wikitext text/x-wiki {{desambiguación|voces|vocees|voceés}} == {{lengua|pt}} == {{pron-graf|leng=pt|ayuda=vôcês|audio=LL-Q5146 (por)-Juliano P. Junho (Jjunho)-vocês.wav|audio2=LL-Q5146 (por)-Sillim-vocês.wav|2audio=LL-Q5146 (por)-Nelson Ricardo 2500-vocês.wav|2audio2=LL-Q5146 (por)-Santamarcanda-vocês.wav}} === Etimología === {{etimología|leng=pt}}. ==== {{pronombre personal|pt}} ==== ;1: {{plm|vosotros}}, {{l|es|ustedes}}. == Referencias y notas == <references /> m96rktnh7tsa8b7vjcr323mbb3i9cph muito 0 26319 6076681 5704856 2026-04-05T02:45:07Z TMCbot 164594 . 6076681 wikitext text/x-wiki == {{lengua|es}} == {{pron-graf}} === Etimología 1 === {{etimología|la|multum}}. ==== {{adverbio de cantidad|es}} ==== ;1: {{plm|muy}}. {{uso|desusado}} ==== Traducciones ==== {{trad-arriba}} {{trad-abajo}} == {{lengua|pt}} == {{pron-graf|leng=pt|audio=LL-Q5146 (por)-Sillim-muito.wav|audio2=LL-Q5146 (por)-JnpoJuwan-muito.wav|2audio=Pt-pt-muito.oga|2audio2=LL-Q5146 (por)-Waldyrious-muito.wav|2audio3=LL-Q5146 (por)-Santamarcanda-muito.wav}} === Etimología 1 === {{etimología|la|multum|leng=pt}}. ==== {{adverbio|pt}} ==== ;1: {{plm|muy}}. ;2: {{plm|mucho}}. ==== {{pronombre indefinido|pt}} ==== ;3: {{plm|muchos}}. == Referencias y notas == <references /> 7t2fc0optyhqc0ekwqopjzfoj0kfqze dois 0 26322 6076658 5681310 2026-04-05T02:44:11Z TMCbot 164594 . 6076658 wikitext text/x-wiki == {{lengua|fax}} == {{pron-graf|leng=fax}} === Etimología === {{etimología|leng=fax}} === {{adjetivo|fax}} === ;1: {{plm|dos}}. == {{lengua|fr}} == {{pron-graf|leng=fr|fono=dwa}} === Forma verbal === ;1: Presente del modo indicativo del verbo ''[[devoir]]''. ;2: Presente del modo imperativo para la segunda personal del singular del verbo ''devoir''. [[Categoría:FR:Formas verbales]] == {{lengua|pt}} == {{pron-graf|leng=pt|audio=LL-Q5146 (por)-Sillim-dois.wav|audio2=LL-Q5146 (por)-Juliano P. Junho (Jjunho)-dois.wav|2audio=LL-Q5146 (por)-Santamarcanda-dois.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-dois.wav}} === Etimología === {{etimología|leng=pt|fone|dous}}, este {{etim|leng=pt|roa-opt|dous}}, {{etim|leng=pt|la|duo}}, {{etim|leng=pt|ine-pro|*duwóh₁}}. ==== {{adjetivo cardinal|pt}} ==== ;1: {{plm|dos}}. ==== Locuciones ==== * {{l|pt|dois a dois}}: dos a dos. == Referencias y notas == <references /> 4hbecobf848xiysky4kvqagod8d44mo três 0 26323 6076706 5681326 2026-04-05T02:46:13Z TMCbot 164594 . 6076706 wikitext text/x-wiki {{desambiguación|tres|très|trés}} == {{lengua|pt}} == {{pron-graf|leng=pt|audio=LL-Q5146 (por)-Juliano P. Junho (Jjunho)-três.wav|2audio=LL-Q5146 (por)-Santamarcanda-três.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-três.wav}} === Etimología === {{etimología|leng=pt|roa-opt|tres}}, este {{etim|leng=pt|la|tres|alt=trēs}}, {{etim|leng=pt|itc-pro|*trejes}}, {{etim|leng=pt|ine-pro|*tréyes}}. ==== {{adjetivo cardinal|pt}} ==== ;1: {{plm|tres}}. == Referencias y notas == <references /> 2wot9jspvw3l1eufehapotl564zpooy quatro 0 26324 6076694 5864238 2026-04-05T02:45:40Z TMCbot 164594 . 6076694 wikitext text/x-wiki == {{lengua|osp}} == {{pron-graf|leng=osp}} === Etimología === {{etimología|leng=osp|la|quattuor}}. === {{adjetivo cardinal|osp}} === ;1: {{plm|cuatro}}. {{ejemplo|LA plãta llamada Nauhtepotze, q̃ quiere dezir, yerua de ''quatro'' lomos, tiene muchas diferẽcias.|c=libro||a=Doctor Franciſco Hernandez|t=Quatro libros de la naturaleza y uirtudes de las plantas, y animales que eſtan receuidos en el vſo de Medicina en la Nueua Eſpaña|f=1615|l=México|u=http://www.wdl.org/es/item/7334/zoom/?q=espa%C3%B1a&qla=es&view_type=gallery#group=1&page=219|editorial=Biblioteca Digital Mundial}} == {{lengua|roa-opt}} == {{pron-graf|leng=roa-opt}} === Etimología === {{etimología|leng=roa-opt}}. === {{adjetivo cardinal|gl}} === ;1: {{plm|cuatro}} ==== Descendientes ==== {{trad-arriba|Descendientes}} {{d|gl|niv=1|d1=catro}} {{d|pt|niv=1|d1=quatro}} {{trad-abajo}} == {{lengua|pt}} == {{pron-graf|leng=pt|audio=LL-Q5146 (por)-Juliano P. Junho (Jjunho)-quatro.wav|2audio=LL-Q5146 (por)-Santamarcanda-quatro.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-quatro.wav}} === Etimología === {{etimología|leng=pt|roa-opt|quatro}}, {{etim|leng=pt|la|quattuor}}, {{etim|leng=pt|itc-pro|*kʷettwōr}}, {{etim|leng=pt|ine-pro|*kʷetwóres}}. ==== {{adjetivo cardinal|pt}} ==== ;1: {{plm|cuatro}}. ==== {{sustantivo masculino|pt}} ==== {{pt.sust}} ;2: {{plm|cuatro}}. ==== Véase también ==== {{W|idioma=pt}} == Referencias y notas == <references /> 0afhmnt09c3hbhyxzkrn8a0lryovxts mulher 0 26329 6076682 5933105 2026-04-05T02:45:08Z TMCbot 164594 . 6076682 wikitext text/x-wiki == {{lengua|pt}} == {{pron-graf|leng=pt|ayuda=mulhérh|1audio=LL-Q5146 (por)-Sillim-mulher.wav|1audio2=LL-Q5146 (por)-Juliano P. Junho (Jjunho)-mulher.wav|2audio=LL-Q5146 (por)-Santamarcanda-mulher.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-mulher.wav}} === Etimología === {{etimología|leng=pt|roa-opt|muller}} o {{l+|roa-opt|moller}}, {{etim|leng=pt|la|mulier}}. === {{sustantivo femenino|pt}} === {{pt.sust}} ;1: {{plm|mujer}}. === Locuciones === * {{l|pt|mulher de negócios}} == Referencias y notas == <references /> 84yftusomjpg31ig6nfb24hykfrv5va piolho 0 26335 6076692 5826834 2026-04-05T02:45:32Z TMCbot 164594 . 6076692 wikitext text/x-wiki == {{lengua|pt}} == {{pron-graf|leng=pt|ayuda=piôlho|2audio=LL-Q5146 (por)-Nelson Ricardo 2500-piolho.wav}} === Etimología === {{etimología|leng=pt|roa-opt|peollo}}, {{etim|leng=pt|la|pediculus|alt=pēdiculus}}. === {{sustantivo masculino|pt}} === {{pt.sust}} ;1 {{csem|leng=pt|insectos}}: {{plm|piojo}}. == Referencias y notas == <references /> 3ztz6ftd67w8rf6fgjhaegz31nn9yf0 raiz 0 26340 6076696 5828809 2026-04-05T02:45:44Z TMCbot 164594 . 6076696 wikitext text/x-wiki == {{lengua|pt}} == {{pron-graf|leng=pt|ayuda=raíz|2audio=LL-Q5146 (por)-Nelson Ricardo 2500-raiz.wav}} === Etimología === {{etimología|leng=pt}}. === {{sustantivo femenino|pt}} === {{pt.sust}} ;1: {{plm|raíz}} == Referencias y notas == <references /> rbk56sppqcspq152favdj65hj6exd1v dizer 0 26385 6076657 5908197 2026-04-05T02:44:09Z TMCbot 164594 . 6076657 wikitext text/x-wiki == {{lengua|pt}} == {{pron-graf|leng=pt|audio=LL-Q5146 (por)-MedK1-dizer.wav|audio2=LL-Q5146 (por)-Sillim-dizer.wav|2audio=LL-Q5146 (por)-Santamarcanda-dizer.wav|2audio2=LL-Q5146 (por)-Waldyrious-dizer.wav}} === Etimología 1 === {{etimología|leng=pt|la|dicere|diacrítico=dicĕre}}. ==== {{verbo transitivo|pt}} ==== ;1: {{plm|decir}}. ==== {{verbo intransitivo|pt}} ==== ;2: {{plm|decir}}. ==== Conjugación ==== {{pt.v}} == Referencias y notas == <references /> cdehpvp3lmxbdssyy0s9s6krp3vh8qb cheio 0 26406 6076649 5827973 2026-04-05T02:43:47Z TMCbot 164594 . 6076649 wikitext text/x-wiki == {{lengua|pt}} == {{pron-graf|leng=pt|2audio=LL-Q5146 (por)-Santamarcanda-cheio.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-cheio.wav}} === Etimología 1 === {{etimología|roa-opt|chẽo|leng=pt}}, y este {{etim|leng=pt|la|plenus|alt=plēnus}}. ==== {{adjetivo|pt}} ==== {{pt.adj}} ;1: {{plm|lleno}}. {{antónimo|vazio|leng=pt}} ==== Locuciones ==== * {{l|pt|estar de saco cheio}}: ''estar harto / estar aburrido'' ==== Refranes ==== * {{l|pt|de boas intenções está o inferno cheio}} == Referencias y notas == <references /> 5imoxid0xpu3o87de02k6wk5ornrm7b morar 0 29432 6076680 6039403 2026-04-05T02:45:05Z TMCbot 164594 . 6076680 wikitext text/x-wiki == {{lengua|es}} == {{pron-graf|p1=dorar|p2=llorar|p3=mirar|p4=molar|p5=moral|p6=morir|p7=orar}} === Etimología === {{etimología|osp|morar|vivir}}, y este del latín {{l+|la|moror|morārī|glosa=vaguear}}. === {{verbo intransitivo|es}} === ;1: Habitar, residir, vivir en un lugar. === Conjugación === {{es.v}} === Información adicional === {{derivad|morada|morador|moranza}} === Traducciones === {{trad-arriba}} {{t|en|t1=inhabit|t2=reside|t3=dwell}} {{trad-abajo}} == {{lengua|ast}} == {{pron-graf|leng=ast}} === Etimología === {{etimología|leng=ast|la|moror|vaguear|alt=morārī}}. === {{verbo intransitivo|ast}} === ;1: {{plm|habitar}}, {{l|es|morar}} o {{l|es|vivir}} (en un lugar).<ref name="DALA">{{DALA}}</ref> === Conjugación === {{ast.v}} == {{lengua|osp}} == {{pron-graf|leng=osp}} === Etimología === {{etimología|leng=osp|la|moror|vaguear|alt=morārī}}. === {{verbo intransitivo|osp}} === ;1: {{plm|habitar}}, {{l|es|morar}} o {{l|es|vivir}} (en un lugar). == {{lengua|roa-opt}} == {{pron-graf|leng=roa-opt}} === Etimología === {{etimología|leng=roa-opt|la|moror|vaguear|alt=morārī}}. === {{verbo intransitivo|roa-opt}} === ;1: {{plm|habitar}}, {{l|es|morar}} o {{l|es|vivir}} (en un lugar).<ref name="DDGM">{{DDGM}}</ref> == {{lengua|gl}} == {{pron-graf|leng=gl}} === Etimología === {{etimología|leng=gl|roa-opt|morar|vivir}}, y este del latín {{l+|la|moror|morārī|glosa=vaguear}}. === {{verbo intransitivo|gl}} === ;1: {{plm|habitar}}, {{l|es|morar}} o {{l|es|vivir}} (en un lugar). {{sinónimo|leng=gl|habitar|residir|vivir}}.<ref name="DRAG">{{DRAG}}</ref> === Conjugación === {{gl.v}} == {{lengua|lad}} == {{pron-graf|leng=lad}} === Etimología === {{etimología|leng=lad|osp|morar|vivir}}, y este del latín {{l+|la|moror|morārī|glosa=vaguear}}. === {{verbo intransitivo|lad}} === ;1: {{plm|habitar}}, {{l|es|morar}} o {{l|es|vivir}} (en un lugar). == {{lengua|pt}} == {{pron-graf|leng=pt|2audio1=LL-Q5146 (por)-Nelson Ricardo 2500-morar.wav|h1=murar|hnota1=Portugal}} === Etimología === {{etimología|leng=pt|roa-opt|morar|vivir}}, y este del latín {{l+|la|moror|morārī|glosa=vaguear}}.<ref name="Aulete">{{Aulete}}</ref> === {{verbo intransitivo|pt}} === ;1: {{plm|habitar}}, {{l|es|morar}} o {{l|es|vivir}} (en un lugar). {{sinónimo|leng=pt|habitar|residir|viver}}. === Conjugación === {{pt.v}} == {{lengua|ro}} == {{pron-graf|leng=ro|ayuda=morár}} === Etimología === {{etimología|leng=ro|la|molarius|alt=molārium}}, o alternativamente de {{l+|ro|moară}} y {{l+|ro|-ar}}.<ref name="dexonline">{{dexonline}}</ref> Compárense el arrumano {{l+|rup|murar}} y el castellano {{l+|es|molero}}. === {{sustantivo masculino|ro}} === ;1: {{plm|molinero}}. ;2: {{plm|gusano de la harina}}. === Véase también === {{w|leng=ro}} === Declinación === {{ro.sust|m}} == Referencias y notas == <references /> 32tlqq75i76g0unk3xlvjii2v8emrs7 fusta 0 30277 6076637 5729218 2026-04-05T02:10:35Z Tmagc 158167 /* Etimología 1 */ 6076637 wikitext text/x-wiki == {{lengua|es}} == {{pron-graf}} [[Archivo:Riding crop.jpeg|thumb|[1]]] === Etimología 1 === {{etimología|la-lat|fusta}}. {{etimología|femenino|fuste}}. ==== {{sustantivo femenino|es}} ==== {{es.sust}} ;1 {{csem|equitación}}: {{plm|varilla}} flexible, recubierta de [[tela]] o [[cuero]] y a veces rematada por una [[trenza]] de [[tiento]] o una [[aleta]] de cuero, que se emplea por los [[jinete]]s para [[azuzar]] a sus [[montura]]s. {{relacionado|arreador|guacha|látigo}}. {{ejemplo|con esos ojos estrechos, claros y fríos, tan parecidos a los tuyos, [[mirar de hito en hito|te miraba de hito en hito]]. En seguida levantó la '''''fusta''''' que llevaba siempre consigo y te atravesó la cara, una, dos, tres veces.|título=La Última Niebla/La Amortajada|capítulo=La Amortajada|fecha=2012|editorial=Planeta|páginas=115|c=libro|a=María Luisa Bombal}} ==== Véase también ==== {{w}} ==== Traducciones ==== {{trad-arriba}} {{t|de|a1=1|t1=Gerte|g1=f}} {{t|fr|a1=1|t1=cravache|g1=f}} {{t|en|a1=1|t1=crop}} {{t|it|a1=1|t1=frustino|g1=m}} {{t|nl|a1=1|t1=rijzweepje|g1=n}} {{t|pt|a1=1|t1=chibata|g1=f}} {{trad-abajo}} == {{lengua|ca}} == {{pron-graf|leng=ca}} === Etimología 1 === {{etimología|leng=ca}}. ==== {{sustantivo femenino|ca}} ==== ;1: {{plm|madera}}. == Referencias y notas == <references /> 3bgjbp0eqd20htswy0r08neuenj3y0z menina 0 30509 6076678 5826309 2026-04-05T02:45:01Z TMCbot 164594 . 6076678 wikitext text/x-wiki == {{lengua|es}} == {{pron-graf}} === Etimología 1 === {{etimología|pt|menina|significado=no}}. [[Archivo:Las_Meninas,_by_Diego_Velázquez,_from_Prado_in_Google_Earth.jpg|thumb|''La Familia de Felipe IV'', apodado '''''Las Meninas''''', de Velázquez]] ==== {{sustantivo femenino|es}} ==== {{es.sust}} ;1: Mujer puesta desde corta edad al servicio cortesano de la [[reina]] o su descendencia femenina. {{relacionado|paje}}. {{ejemplo|Huérfana a temprana edad, fue recogida y educada por su tío Luis de Alquézar, secretario del rey. Introducida en la corte, fue ''menina'' de la reina.|c=pagina|t=Especial Diario de Le�n. 100 a�os.|f=2007-03-11|u=https://web.archive.org/web/20070311211527/http://www.diariodeleon.es/especiales/2006/alatriste/noticia.jsp?CAT}} ==== Traducciones ==== {{trad-arriba}} {{trad-abajo}} == {{lengua|pt}} == {{pron-graf|leng=pt|2audio=LL-Q5146 (por)-Santamarcanda-menina.wav}} === Etimología === {{etimología|leng=pt|femenino|menino}}. ==== {{sustantivo femenino|pt}} ==== {{pt.sust}} ;1: Joven [[afeminado]]. ;2: {{plm|prostituta}}. {{ámbito|leng=pt|Portugal}} {{uso|leng=pt|jerga}} === Forma flexiva === ==== Forma sustantiva ==== ;1: {{forma sustantivo|menino|femenino|singular}}. == Referencias y notas == <references /> nz79h8e5sdv4zpx1hwvkztj7vbof3f1 desde 0 31657 6076653 6060733 2026-04-05T02:44:02Z TMCbot 164594 . 6076653 wikitext text/x-wiki == {{lengua|es}} == {{pron-graf}} === Etimología 1 === {{etimología|osp|desde|desde}}, y este {{etim|osp|de}}.<ref name="DRAE">{{DRAE2001}}</ref> ==== {{preposición|es}} ==== ;1: Preposición que indica el [[origen]] o [[inicio]] de una actividad, tanto en sentido [[locativo]], como [[cronológico]]. {{ejemplo|Voy corriendo ''desde'' aquí hasta la pared.}} {{ejemplo|Estoy trabajando ''desde'' las 8:30.}} ;2: Indica el lugar en donde se comunica, ve, oye o percibe. {{sinónimo|dende|nota=obsoleta}}. {{ejemplo|Pontificó ''desde'' el púlpito.}} {{ejemplo|''Desde'' la ventana de mi hotel veo el mar.}} {{ejemplo|Se oye ''desde'' lejos.}} ;3: Indica posterioridad. {{sinónimo|después de}}. {{ejemplo|''Desde'' el terremoto la ciudad está en ruinas.}} ;4: Indica el punto de vista o enfoque como se trata o valora un asunto. {{ejemplo|''Desde'' la perspectiva del paleontólogo la humanidad acaba de aparecer.}} ==== Locuciones adverbiales ==== *[[desde allí]]: *¿[[desde cuándo]]?: ¿A partir de cuándo? *[[desde entonces]]: *¡[[desde luego]]!: ¡[[por supuesto]]! *[[desde que]]: A partir del momento en que. *[[desde ya]]: Ahora mismo (Argentina) ==== Véase también ==== {{w}} * [[hasta]], que indica destino o final ==== Traducciones ==== {{trad-arriba}} {{t|ain|a1=1|t1=ワ}} {{t|de|t1=seit}} {{t|ast|t1=dende|t2=desde}} {{t|ca|t1=des de}} {{t|eo|t1=de}} {{t|eo|t1=el}} {{t|ext|t1=dendi|t2=endi|t3=desdi}} {{t|fax|t1=desde}} {{t|fr|a1=1|t1=depuis}} {{t|gl|t1=desde|t2=dende}} {{t|got|t1=𐌰𐍆}} {{t|got|t1=𐍆𐍂𐌰𐌼}} {{t|it|t1=da}} {{t|en|t1=from}} {{t|pt|t1=desde}} {{trad-abajo}} == {{lengua|ast}} == {{pron-graf|leng=ast}} === Etimología 1 === {{etimología|leng=ast|compuesto|des|de}}?. ==== {{preposición|ast}} ==== ;1: {{plm}}.<ref name="DALA">{{DALA}}</ref> {{sinónimo|leng=ast|dende}} == {{lengua|osp}} == {{pron-graf|leng=osp}} === Etimología 1 === {{etimología|leng=osp|compuesto|des|de}}. ==== {{preposición|osp}} ==== ;1: {{plm}} (un tiempo). ;2: {{plm}} (un lugar). {{sinónimo|leng=osp|dende}} == {{lengua|fax}} == {{pron-graf|leng=fax}} === Etimología 1 === {{etimología|leng=fax|roa-opt|desde|desde}}, y este {{etim|leng=fax|roa-opt|de}}. ==== {{preposición|fax}} ==== ;1: {{plm}} (un tiempo). == {{lengua|roa-opt}} == {{pron-graf|leng=roa-opt}} === Etimología 1 === {{etimología|leng=roa-opt|compuesto|des|de}}. ==== {{preposición|roa-opt}} ==== ;1: {{plm}} (un tiempo). ;2: {{plm}} (un lugar). {{sinónimo|leng=roa-opt|dende}} == {{lengua|gl}} == {{pron-graf|leng=gl}} === Etimología 1 === {{etimología|leng=gl|roa-opt|desde|desde}}, y este {{etim|leng=gl|roa-opt|de}}. ==== {{preposición|gl}} ==== ;1: {{plm}} (un tiempo).<ref name="DRAG">{{DRAG}}</ref> ;2: {{plm}} (un lugar).<ref name="DRAG" /> {{sinónimo|leng=gl|dende}} == {{lengua|lad}} == {{pron-graf|leng=lad|g1=דיסדי|v1=deshde|v2=דישדי}} === Etimología 1 === {{etimología|leng=lad|osp|desde|desde}}, y este {{etim|leng=lad|osp|de}}. ==== {{preposición|lad}} ==== ;1: {{plm}} (un tiempo). ;2: {{plm}} (un lugar). == {{lengua|pap}} == {{pron-graf|leng=pap}} === Etimología 1 === {{etimología|leng=pap}}. ==== {{preposición|pap}} ==== ;1: {{plm}} (un tiempo). == {{lengua|pt}} == {{pron-graf|leng=pt|ayuda=dêsde|audio=LL-Q5146 (por)-Juliano P. Junho (Jjunho)-desde.wav|2audio=LL-Q5146 (por)-Santamarcanda-desde.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-desde.wav}} === Etimología 1 === {{etimología|leng=pt|roa-opt|desde|desde}}, y este {{etim|leng=pt|roa-opt|de}}.<ref name="Aulete">{{Aulete}}</ref> ==== {{preposición|pt}} ==== ;1: {{plm}} (un tiempo). {{ejemplo|'''desde''' o dia 17 de abril.}} ;2: {{plm}} (un lugar). {{sinónimo|leng=pt|dende|nota=obsoleta}}. {{ejemplo|Percorremos tudo, '''desde''' o norte até o sul.}} ==== Locuciones ==== {{trad-arriba|locuciones}} * {{l|pt|desde então}} * {{l|pt|desde logo}} * {{l|pt|desde quando}} * {{l|pt|desde que}} {{trad-abajo}} ==== Información adicional ==== {{derivad|leng=pt|desdo}} == Referencias y notas == <references /> 5ovoedbpqthcytev1ywgunnksr9t1zg feliz 0 32574 6076663 5931658 2026-04-05T02:44:25Z TMCbot 164594 . 6076663 wikitext text/x-wiki {{desambiguación|Feliz}} == {{lengua|es}} == {{pron-graf}} === Etimología 1 === {{etimología|osp|feliz|alt=feliz, felix}}, y este {{etim|la|felix}}<ref>{{DRAE2001}}</ref>, y este {{etim|itc-pro|*fēlwī-}}, {{etim|ine-pro|*dʰeh₁li-}}, {{etim|ine-pro|*dʰeh₁l-}}.<ref>{{DeVaan|209}}</ref> Compárese el asturiano {{l+|ast|feliz}}, el catalán {{l+|ca|feliç}}, el gallego {{l+|gl|feliz}}, el italiano {{l+|it|felice}}, el portugués {{l+|pt|feliz}} o el rumano {{l+|ro|ferice}}. ==== {{adjetivo|es}} ==== {{es.adj|ng|sup=felicísimo}} ;1: Que [[sentir|siente]] [[felicidad]]. {{sinónimo|afortunado|alegre|bienaventurado|contento|dichoso|gozoso|radiante||venturoso}} {{antónimo|afligido|apenado|apesadumbrado|atribulado|compungido|desafortunado|desdichado|desgraciado|desventurado|entristecido|infeliz|infortunado|malaventurado|pesaroso|triste}} {{ejemplo|el Conde era '''''feliz''''' e su amor sería honesto e enderesçado a la defensa.|c=libro|t=Libro de la Cámara Real del príncipe don Juan, oficios de su casa y servicio ordinario|a=Gonzalo Fernández de Oviedo|f=2011-11-28|editorial=Universitat de València|isbn=9788437083728|p=342}} {{ejemplo|A Martín le salta el corazón en el pecho. Es '''''feliz'''''. Sube por Alcalá a paso picado, silbando la Madelón.|c=libro|t=La colmena|a=Camilo José Cela|f=2012|editorial=Stockcero, Inc|isbn=9781934768563|p=388}} ;2: Que [[provocar|provoca]] o [[anunciar|anuncia]] felicidad. {{sinónimo|afortunado|alegre|bienaventurado|venturoso}} {{antónimo|aciago|deplorable|desdichado|desgraciado|funesto|infausto|infeliz|infortunado|lamentable|luctuoso|lúgubre|trágico|tétrico}} {{ejemplo|Despedidos su Magestad y el dicho Serenisimo Rey en gran conformidad de amos, enbarcose su Alteza en Autona, y con prospero y '''''feliz''''' viage, llegó alos diez e syete de jullio del anno pasado en Santander.|c=libro|t=Cortes de los antiguos reinos de Leon y de Castilla|a=Real Academia de la Historia|f=1863|p=346}} {{ejemplo|Había sido un viaje '''''feliz''''', demasiado corto, ahora que ya se sentían en Lima.|c=libro|t=A World for Julius|a=Alfredo Bryce Echenique|f=2004|editorial=Univ of Wisconsin Press|isbn=9780299196745|p=155}} ;3: Dicho de un pensamiento o palabra, [[conveniente]] a la [[ocasión]]. {{sinónimo|acertado|adecuado|afortunado}} {{antónimo|desacertado|inadecuado}} {{ejemplo|Mas hasta aquí Señores, no hablé si no del medio con que los Curas podran ser grandemente provechosos á los pueblos; y es ya menester decir algo de otro poderoso y eficaz, con que reducir á práctica tan '''''feliz''''' idea.|c=libro|t=Extractos de las Juntas Generales celebradas por la Real Sociedad Bascongada de los Amigos del País en la ciudad de Vitoria por setiembre de 1783|a=Real Sociedad Bascongada de los Amigos del País|f=1784|oclc=898294133|p=130}} {{ejemplo|En tal sentido el paso decisivo fue cumplido por Nicolaus Mercator, holandés de nacimiento cuyo apellido natal era Kaufmann, quien en su Logarithmotechnia de 1668 tuvo la '''''feliz''''' ocurrencia de dar la ecuación de la hipérbola equilátera en la forma <math>y=1/(1+x)</math>, que podía desarrollarse en serie de potencias y aplicarle la regla de Wallis.|c=libro|a=Julio Rey Pastor|f=1997|fo=1974|t=Historia de la matemática|pasaje=¶23}} ;4: Que ocurre o sucede con felicidad.<ref name="drae1925">{{DLE1925}}</ref> ==== Locuciones ==== * [[feliz año nuevo]] * [[fueron felices y comieron perdices]]: palabras finales de muchos cuentos infantiles * [[no hacer feliz]] (algo a alguien): [[desagradar]], [[disgustar]], no [[parecer]] [[adecuado]] o [[conveniente]] * [[prometérselas felices]] ==== Véase también ==== {{W|felicidad}} * [[felicidad]] * [[felicitar]] ==== Traducciones ==== {{trad-arriba}} {{t|af|a1=1|t1=bly|t2=gelukkig}} {{t|sh|a1=1|t1=sretan срећан|tl1=srécan}} {{t|sq|a1=1|t1=i lumtur|t2=i kënaqur gëzuar}} {{t|de|a1=1|t1=glücklich}} {{t|ar|a1=1|t1=سعيد|tl1=saʿīd|t2=فرح|tl2=fáriḥ}} {{t|hy|a1=1|t1=երջանիկ|tl1=erǰanik}} {{t|ast|a1=1|t1=feliz|t2=contentu|t3=gayoleru|t4=gayasperu}} {{t|az|a1=1|t1=xoşbəxt}} {{t|br|a1=1|t1=laouen}} {{t|ca|a1=1|t1=feliç|g1=m}} {{t|ccc|a1=1|t1=pya'kijnani}} {{t|ko|a1=1|t1=행복하다|tl1=haengbok-hada|t2=기뻐하다|tl2=gippeo-hada|t3=기쁘다|tl3=gippeuda}} {{t|kw|a1=1|t1=lowen}} {{t|cs|a1=1|t1=šťastný}} {{t|ht|a1=1|t1=kontan}} {{t|dlm|a1=1|t1=alegr}} {{t|da|a1=1|t1=glad|t2=lykkelig}} {{t|sco|a1=1|t1=blithe}} {{t|sl|a1=1|t1=srečen}} {{t|eo|a1=1|t1=feliĉa}} {{t|et|a1=1|t1=õnnelik}} {{t|eu|a1=1|t1=zoriontsu}} {{t|fj|a1=1|t1=marau}} {{t|fi|a1=1|t1=onnellinen|t2=iloinen|t3=tyytyväinen}} {{t|fr|a1=1|t1=heureux|t2=content|t3=bienheureux}} {{t|fy|a1=1|t1=bliid}} {{t|gd|a1=1|t1=sona|t2=toilichte|t3=àghmhor}} {{t|cy|a1=1|t1=dedwydd|t2=hapus}} {{t|ka|a1=1|t1=ბედნიერი|tl1=bednieri}} {{t|el|a1=1|t1=ευχαριστημένος|g1=m|tl1=eucharistēménos|t2=χαρούμενος|g2=m|tl2=charoúmenos}} {{t|haw|a1=1|t1=hauʻoli}} {{t|he|a1=1|t1=מאושר|tl1=me’ušar|t2=שמח|tl2=śame’aḥ}} {{t|hi|a1=1|t1=सुखी|tl1=sukhī|t2=ख़ुश|tl2=xuś|t3=प्रसन्न|tl3=prasann}} {{t|hu|a1=1|t1=boldog}} {{t|io|a1=1|t1=felica}} {{t|id|a1=1|t1=senang}} {{t|en|a1=1|t1=happy|t2=joyous}} {{t|ang|a1=1|t1=bliþe|t2=glæd|t3=eadig|t4=wynfull}} {{t|ga|a1=1|t1=áthasach|t2=sona|t3=sásta}} {{t|is|a1=1|t1=hamingjusamur}} {{t|it|a1=1|t1=felice|t2=lieto}} {{t|ja|a1=1|t1=幸せ|tl1=しあわせな, shiawase-na|t2=幸福|tl2=こうふくな, kōfuku-na|t3=うれしい|tl3=ureshii}} {{t|ckb|a1=1|t1=دڵ خۆش|tl1=dill xosh|t2=خه‌نی|tl2=xení}} {{t|la|a1=1|t1=laetus}} {{t|lv|a1=1|t1=laimīgs|t2=priecīgs}} {{t|lt|a1=1|t1=laimingas}} {{t|jbo|a1=1|t1=gleki}} {{t|lb|a1=1|t1=glécklech}} {{t|mt|a1=1|t1=kuntenti}} {{t|cmn|a1=1|t1=高興|t2=高兴|tl2=gāoxìng|t3=愉快|tl3=yúkuài|t4=快樂|t5=快乐|tl5=kuàilè|t6=幸福|tl6=xìngfú}} {{t|gv|a1=1|t1=maynrey}} {{t|yua|a1=1|t1=kiʼimak óol}} {{t|nan|a1=1|t1=歡喜|tl1=hoaⁿ-hí|t2=快樂|tl2=khòai-lo̍k}} {{t|nl|a1=1|t1=gelukkig|t2=blij}} {{t|nb|a1=1|t1=glad|t2=lykkelig}} {{t|fa|a1=1|t1=خوش|tl1=xoš}} {{t|pl|a1=1|t1=szczęśliwy}} {{t|pt|a1=1|t1=feliz}} {{t|rom|a1=1|t1=baxtalo|g1=m|t2=baxtali|g2=m|t3=baxtale|g3=m}} {{t|ro|a1=1|t1=fericit|g1=m|t2=bucuros|g2=m}} {{t|ru|a1=1|t1=счастливый|tl1=sčastlívyj|t2=радостный|tl2=rádostnyj}} {{t|sa|a1=1|t1=सुखिन्|tl1=sukhin|t2=प्रसन्न|tl2=prasanna}} {{t|sh|a1=1|t1=srećan}} {{t|sv|a1=1|t1=glad|g1=c|t2=glatt|g2=n|t3=lycklig|g3=c|t4=lyckligt|g4=n}} {{t|th|a1=1|t1=มีความสุข|tl1=mee kwaam sòok}} {{t|tl|a1=1|t1=masaya}} {{t|te|a1=1|t1=ప్రశాంతం|tl1=prasamtam|t2=ప్రసన్నత|tl2=prasannata}} {{t|tr|a1=1|t1=mutlu}} {{t|ur|a1=1|t1=خوش|tl1=xuś}} {{t|vi|a1=1|t1=mừng}} {{trad-abajo}} == {{lengua|ast}} == {{pron-graf|leng=ast}} === Etimología 1 === {{etimología|leng=ast}}. ==== {{adjetivo|ast}} ==== {{ast.adj}} ;1: {{plm}}. {{sinónimo|leng=ast|contentu|gayasperu|gayoleru}}. ==== Información adicional ==== {{trad-arriba|Cogandos asturianos}} *{{l+|ast|felicidá}} {{trad-abajo}} == {{lengua|osp}} == {{pron-graf|leng=osp}} === Etimología 1 === {{etimología}}. ==== {{adjetivo|osp}} ==== ;1: {{variante|leng=osp|felix}} == {{lengua|roa-opt}} == {{pron-graf|leng=roa-opt|v1=fiiz}} === Etimología 1 === {{etimología|leng=roa-opt}}. ==== {{adjetivo|roa-opt}} ==== ;1: {{plm}}.<ref name="DDGM">{{DDGM}}</ref> == {{lengua|gl}} == {{pron-graf|leng=gl}} === Etimología 1 === {{etimología|leng=gl|roa-opt|feliz||roa-opt|fiiz}}. ==== {{adjetivo|gl}} ==== {{gl.adj}} ;1: {{plm}}.<ref name="DRAG">{{DRAG}}</ref> {{sinónimo|leng=gl|alegre|alfúfaro|contento|ledo}}.<ref name="DRAG" /> {{antónimo|leng=gl|apesarado|infeliz|triste}}.<ref name="DRAG" /> ;2: Feliz (que ocasiona felicidad).<ref name="DRAG" /> {{sinónimo|leng=gl|alegre|fasto|fausto|venturoso}}.<ref name="DRAG" /> {{antónimo|leng=gl|aciago|desgraciado|desventurado|infausto|infeliz|infortunado}}.<ref name="DRAG" /> ;3: {{plm|oportuno}}.<ref name="DRAG" /> {{sinónimo|leng=gl|acertado|afortunado|oportuno}}.<ref name="DRAG" /> {{antónimo|leng=gl|infeliz|inoportuno}}.<ref name="DRAG" /> == {{lengua|lad}} == {{pron-graf|leng=lad}} === Etimología 1 === {{etimología}}. ==== {{adjetivo|lad}} ==== ;1: {{variante|leng=lad|felis}} == {{lengua|pt}} == {{pron-graf|leng=pt|v1=felice|vnota1=poética|audio=LL-Q5146 (por)-Juliano P. Junho (Jjunho)-feliz.wav|2audio=LL-Q5146 (por)-Santamarcanda-feliz.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-feliz.wav}} === Etimología 1 === {{etimología|leng=pt|roa-opt|feliz||roa-opt|fiiz}}. ==== {{adjetivo|pt}} ==== {{pt.adj|sup=felicíssimo}} ;1: {{plm}}. {{sinónimo|leng=pt|afortunado|alegre|contente}}. {{antónimo|leng=pt|infeliz}}. ==== Información adicional ==== {{cognados|felicidade|felicitação|felizmente}} == Referencias y notas == <references /> 4pxcu4qewaglrzt1rmdp8yhypw1ijaz heure 0 32604 6076585 6071825 2026-04-04T20:10:06Z Adelpine 34679 Agrega algunas pronunciaciones AFI tomadas de [[fr:heure]] 6076585 wikitext text/x-wiki {{desambiguación|heuré}} == {{lengua|ca}} == {{pron-graf|leng=ca|1pron1=oriental}} === {{verbo transitivo|ca}} === ;1: {{variante|leng=ca|haver}}<ref name="GDLC">{{GDLC}}</ref> {{ámbito|leng=ca|oriental}}. == {{lengua|fr}} == {{pron-graf|leng=fr |1fono1=œʁ|1audio1=Fr-heure.ogg|aunota=París, [l‿œːʁ] |2pron1=Francia Meridional|2fono1=ˈœ.ʁə|2audio=LL-Q150 (fra)-X-Javier-heure.wav|2aunota=Massy, [ˈœː.ʁə] |3pron1=Quebec|3fone1=œːʁ |h1=Eure|h2=heur|h3=heurs|h4=heures|h5=heurt|h6=heurts }} === Etimología === {{etimología|leng=fr|frm|heure|hora}}, y este del francés antiguo {{l+|fro|houre|glosa=hora}}, del latín {{l+|la|hora|hōra|glosa=hora}}, del griego antiguo {{l+|grc|ὥρα|tr=hṓra}}. Atestiguado (en francés antiguo) desde ∼1050.<ref name="DAF8">{{DAF8}}</ref> === {{sustantivo femenino|fr}} === {{fr.sust}} ;1 {{csem|leng=fr|unidades de tiempo}}: {{plm|hora}}. ;2: {{plm|hora}} (últimos instantes vitales). ;3 {{csem|leng=fr|astronomía}}: {{plm|hora}}. === Locuciones === {{trad-arriba|Locuciones}} * {{l+|fr|à cette heure}} * {{l+|fr|à la bonne heure}} * {{l+|fr|à l’heure}} * {{l+|fr|à l’heure dite}} * {{l+|fr|à l’heure qu’il est}} * {{l+|fr|à point d’heure}} * {{l+|fr|à ses heures}} * {{l+|fr|à toute heure}} * {{l+|fr|ampère-heure}} * {{l+|fr|avoir de bons et de mauvais quarts d’heure}} * {{l+|fr|belle-d’onze-heures}} * {{l+|fr|belle heure}} * {{l+|fr|bonne heure}} * {{l+|fr|bouillon de onze heures}} * {{l+|fr|cadran de 12 heures}} * {{l+|fr|cadran de 24 heures}} * {{l+|fr|chercher midi à quatorze heures}} * {{l+|fr|dame-d’onze-heures}} * {{l+|fr|de toutes les heures}} * {{l+|fr|demi-heure}} * {{l+|fr|dernière heure}} * {{l+|fr|d’heure en heure, d’une heure à l’autre}} * {{l+|fr|être à l’heure}} * {{l+|fr|exawatt-heure}} * {{l+|fr|fuite des heures}} * {{l+|fr|heure astronomique}} * {{l+|fr|heure avancée}} * {{l+|fr|heure de fourche}} * {{l+|fr|heure dernière}} * {{l+|fr|heure double}} * {{l+|fr|heure du berger}} (figurado) * {{l+|fr|heure favorable}} * {{l+|fr|heure indue}} * {{l+|fr|heure normale}} * {{l+|fr|heure propice}} * {{l+|fr|heure supplémentaire}} * {{l+|fr|heure suprême}} * {{l+|fr|heures canoniales}} (religión) * {{l+|fr|heures de loisir}} * {{l+|fr|heures dérobées}} * {{l+|fr|heures perdues}} * {{l+|fr|gigawatt-heure}} * {{l+|fr|hectowatt-heure}} * {{l+|fr|kilomètre-heure}} * {{l+|fr|kilowatt-heure}} * {{l+|fr|l’heure qu’il était hier à la même heure}} * {{l+|fr|livre d’heures}} * {{l+|fr|lumen-heure}} * {{l+|fr|mégawatt-heure}} * {{l+|fr|mettre à l’heure}} * {{l+|fr|ne pas avoir une heure à soi}} * {{l+|fr|passer un mauvais quart d’heure}} * {{l+|fr|pétawatt-heure}} * {{l+|fr|petites heures}} (religión) * {{l+|fr|pour l’heure}} (familiar) * {{l+|fr|prendre l’heure}} * {{l+|fr|prières de quarante heures}} * {{l+|fr|quarante heures}} (catolicismo) * {{l+|fr|quarante-huit heures}} * {{l+|fr|quart d’heure de grâce}} * {{l+|fr|quart d’heure de Rabelais}} * {{l+|fr|quatre-vingt-seize heures}} * {{l+|fr|soixante-douze heures}} * {{l+|fr|sur l’heure}} * {{l+|fr|tout à l’heure}} * {{l+|fr|trente-six heures}} * {{l+|fr|vingt-quatre heures}} * {{l+|fr|térawatt-heure}} * {{l+|fr|toutes ses heures sont marquées}} * {{l+|fr|watt-heure}} * {{l+|fr|yottawatt-heure}} * {{l+|fr|zettawatt-heure}} {{trad-abajo}} === Información adicional === {{derivad|heures|heurette|horaire|horloge|horloger|horlogerie|horodatage|horodateur|horodictique|horographe|horographie|horographique|horokilométrique|horométrie|horométrique|horoptère|horoscope|horoscopie|horoscopique|horoscopiser|horotrope}} == {{lengua|frm}} == {{pron-graf|leng=frm}} === Etimología === {{etimología|leng=frm|fro|houre|hora}}. === {{sustantivo femenino|frm}} === {{inflect.frm.sust.reg}} ;1 {{csem|leng=frm|unidades de tiempo}}: {{plm|hora}}. == Referencias y notas == <references /> 5z718irvkaup3jx4h3t8xq33800z7o2 ficar 0 42960 6076665 5908493 2026-04-05T02:44:29Z TMCbot 164594 . 6076665 wikitext text/x-wiki {{desambiguación|-ficar}} == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología|la-vul|*figicare}}, {{etim|la|figere|alt=fīgere|glosa=fijar}}. ==== {{verbo intransitivo|es}} ==== ;1: {{plm|quedar}} {{uso|Anticuado}}. ==== Conjugación ==== {{es.v}} ==== Traducciones ==== {{trad-arriba}} {{trad-abajo}} == {{lengua|gl}} == {{pron-graf|leng=gl|fone=fi.ˈkaɾ}} === Etimología === {{etimología|la|figicare|leng=gl}}, del latín {{l+|la|figere|glosa=fijar}}. === {{verbo intransitivo|gl}} === ;1: {{plm|quedar}}. == {{lengua|pt}} == {{pron-graf|leng=pt|1audio=LL-Q5146 (por)-Sillim-ficar.wav|1audio2=LL-Q5146 (por)-Juliano P. Junho (Jjunho)-ficar.wav|2audio=LL-Q5146 (por)-Santamarcanda-ficar.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-ficar.wav}} === Etimología === {{etimología|leng=pt|la-vul|*figicare}}, {{etim|leng=pt|la|figere|alt=fīgere|glosa=fijar}}. ==== {{verbo intransitivo|pt}} ==== ;1: {{plm|quedar}}. ;2: {{plm|quedarse}}. ==== Locuciones ==== * {{l|pt|ficar no aguardo}}: [[esperar]], [[aguardar]]. ==== Conjugación ==== {{pt.v}} == Referencias y notas == <references /> jjohup6rvxmk4y8146x8c79x6migeiy obrigado 0 45326 6076687 6072274 2026-04-05T02:45:18Z TMCbot 164594 . 6076687 wikitext text/x-wiki == {{lengua|pt}} == {{pron-graf|leng=pt|1audio1=LL-Q5146 (por)-Sillim-obrigado.wav|2audio1=Pt-obrigado.oga}} === Etimología 1 === {{etimología}}. ==== {{adjetivo|pt}} ==== {{pt.adj}} ;1: {{plm|agradecido}}. {{ejemplo|Dou muito ''obrigado'' ao meu professor de português, Carlos Minchillo, cuja paciência é a base de todo o resto—sem os seus esforços teria sido impossível mesmo comunicar uma vez chegado a Galeão.|c=libro|t=Whispering to the Prince|a=Kai Michael Kenkel|f=2005|oclc=606388053}} ==== {{interjección|pt}} ==== ;2: ¡{{plm|gracias}}! (dicho por un hombre) {{relacionado|obrigada|nota1=dicho por una mujer}} === Forma flexiva === ==== Forma verbal ==== ;1: {{forma|leng=pt|tipo=verbo|obrigar|participio de}}. == Referencias y notas == <references /> i5we7ynksozy17h6xmjgrw7wf6a9t4d vingt 0 45756 6076587 4676523 2026-04-04T20:49:11Z Adelpine 34679 Agrega una sección tomada de [[fr:vingt]] 6076587 wikitext text/x-wiki == {{lengua|fr}} == {{pron-graf|leng=fr|fono=vɛ̃|audio=Fr-vingt.ogg|aunota=París}} === Etimología === {{etimología|la|viginti|leng=fr}}. === {{adjetivo|fr|cardinal|plural|indeclinable}} === ;1: {{plm|veinte}}. === {{sustantivo masculino|fr|ambiguo|invariable}} === {{fr.sust|p}} ;2 {{csem|leng=fr|numerales}}: {{plm|veinte}}. == Referencias y notas == <references /> 8arsd1qcokl2r71sje9ohfzeuvu8fel 6076588 6076587 2026-04-04T20:58:49Z Tmagc 158167 6076588 wikitext text/x-wiki == {{lengua|fr}} == {{pron-graf|leng=fr|fono=vɛ̃|audio=Fr-vingt.ogg|aunota=París}} === Etimología === {{etimología|la|viginti|leng=fr}}. === {{adjetivo|fr|cardinal|plural|indeclinable}} === {{fr.sust|p}} ;1: {{plm|veinte}}. === {{sustantivo masculino|fr|ambiguo|invariable}} === ;2 {{csem|leng=fr|numerales}}: {{plm|veinte}}. == Referencias y notas == <references /> 4scs8150e7437dgy68g27fkmz39lykv 6076589 6076588 2026-04-04T20:58:56Z Tmagc 158167 6076589 wikitext text/x-wiki == {{lengua|fr}} == {{pron-graf|leng=fr|fono=vɛ̃|audio=Fr-vingt.ogg|aunota=París}} === Etimología === {{etimología|la|viginti|leng=fr}}. === {{adjetivo|fr|cardinal|plural|indeclinable}} === {{fr.adj|p}} ;1: {{plm|veinte}}. === {{sustantivo masculino|fr|ambiguo|invariable}} === ;2 {{csem|leng=fr|numerales}}: {{plm|veinte}}. == Referencias y notas == <references /> mdjjyvlk4dl58wa1q5m9jvfscwee5fc écouter 0 50716 6076568 5909820 2026-04-04T17:29:31Z Adelpine 34679 Agrega el origen del autor del audio 6076568 wikitext text/x-wiki == {{lengua|fr}} == {{pron-graf|leng=fr|audio=Fr-écouter.ogg|aunota=París}} === Etimología === {{etimología|leng=fr}}. === {{verbo transitivo|fr}} === ;1: {{plm|escuchar}}. === Conjugación === {{fr.v}} == Referencias y notas == <references /> j0ooopn3z5p03u0nblwco9886b8qu9q Plantilla:solicitudesotros 10 53127 6076631 5836527 2026-04-05T01:10:38Z Tmagc 158167 6076631 wikitext text/x-wiki <div id="toc" style="padding:10px; font-size:110%; -moz-border-radius:10px" > '''Solicitudes en:'''<br> [[Wikcionario:Solicitudes/AY|Aimara]] — [[Wikcionario:Solicitudes/DE|Alemán]] — [[Wikcionario:Solicitudes/AR|Árabe]] — [[Wikcionario:Solicitudes/AST|Asturiano]] — [[Wikcionario:Solicitudes/BR|Bretón]] — [[Wikcionario:Solicitudes/CA|Catalán]] — [[Wikcionario:Solicitudes/ZH|Chino mandarín]] — [[Wikcionario:Solicitudes/HU|Húngaro]] — [[Wikcionario:Solicitudes/EU|Euskera]] — [[Wikcionario:Solicitudes/FI|Finés]] — [[Wikcionario:Solicitudes/FR|Francés]] — [[Wikcionario:Solicitudes/SL|Esloveno]] —[[Wikcionario:Solicitudes|Español]] — [[Wikcionario:Solicitudes/EO|Esperanto]] — [[Wikcionario:Solicitudes/GL|Gallego]] — [[Wikcionario:Solicitudes/EL|Griego]] — [[Wikcionario:Solicitudes/GRC|Griego antiguo]] — [[Wikcionario:Solicitudes/GN|Guaraní]] — [[Wikcionario:Solicitudes/EN|Inglés]] — [[Wikcionario:Solicitudes/IT|Italiano]] — [[Wikcionario:Solicitudes/GA|Irlandés]] — [[Wikcionario:Solicitudes/NRF|Jerseyés y guerneseyés]] — [[Wikcionario:Solicitudes/LAD|Judeoespañol]] — [[Wikcionario:Solicitudes/LA|Latín]] — [[Wikcionario:Solicitudes/LV|Letón]] — [[Wikcionario:Solicitudes/LB|Luxemburgués]] — [[Wikcionario:Solicitudes/JA|Japonés]] — [[Wikcionario:Solicitudes/NAH|Náhuatl]] — [[Wikcionario:Solicitudes/NL|Neerlandés]] — [[Wikcionario:Solicitudes/ARN|Mapudungun]] — [[Wikcionario:Solicitudes/PL|Polaco]] — [[Wikcionario:Solicitudes/PT|Portugués]] — [[Wikcionario:Solicitudes/RU|Ruso]] — [[Wikcionario:Solicitudes/INE|Protoindoeuropeo]] — [[Wikcionario:Solicitudes/RO|Rumano]] — [[Wikcionario:Solicitudes/SV|Sueco]] — [[Wikcionario:Solicitudes/VI|Vietnamita]] — [[Wikcionario:Solicitudes/YAG|Yagán]] — [[Wikcionario:Solicitudes/ZAP|Zapoteco]] </div><noinclude>[[Categoría:Plantillas de organización interna]]</noinclude> cofo3a4zcjikqcn6zknj7wwks6t51nf point 0 57109 6076551 6068461 2026-04-04T16:19:14Z Adelpine 34679 Agrega las pronunciaciones AFI tomadas de [[fr:point]] 6076551 wikitext text/x-wiki == {{lengua|fr}} == {{pron-graf|leng=fr |1audio1=Fr-point.ogg|1aunota1=París, [ɛ̃ pwɛ̃] |2pron=Francia Meridional|2fono=pwɛŋ |3pron=Canadá|3fono=pwẽ }} === Etimología 1 === {{etimología|leng=fr|la|punctum}}. === {{sustantivo masculino|fr}} === {{fr.sust}} ;1: {{plm|punto}}. ;2: {{plm|puntada}}. === {{adverbio de negación|fr}} === ;3: Para nada, nada, no. {{uso|leng=fr|literario|dialectal|usado con {{l+|fr|ne}}}} {{ejemplo|Il [[était]] [[une]] [[fois]] un Roi et une Reine qui [[étaient]] si [[fâchés]] de n'[[avoir]] point d'[[enfant]]s.|a=Charles Perrault|c=libro|trad=Había una vez un rey y una reina que estaban tan afligidos por no tener hijos.|título=La Belle au bois dormant|u=http://fr.wikisource.org/wiki/La_Belle_au_bois_dormant}} == {{lengua|en}} == {{pron-graf|leng=en|1audio1=LL-Q1860 (eng)-Back ache-point.wav|1audio2=en-us-point.ogg|1aunota1=Londres|1aunota2=EE. UU.|1fono1=pɔɪnt|1pron1=Received Pronunciation, General American|2audio1=en-au-point.ogg|2fono1=poɪnt|2pron1=General Australian|ls=1}} === Etimología 1 === {{etimología|leng=en|enm|point}}, {{etim|leng=en|fro|point}}, {{etim|leng=en|la|punctum}}, uso sustantivo {{etim|leng=en|la|punctus}}, participio pasivo perfecto {{etim|leng=en|la|pungō}}; alternatiamente, {{etim|leng=en|fro|pointe}}, {{etim|leng=en|la|puncta|g=f}}. Sustituyo a {{l+|enm|ord|glosa=punto}}, {{etim|leng=en|ang|ord}}. Doblete con {{l+|en|punto}}. ==== {{sustantivo|en}} ==== {{en.sust|ci}} ;1: {{plm|punta}}, [[cabo]]. {{sinónimo|leng=en|end|ord|tip}}. ;2: {{plm|punto}}. {{sinónimo|leng=en |opinion|point of view|view|viewpoint}}. ;3 {{csem|leng=en|tipografía}}: {{plm|punto}} (símbolo). ;4: {{plm|momento}}. {{sinónimo|leng=en|moment|ord|time}}. ;5: {{plm|cuestión}}, [[asunto]]. ;6: {{plm|sentido}}. ;7: {{plm|cualidad}}. ;8: {{plm|posición}}. {{sinónimo|leng=en|location|place|position|spot}}. ;9 {{csem|leng=en|matemáticas}}: {{plm|punto}}, [[punto decimal]]. {{sinónimo|leng=en|spot|decimal point}} ;10 {{csem|leng=en|geometría}}: {{plm|punto}}. {{sinónimo|leng=en|ord}}. ==== Locuciones ==== * {{l|en|tipping point}}: ''momento crítico'', ''punto de inflección''. === Etimología 2 === {{etimología|leng=en|enm|pointen}}, {{l+|enm|poynten}}, {{etim|leng=en|fro|pointier}}, {{l+|fro|pointer}}, {{l+|fro|poynter}},<ref>{{MED Online|pointen v.(1)|MED33867}}</ref> {{etim|leng=en|la-med|punctare}}, {{l+|la|punctuo|pūnctuāre}}, {{etim|leng=en|la|punctum|diacrítico=pūnctum}}. ==== {{verbo transitivo|en}} ==== ;1: {{plm|apuntar}}, [[indicar]], [[dirigir]], [[señalar]] con el [[dedo]]. ;2: {{plm|encarar}}. ;3: {{plm|afilar}}. ;4: {{plm|mampostear}}. ==== Conjugación ==== {{en.v}} === Etimología 3 === {{etimología|leng=en|enm|pointen}}, {{l+|enm|poynten}}, por aféresis {{etim|leng=en|enm|apointen}}, {{l+|enm|appointen}}, {{l+|enm|appoynten}}.<ref>{{MED Online|pointen v.(2)|MED33868}}</ref> Véase {{l+|en|appoint}}. ==== {{verbo|en}} ==== ;1: {{plm|designar}}. {{uso|leng=en|obsoleto}}. ==== Conjugación ==== {{en.v}} == Referencias y notas == <references /> elrqmdfk3s820dbw4vfmplyyvuo6aaw 6076552 6076551 2026-04-04T16:22:56Z Adelpine 34679 Inglés: Amplía los hablantes de las pronunciaciones AFI 6076552 wikitext text/x-wiki == {{lengua|fr}} == {{pron-graf|leng=fr |1audio1=Fr-point.ogg|1aunota1=París, [ɛ̃ pwɛ̃] |2pron=Francia Meridional|2fono=pwɛŋ |3pron=Canadá|3fono=pwẽ }} === Etimología 1 === {{etimología|leng=fr|la|punctum}}. === {{sustantivo masculino|fr}} === {{fr.sust}} ;1: {{plm|punto}}. ;2: {{plm|puntada}}. === {{adverbio de negación|fr}} === ;3: Para nada, nada, no. {{uso|leng=fr|literario|dialectal|usado con {{l+|fr|ne}}}} {{ejemplo|Il [[était]] [[une]] [[fois]] un Roi et une Reine qui [[étaient]] si [[fâchés]] de n'[[avoir]] point d'[[enfant]]s.|a=Charles Perrault|c=libro|trad=Había una vez un rey y una reina que estaban tan afligidos por no tener hijos.|título=La Belle au bois dormant|u=http://fr.wikisource.org/wiki/La_Belle_au_bois_dormant}} == {{lengua|en}} == {{pron-graf|leng=en |pron=Received Pronunciation, General American, Standard Canadian|fono=pɔɪnt|audio=LL-Q1860 (eng)-Back ache-point.wav|aunota=Londres|audio2=en-us-point.ogg|aunota2=California |2pron=Australia, Nueva Zelanda|2fono=poɪnt|2audio=en-au-point.ogg|2aunota=Queensland |ls=1 }} === Etimología 1 === {{etimología|leng=en|enm|point}}, {{etim|leng=en|fro|point}}, {{etim|leng=en|la|punctum}}, uso sustantivo {{etim|leng=en|la|punctus}}, participio pasivo perfecto {{etim|leng=en|la|pungō}}; alternatiamente, {{etim|leng=en|fro|pointe}}, {{etim|leng=en|la|puncta|g=f}}. Sustituyo a {{l+|enm|ord|glosa=punto}}, {{etim|leng=en|ang|ord}}. Doblete con {{l+|en|punto}}. ==== {{sustantivo|en}} ==== {{en.sust|ci}} ;1: {{plm|punta}}, [[cabo]]. {{sinónimo|leng=en|end|ord|tip}}. ;2: {{plm|punto}}. {{sinónimo|leng=en |opinion|point of view|view|viewpoint}}. ;3 {{csem|leng=en|tipografía}}: {{plm|punto}} (símbolo). ;4: {{plm|momento}}. {{sinónimo|leng=en|moment|ord|time}}. ;5: {{plm|cuestión}}, [[asunto]]. ;6: {{plm|sentido}}. ;7: {{plm|cualidad}}. ;8: {{plm|posición}}. {{sinónimo|leng=en|location|place|position|spot}}. ;9 {{csem|leng=en|matemáticas}}: {{plm|punto}}, [[punto decimal]]. {{sinónimo|leng=en|spot|decimal point}} ;10 {{csem|leng=en|geometría}}: {{plm|punto}}. {{sinónimo|leng=en|ord}}. ==== Locuciones ==== * {{l|en|tipping point}}: ''momento crítico'', ''punto de inflección''. === Etimología 2 === {{etimología|leng=en|enm|pointen}}, {{l+|enm|poynten}}, {{etim|leng=en|fro|pointier}}, {{l+|fro|pointer}}, {{l+|fro|poynter}},<ref>{{MED Online|pointen v.(1)|MED33867}}</ref> {{etim|leng=en|la-med|punctare}}, {{l+|la|punctuo|pūnctuāre}}, {{etim|leng=en|la|punctum|diacrítico=pūnctum}}. ==== {{verbo transitivo|en}} ==== ;1: {{plm|apuntar}}, [[indicar]], [[dirigir]], [[señalar]] con el [[dedo]]. ;2: {{plm|encarar}}. ;3: {{plm|afilar}}. ;4: {{plm|mampostear}}. ==== Conjugación ==== {{en.v}} === Etimología 3 === {{etimología|leng=en|enm|pointen}}, {{l+|enm|poynten}}, por aféresis {{etim|leng=en|enm|apointen}}, {{l+|enm|appointen}}, {{l+|enm|appoynten}}.<ref>{{MED Online|pointen v.(2)|MED33868}}</ref> Véase {{l+|en|appoint}}. ==== {{verbo|en}} ==== ;1: {{plm|designar}}. {{uso|leng=en|obsoleto}}. ==== Conjugación ==== {{en.v}} == Referencias y notas == <references /> hzbsbm3y9wjksdrzcym65qrh80gv1ny Wikcionario:Portada/Alternativa 4 60196 6076635 6076016 2026-04-05T01:33:26Z Tmagc 158167 6076635 wikitext text/x-wiki {{histórica}} [[Wikcionario:Portada/Alternativa/2|Ver la segunda Alternativa --->]].........'''[[Wikcionario:Portada/Alternativa/Light|Ver la portada ''Light'']]''' __NOTOC__ __NOEDITSECTION__ <!--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Bienvenido al Wikcionario---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <nowiki>{{Bienvenido al Wikcionario}}</nowiki> <!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Columna Izquierda-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> {|style="margin:4px 0px 0px 0px; background:none;" |class="MainPageBG" style="width:60%; border:1px solid #cedff2; background:#ffffff; vertical-align:top; color:#000; -moz-border-radius:4px"| {|width="100%" cellpadding="2" cellspacing="5" style="vertical-align:top; background:#ffffff;" <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Navegar por el Wikcionario---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> ! <div style="float:right; margin:2px 2px 0px 0px;">[[Archivo:Wiktprintable without text.svg|50px]]</div><h2 style="margin:0; background:#E6ECFF; font-size:150%; font-weight:bold; border:1px solid #cccccc; text-align:left; color:#000; padding:0.2em 0.4em; -moz-border-radius:6px">[[Archivo:Gnome-mime-application-rtf.png|50px]] Navegar por el [[Wikcionario]]</h2> |- |style="color:#000; font-size:100%;"|<!---Texto---> |- <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Ártículos--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> ! <div style="float:right; margin:2px 2px 0px 0px;">[[Archivo:Wiktprintable without text.svg|50px]]</div><h2 style="margin:0; background:#DCFFD1; font-size:150%; font-weight:bold; border:1px solid #cccccc; text-align:left; color:#000; padding:0.2em 0.4em; -moz-border-radius:6px">[[Archivo:Nuvola apps edu miscellaneous.png|50px]] Artículos <nowiki>([[:Categoría:Índice de categorías|Índice de categorías]])</nowiki></h2> |- |style="color:#000; font-size:100%; padding:5px; padding-top:10px; padding-bottom:10px"| *[[Wikcionario:Por orden alfabético|Por orden alfabético]] *[[Wikcionario:Por tema|Por tema]] *[[:Categoría:Palabras por número de letras|Por extensión de la palabra]] *[[Wikcionario:Sentencias|Sentencias]] *[[Wikcionario:Neologismos|Neologismos]] *[[Esquemas de categorización alternativos]] |- <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Apéndices según campos semánticos--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> ! <div style="float:right; margin:2px 2px 0px 0px;">[[Archivo:Wiktprintable without text.svg|50px]]</div><h2 style="margin:0; background:#FFE6F9; font-size:150%; font-weight:bold; border:1px solid #cccccc; text-align:left; color:#000; padding:0.2em 0.4em; -moz-border-radius:6px">[[Archivo:Nuvola apps edu languages.svg|50px]] [[:Categoría:Apéndices|Apéndices]] según [[:Categoría:Campos semánticos|campos semánticos]]</h2> |- |style="color:#000; font-size:100%;"| *[[Wikcionario:Apéndice:Abreviaturas|Abreviaturas]] *[[Wikcionario:Apéndice:Acrónimos|Acrónimos y siglas]] *[[Wikcionario:Apéndice:Colores|Colores]] *[[Wikcionario:Apéndice:Vehículos|Vehículos]] *[[Wikcionario:Apéndice:Cronologías|Cronología]] *[[Wikcionario:Apéndice:Elementos|Elementos]] *[[Wikcionario:Apéndice:Números|Números]] *[[Wikcionario:Apéndice:Formas|Formas]] *[[Wikcionario:Apéndice:Minerales|Minerales]] *[[Wikcionario:Apéndice:Animales|Animales]] *[[Wikcionario:Apéndice:Plantas|Plantas]] *[[Wikcionario:Apéndice:Lugares|Lugares]] *[[Wikcionario:Apéndice:Personas|Personas]] *[[Wikcionario:Apéndice:Armamento|Armamento]] *[[Wikcionario:Apéndice:Historia|Términos históricos]] *[[Wikcionario:Apéndice:Términos marineros|Términos marineros]] *[[Wikcionario:Apéndice:Heráldica|Heráldica]] |- <!--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Apéndices según categorías gramaticales-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> ! <div style="float:right; margin:2px 2px 0px 0px;">[[Archivo:Wiktprintable without text.svg|50px]]</div><h2 style="margin:0; background:#E6F2EF; font-size:150%; font-weight:bold; border:1px solid #cccccc; text-align:left; color:#000; padding:0.2em 0.4em; -moz-border-radius:6px">[[Archivo:Icon tools.svg|50px]] Apéndices según categorías gramaticales</h2> |- |style="color:#000; font-size:100%;"| *[[Wikcionario:Índice de verbos españoles|Verbos españoles (listado incompleto)]] |- <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Otros Apéndices--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> ! <div style="float:right; margin:2px 2px 0px 0px;">[[Archivo:Wiktprintable without text.svg|50px]]</div><h2 style="margin:0; background:#FFEDCC; font-size:150%; font-weight:bold; border:1px solid #cccccc; text-align:left; color:#000; padding:0.2em 0.4em; -moz-border-radius:6px">[[Archivo:User-desktop Gion.svg]] Otros apéndices</h2> |- |style="color:#000; font-size:100%;"| *[[Wikcionario:Anagramas|Anagramas]] *[[Especial:Imagelist|Lista de imágenes]] *[[Wikcionario:Apéndice:Enlaces sin formato|Enlaces sin formato]] |- <!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Ayuda----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> ! <div style="float:right; margin:2px 2px 0px 0px;">[[Archivo:Wiktprintable without text.svg|50px]]</div><h2 style="margin:0; background:#FFFCE6; font-size:150%; font-weight:bold; border:1px solid #cccccc; text-align:left; color:#000; padding:0.2em 0.4em; -moz-border-radius:6px">[[Archivo:Nuvola actions help.svg|50px]] Ayuda</h2> |- |style="color:#000; font-size:100%;"| *[[Ayuda:Mapa de ayuda|Mapa de Ayuda]] *[[Wikcionario:Convenciones para nombrar entradas|convenciones]] *[[Wikcionario:Estructura|estructura]], [[Wikcionario:Estilo|estilo]]) *[[Wikcionario:Tildes y sus problemas|Tildes y sus problemas]] *[[Wikcionario:Tesauro|Tesauro]] *[[Wikcionario:Imágenes en el Wikcionario|Imágenes]] *[[Wikcionario:Plantillas|Plantillas]] *[[Wikcionario:Gramática|Gramática]] |- |} <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Termina columna izquierda----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Inicia Columna Derecha---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> |class="MainPageBG" style="width:40%; border:1px solid #cef2e0; background:#f5faff; vertical-align:top; -moz-border-radius:4px"| <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Palabra de la semana---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <nowiki>{{palabra de la semana/{{CURRENTWEEK}}}}</nowiki> {| width="100%" cellpadding="2" cellspacing="5" style="vertical-align:top; background:none;" <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Índice rápido----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> ! <h2 style="margin:0; background:#F9F9F3; font-size:150%; font-weight:bold; border:1px solid #E8DDC9; text-align:left; color:#000; padding:0.2em 0.4em; -moz-border-radius:4px"> [[Archivo:Wiktprintable without text.svg|50px]] Índice rápido [[Archivo:Logo book2.png]] </h2> |- |style="color:#000; padding-left: 5px; padding-right: 5px;"| <nowiki>{{Alfabeto}}</nowiki> |- <!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Idiomas-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> ! <h2 style="margin:0; background:#F9F9F3; font-size:150%; font-weight:bold; border:1px solid #E8DDC9; text-align:left; color:#000; padding:0.2em 0.4em; -moz-border-radius:4px"> [[Archivo:Wiktprintable without text.svg|50px]] Idiomas [[Archivo:TOTW.png|50px]] </h2> |- |style="color:#000; padding-left: 5px; padding-right: 5px;"| '''Puede buscar palabras según su idioma:''' *'''[[Wikcionario:Índice/Por idioma|índices de lenguas]]''' **[[:Categoría:Español|palabras en español]] **[[:Categoría:Inglés|palabras en inglés]] **[[:Categoría:Mandarín|palabras en chino mandarín]] **[[:Categoría:Japonés|palabras en japonés]] **[[:Categoría:Quechua|palabras en quechua]] **[[:Categoría:Idiomas|palabras en otro idioma]] |- <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Referencias de idioma--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> ! <h2 style="margin:0; background:#F9F9F3; font-size:150%; font-weight:bold; border:1px solid #E8DDC9; text-align:left; color:#000; padding:0.2em 0.4em; -moz-border-radius:4px"> [[Archivo:Wiktprintable without text.svg|50px]] Referencias del idioma [[Archivo:Globe of letters.svg|50px]] </h2> |- |style="color:#000; padding-left: 5px; padding-right: 5px;"| *'''[[Wikcionario:Referencia/DE|Referencia del alemán]]'''<br /> *'''[[Wikcionario:Referencia/ES|Referencia del español]]''' **[[Wikcionario:Referencia/ES/Ortografía|ortografía]] **[[Wikcionario:Referencia/ES/Gramática|gramática]] **[[Wikcionario:Referencia/ES/Pronunciación|pronunciación]], **[[Wikcionario:Variantes regionales del español|variantes regionales]], **[[Wikcionario:Referencia/ES/Morfología|morfología]] **[[Wikcionario:Referencia/ES/Conjugación|conjugación]] **[[Wikcionario:Referencia/ES/Tesauro|tesauro]]<br /> *'''[[Wikcionario:Referencia/PT|Referencia del portugués]]''' **[[Wikcionario:Referencia/PT/Ortografía|ortografía]] **[[Wikcionario:Referencia/PT/Gramática|gramática]] **[[Wikcionario:Referencia/PT/Pronunciación|pronunciación]] **[[Wikcionario:Variantes regionales del portugués|variantes regionales]], **[[Wikcionario:Referencia/PT/Morfología|morfología]] **[[Wikcionario:Referencia/PT/Conjugación|conjugación]] **[[Wikcionario:Referencia/PT/Tesauro|tesauro]]<br /> *'''[[Wikcionario:Referencia/EN|Referencia del inglés]]''' **[[Wikcionario:Referencia/EN/Ortografía|ortografía]] **[[Wikcionario:Referencia/EN/Gramática|gramática]] **[[Wikcionario:Referencia/EN/Pronunciación|pronunciación]] **[[Wikcionario:Referencia/EN/Morfología|morfología]] **[[Wikcionario:Referencia/EN/Conjugación|conjugación]] **[[Wikcionario:Referencia/EN/Tesauro|tesauro]]<br /> *'''[[Wikcionario:Referencia/QU|Referencia del quechua]]''' **[[Wikcionario:Referencia/QU/Ortografía|ortografía]] **[[Wikcionario:Referencia/QU/Gramática|gramática]] **[[Wikcionario:Referencia/QU/Pronunciación|pronunciación]] **[[Wikcionario:Referencia/QU/Morfología|morfología]] **[[Wikcionario:Referencia/QU/Conjugación|conjugación]] **[[Wikcionario:Referencia/QU/Tesauro|tesauro]]<br /> *'''[[Wikcionario:Referencia|Referencias de otros idiomas]]''' |- <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Otros recursos idiomáticos---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> ! <h2 style="margin:0; background:#F9F9F3; font-size:150%; font-weight:bold; border:1px solid #E8DDC9; text-align:left; color:#000; padding:0.2em 0.4em; -moz-border-radius:4px"> [[Archivo:Wiktprintable without text.svg|50px]] Otros recursos idiomáticos [[Archivo:Icono de traducción.svg|50px]] </h2> |- |style="color:#000; padding-left: 5px; padding-right: 5px;"| *[[Wikcionario:Lista de lenguas|Lista de lenguas]] *[[Wikcionario:Fuentes para traductores|Fuentes para traductores]] *[[Wikcionario:Coordinación multilingüe|Coordinación multilingüe]] |- |} |} <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Termina columna derecha------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Inicia pie de portada--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <div style="clear: both; font-size: larger; padding-top: 1em; text-align: center"> <!--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Enlaces---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <nowiki>{{Enlaces}}</nowiki> <!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Wikcionarios--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <nowiki>{{Wikcionarios}}</nowiki> <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Otros proyectos de Wikimedia-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <nowiki>{{Proyectoswikimedia}}</nowiki> <!-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Termina pie de Portada-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> <span style="position:absolute;top:-30px;left:-155px;z-index:-3">[[Imagen:Wiktprintable without text.svg|150px]]</span> </div> i7orsn2bbum3ez9faoe0g2xnrb8dqy3 Wikcionario:Portada/Alternativa/2 4 60327 6076636 6075643 2026-04-05T01:34:10Z Tmagc 158167 6076636 wikitext text/x-wiki {{histórica}} [[Wikcionario:Portada/Alternativa|<--- Regresar a la primer Alternativa]] __NOTOC__ __NOEDITSECTION__ <nowiki>{{Bienvenido al Wikcionario}}</nowiki> {|style="margin:4px 0px 0px 0px; background:none;" |class="MainPageBG" style="width:60%; border:1px solid #cedff2; background:#ffffff; vertical-align:top; color:#000; -moz-border-radius:4px"| {|width="100%" cellpadding="2" cellspacing="5" style="vertical-align:top; background:#ffffff;" ! <div style="float:right; margin:2px 2px 0px 0px;">[[Imagen:Wiki.png|60px]]</div><h2 style="margin:0; background:#E6ECFF; font-size:150%; font-weight:bold; border:1px solid #cccccc; text-align:left; color:#000; padding:0.2em 0.4em; -moz-border-radius:6px">[[Imagen:Gnome-mime-application-rtf.png|50px]] Navegar por el [[Wikcionario]]</h2> |- |style="color:#000; font-size:100%;"|---Texto--- |- ! <div style="float:right; margin:2px 2px 0px 0px;">[[Imagen:Wiki.png|60px]]</div><h2 style="margin:0; background:#DCFFD1; font-size:150%; font-weight:bold; border:1px solid #cccccc; text-align:left; color:#000; padding:0.2em 0.4em; -moz-border-radius:6px">[[Imagen:Nuvola apps edu miscellaneous.png|50px]] Artículos <nowiki>([[:Categoría:Índice de categorías|Índice de categorías]])</nowiki></h2> |- |style="color:#000; font-size:100%; padding:5px; padding-top:10px; padding-bottom:10px"| *[[Wikcionario:Por orden alfabético|Por orden alfabético]] *[[Wikcionario:Por tema|Por tema]] *[[:Categoría:Palabras por número de letras|Por extensión de la palabra]] *[[Wikcionario:Sentencias|Sentencias]] *[[Wikcionario:Neologismos|Neologismos]] *[[Esquemas de categorización alternativos]] |- ! <div style="float:right; margin:2px 2px 0px 0px;">[[Imagen:Wiki.png|60px]]</div><h2 style="margin:0; background:#FFE6F9; font-size:150%; font-weight:bold; border:1px solid #cccccc; text-align:left; color:#000; padding:0.2em 0.4em; -moz-border-radius:6px">[[Imagen:Nuvola apps edu languages.svg|50px]] [[:Categoría:Apéndices|Apéndices]] según [[:Categoría:Campos semánticos|campos semánticos]]</h2> |- |style="color:#000; font-size:100%;"| *[[Wikcionario:Apéndice:Abreviaturas|Abreviaturas]] *[[Wikcionario:Apéndice:Acrónimos|Acrónimos y siglas]] *[[Wikcionario:Apéndice:Colores|Colores]] *[[Wikcionario:Apéndice:Vehículos|Vehículos]] *[[Wikcionario:Apéndice:Cronologías|Cronología]] *[[Wikcionario:Apéndice:Elementos|Elementos]] *[[Wikcionario:Apéndice:Números|Números]] *[[Wikcionario:Apéndice:Formas|Formas]] *[[Wikcionario:Apéndice:Minerales|Minerales]] *[[Wikcionario:Apéndice:Animales|Animales]] *[[Wikcionario:Apéndice:Plantas|Plantas]] *[[Wikcionario:Apéndice:Lugares|Lugares]] *[[Wikcionario:Apéndice:Personas|Personas]] *[[Wikcionario:Apéndice:Armamento|Armamento]] *[[Wikcionario:Apéndice:Historia|Términos históricos]] *[[Wikcionario:Apéndice:Términos marineros|Términos marineros]] *[[Wikcionario:Apéndice:Heráldica|Heráldica]] |- ! <div style="float:right; margin:2px 2px 0px 0px;">[[Imagen:Wiki.png|60px]]</div><h2 style="margin:0; background:#E6F2EF; font-size:150%; font-weight:bold; border:1px solid #cccccc; text-align:left; color:#000; padding:0.2em 0.4em; -moz-border-radius:6px">[[Imagen:Icon tools.svg|50px]] Apéndices según categorías gramaticales</h2> |- |style="color:#000; font-size:100%;"| *[[Wikcionario:Índice de verbos españoles|Verbos españoles (listado incompleto)]] |- ! <div style="float:right; margin:2px 2px 0px 0px;">[[Imagen:Wiki.png|60px]]</div><h2 style="margin:0; background:#FFEDCC; font-size:150%; font-weight:bold; border:1px solid #cccccc; text-align:left; color:#000; padding:0.2em 0.4em; -moz-border-radius:6px">[[Imagen:User-desktop Gion.svg]] Otros apéndices</h2> |- |style="color:#000; font-size:100%;"| *[[Wikcionario:Anagramas|Anagramas]] *[[Especial:Imagelist|Lista de imágenes]] *[[Wikcionario:Apéndice:Enlaces sin formato|Enlaces sin formato]] |- ! <div style="float:right; margin:2px 2px 0px 0px;">[[Imagen:Wiki.png|60px]]</div><h2 style="margin:0; background:#FFFCE6; font-size:150%; font-weight:bold; border:1px solid #cccccc; text-align:left; color:#000; padding:0.2em 0.4em; -moz-border-radius:6px">[[Imagen:Nuvola actions help.svg|50px]] Ayuda</h2> |- |style="color:#000; font-size:100%;"| *[[Ayuda:Mapa de ayuda|Mapa de Ayuda]] *[[Wikcionario:Convenciones para nombrar entradas|convenciones]] *[[Wikcionario:Estructura|estructura]], [[Wikcionario:Estilo|estilo]]) *[[Wikcionario:Tildes y sus problemas|Tildes y sus problemas]] *[[Wikcionario:Tesauro|Tesauro]] *[[Wikcionario:Imágenes en el Wikcionario|Imágenes]] *[[Wikcionario:Plantillas|Plantillas]] *[[Wikcionario:Gramática|Gramática]] |- |} |class="MainPageBG" style="width:40%; border:1px solid #cef2e0; background:#f5faff; vertical-align:top; -moz-border-radius:4px"| <nowiki>{{palabra de la semana/{{CURRENTWEEK}}}}</nowiki> {| width="100%" cellpadding="2" cellspacing="5" style="vertical-align:top; background:none;" ! <h2 style="margin:0; background:#F9F9F3; font-size:150%; font-weight:bold; border:1px solid #E8DDC9; text-align:left; color:#000; padding:0.2em 0.4em; -moz-border-radius:4px"> [[Imagen:Wiki.png|60px]] Índice rápido [[Imagen:Logo book2.png]] </h2> |- |style="color:#000; padding-left: 5px; padding-right: 5px;"| <nowiki>{{Alfabeto}}</nowiki> |- ! <h2 style="margin:0; background:#F9F9F3; font-size:150%; font-weight:bold; border:1px solid #E8DDC9; text-align:left; color:#000; padding:0.2em 0.4em; -moz-border-radius:4px"> [[Imagen:Wiki.png|60px]] Idiomas [[Imagen:TOTW.png|50px]] </h2> |- |style="color:#000; padding-left: 5px; padding-right: 5px;"| '''Puede buscar palabras según su idioma:''' *'''[[Wikcionario:Índice/Por idioma|índices de lenguas]]''' **[[:Categoría:Español|palabras en español]] **[[:Categoría:Inglés|palabras en inglés]] **[[:Categoría:Mandarín|palabras en chino mandarín]] **[[:Categoría:Japonés|palabras en japonés]] **[[:Categoría:Quechua|palabras en quechua]] **[[:Categoría:Idiomas|palabras en otro idioma]] |- ! <h2 style="margin:0; background:#F9F9F3; font-size:150%; font-weight:bold; border:1px solid #E8DDC9; text-align:left; color:#000; padding:0.2em 0.4em; -moz-border-radius:4px"> [[Imagen:Wiki.png|60px]] Referencias del idioma [[Imagen:Globe of letters.svg|50px]] </h2> |- |style="color:#000; padding-left: 5px; padding-right: 5px;"| *'''[[Wikcionario:Referencia/DE|Referencia del alemán]]'''<br /> *'''[[Wikcionario:Referencia/ES|Referencia del español]]''' **[[Wikcionario:Referencia/ES/Ortografía|ortografía]] **[[Wikcionario:Referencia/ES/Gramática|gramática]] **[[Wikcionario:Referencia/ES/Pronunciación|pronunciación]], **[[Wikcionario:Variantes regionales del español|variantes regionales]], **[[Wikcionario:Referencia/ES/Morfología|morfología]] **[[Wikcionario:Referencia/ES/Conjugación|conjugación]] **[[Wikcionario:Referencia/ES/Tesauro|tesauro]]<br /> *'''[[Wikcionario:Referencia/PT|Referencia del portugués]]''' **[[Wikcionario:Referencia/PT/Ortografía|ortografía]] **[[Wikcionario:Referencia/PT/Gramática|gramática]] **[[Wikcionario:Referencia/PT/Pronunciación|pronunciación]] **[[Wikcionario:Variantes regionales del portugués|variantes regionales]], **[[Wikcionario:Referencia/PT/Morfología|morfología]] **[[Wikcionario:Referencia/PT/Conjugación|conjugación]] **[[Wikcionario:Referencia/PT/Tesauro|tesauro]]<br /> *'''[[Wikcionario:Referencia/EN|Referencia del inglés]]''' **[[Wikcionario:Referencia/EN/Ortografía|ortografía]] **[[Wikcionario:Referencia/EN/Gramática|gramática]] **[[Wikcionario:Referencia/EN/Pronunciación|pronunciación]] **[[Wikcionario:Referencia/EN/Morfología|morfología]] **[[Wikcionario:Referencia/EN/Conjugación|conjugación]] **[[Wikcionario:Referencia/EN/Tesauro|tesauro]]<br /> *'''[[Wikcionario:Referencia/QU|Referencia del quechua]]''' **[[Wikcionario:Referencia/QU/Ortografía|ortografía]] **[[Wikcionario:Referencia/QU/Gramática|gramática]] **[[Wikcionario:Referencia/QU/Pronunciación|pronunciación]] **[[Wikcionario:Referencia/QU/Morfología|morfología]] **[[Wikcionario:Referencia/QU/Conjugación|conjugación]] **[[Wikcionario:Referencia/QU/Tesauro|tesauro]]<br /> *'''[[Wikcionario:Referencia|Referencias de otros idiomas]]''' |- ! <h2 style="margin:0; background:#F9F9F3; font-size:150%; font-weight:bold; border:1px solid #E8DDC9; text-align:left; color:#000; padding:0.2em 0.4em; -moz-border-radius:4px"> [[Imagen:Wiki.png|60px]] Otros recursos idiomáticos [[Imagen:Icono de traducción.svg|50px]] </h2> |- |style="color:#000; padding-left: 5px; padding-right: 5px;"| *[[Wikcionario:Lista de lenguas|Lista de lenguas]] *[[Wikcionario:Fuentes para traductores|Fuentes para traductores]] *[[Wikcionario:Coordinación multilingüe|Coordinación multilingüe]] |} |} <div style="clear: both; font-size: larger; padding-top: 1em; text-align: center"> <nowiki>{{Enlaces}}</nowiki> <nowiki>{{Wikcionarios}}</nowiki> <nowiki>{{Proyectoswikimedia}}</nowiki> </div> m7mbzqflwzcrc2etc60fhr54yyp2vsi mais 0 61492 6076676 5925023 2026-04-05T02:44:56Z TMCbot 164594 . 6076676 wikitext text/x-wiki {{desambiguación|Mais|maïs|maís|máis|màis|Maiš}} == {{lengua|et}} == {{pron-graf|leng=et}} === Etimología 1 === {{etimología|leng=et}}. ==== {{sustantivo|et}} ==== ;1: {{plm|maíz}}. == {{lengua|fr}} == {{pron-graf|leng=fr|1audio1=Fr-mais.ogg}} === Etimología 1 === {{etimología|leng=fr|la|magis}}. ==== {{conjunción|fr}} ==== ;1: {{plm|pero}}. == {{lengua|it}} == {{pron-graf|leng=it|v1=mais}} === Etimología 1 === {{etimología|leng=it}}. ==== {{sustantivo masculino|it}} ==== ;1: {{plm|maíz}}. {{sinónimo|leng=it|granturco}} == {{lengua|nb}} == {{pron-graf|leng=nb}} === Etimología 1 === {{etimología|leng=nb}}. ==== {{sustantivo|nb}} ==== ;1: {{plm|maíz}}. == {{lengua|oc}} == {{pron-graf|leng=oc|}} === Etimología === {{etimología|leng=oc}}. === {{adverbio|oc}} === ;1: {{plm|más}}. == {{lengua|pt}} == {{pron-graf|leng=pt|audio=LL-Q5146 (por)-Juliano P. Junho (Jjunho)-mais.wav|audio2=LL-Q5146 (por)-Sillim-mais.wav|audio3=Pt-mais.ogg|2audio=LL-Q5146 (por)-Santamarcanda-mais.wav|2audio2=LL-Q5146 (por)-Waldyrious-mais.wav}} === Etimología 1 === {{etimología|leng=pt|roa-opt|mais|sig=no}} y este del latín {{l+|la|magis}}. ==== {{adverbio de cantidad|pt}} ==== ;1: {{plm|más}}. * {{l|pt|a grama do vizinho é sempre mais verde}}. * {{l|pt|a pena é mais forte do que a espada}} == {{lengua|war}} == {{pron-graf|leng=war}} === Etimología 1 === {{etimología|leng=war}}. ==== {{sustantivo|war}} ==== ;1: {{plm|maíz}}. == Referencias y notas == <references /> rqezu4uq9kg4ysmh7hfnr3xjqrr0c12 Plantilla:revisión 10 65560 6076627 5944006 2026-04-05T00:58:30Z Tmagc 158167 6076627 wikitext text/x-wiki {{metaplantilla de avisos | tipo = contenido | texto = '''Esta página necesita revisión.''' Asunto:&nbsp;{{{1|''no especificado''}}} }}<noinclude>{{documentación}}</noinclude> <includeonly>[[Categoría:Páginas a revisar]]</includeonly> 5len8nvvk8f6nibhawzy0r13ck43gfq floor 0 66967 6076623 6043547 2026-04-05T00:28:44Z Adelpine 34679 Amplía los hablantes de algunas pronunciaciones AFI 6076623 wikitext text/x-wiki == {{lengua|en}} == {{pron-graf|leng=en |1pron1=Received Pronunciation|1fono1=flɔː|1audio1=En-uk-floor.ogg|1aunota1=Londres |2pron1=General American, Canadá|2fono1=floɹ|2audio1=en-us-floor.ogg|2aunota=California|2audio2=LL-Q1860 (eng)-Wodencafe-floor.wav|2aunota2=Texas|2audio3=LL-Q1860 (eng)-Grendelkhan-floor.wav|2aunota3=Connecticut |3pron1=Australia, Nueva Zelanda|3fono1=floː |4pron1=rótico sin la fusión horse–hoarse|4fono1=flo(ː)ɹ |5pron1=no rótico sin la fusión horse–hoarse|5fono1=floə |6pron1=no rótico con la fusión dough-door, vernáculo afroamericano|6fono1=floʊ |ls=1 }} === Etimología 1 === {{etimología|leng=en|enm|flor}}, {{l+|enm|flore}}, {{etim|leng=en|ang|flor|alt=flōr}}, {{etim|leng=en|gmw-pro|*flōr}}, {{etim|leng=en|gem-pro|*flṓraz}}, a su vez {{etim|leng=en|ine-pro|*pleh₂ros}}, de {{l+|ine-pro|*pleh₂-|glosa=llano}}. Compárese el alemán {{l+|de|Flur}} o el sueco {{l+|sv|flor}}. ==== {{sustantivo|en}} ==== {{en.sust|c}} ;1: {{plm|suelo}}. ;2: {{plm|piso}}, [[planta]]. ;3: {{plm|nivel}} [[mínimo]]. {{antónimo|leng=en|ceiling}}. {{ejemplo|Dr Arnold Lehman, who is the chief pharmacologist of the Food and Drug Administration, says there is neither a ''floor'' below which DDT is not absorbed nor a ceiling beyond which absorption and storage ceases.|Silent Spring.|autor=[[w:Rachel Carson|Rachel Carson]]|c=libro|edición=1968|editorial=[[w:Penguin Books|Penguin Books]]|fecha=1962|páginas=37|título=silenciosa|u=w:Primavera}} ;4: {{plm|fondo}}. ;5: {{plm|zona}} reservada a los [[titular]]es de [[escaño]]s en un [[parlamento]]. ;6: Por extensión, [[palabra]], [[derecho]] a hablar. ==== {{verbo|en}} ==== ;7: {{plm|solar}}, [[entarimar]]. ;8: {{plm|derribar}}, [[tumbar]]. ;9: {{plm|anonadar}}. ==== Conjugación ==== {{en.v}} == Referencias y notas == <references /> hccast65q3xo3679k48vdwvv1yrbzyw charge 0 67058 6076544 5851011 2026-04-04T15:37:27Z Adelpine 34679 Mejora algunas pronunciaciones AFI y agrega una inflexión 6076544 wikitext text/x-wiki {{desambiguación|Charge}} == {{lengua|fr}} == {{pron-graf|leng=fr|audio=Fr-charge.ogg|aunota=Francia}} === Etimología === {{etimología|leng=fr|fro|carge}}. ==== {{sustantivo femenino|fr}} ==== {{fr.sust}} ;1: {{plm|carga}}. ;2: {{plm|responsabilidad}}, [[cargo]], [[función]]. ;3: {{plm|fuerza}}. ;4: La acción de subir la carga. ;5: {{plm|despensa}}. ;6: {{plm|cargo}} (cantidad de dinero que se debe pagar). ;7: {{plm|oficio}}. ;8: {{plm|acusación}}. ;9: {{plm|ataque}}, [[carga]]. ;10: {{plm|carga}} de un arma de fuego. ;11: {{plm|exageración}} voluntaria y cómica. ==== Véase también ==== {{W|idioma=fr}} === Forma flexiva === ==== Forma verbal ==== ;1: Presente del modo indicativo para los pronombres je/il/elle/on del verbo [[charger]]. ;2: Presente del modo subjuntivo para los pronombres je/il/elle/on del verbo [[charger]]. ;3: Presente del modo imperativo para la segunda persona del singular del verbo [[charger]]. [[Categoría:FR:Formas verbales]] == {{lengua|en}} == {{pron-graf|leng=en |pron=Received Pronunciation|fono=t͡ʃɑːd͡ʒ|audio=LL-Q1860 (eng)-Vealhurl-charge.wav|aunota=Berkshire |2pron=General American, Canadá|2fono=t͡ʃɑɹd͡ʒ|2audio=en-us-charge.ogg|2aunota=California |3pron=Australia, Nueva Zelanda|3fono=t͡ʃɐːd͡ʒ|3audio=en-au-charge.ogg|3aunota=Queensland }} === Etimología === {{etimología|leng=en|enm|chargen}}, {{etim|leng=en|fro|chargier}}, {{etim|leng=en|la|carricare|alt=carricāre}}. === {{verbo|en}} === ;1: {{plm|cobrar}}. ;2: {{plm|poner}} en la cuenta. ;3: {{plm|acusar}}. ;4: {{plm|cargar}} contra, [[arremeter]]. ;5: {{plm|irrumpir}}. ;6: {{plm|cargar}} eléctricamente. ;7: {{plm|responsabilizar}}. === {{sustantivo|en}} === {{en.sust|ci}} ;8: {{plm|precio}}, [[cargo]]. ;9: {{plm|acusación}}. ;10: {{plm|ataque}}, [[carga]]. ;11: {{plm|carga}} (eléctrica). ;12: {{plm|cuidado}}, [[responsabilidad]], [[cargo]]. ;13: {{plm|carga}} de explosivo o similar. ;14 {{csem|leng=en|heráldica}}: {{plm|mueble}}, [[cargo]]. === Véase también === {{W|idioma=en}} === Conjugación === {{en.v}} im1jq8q7lnjpbbm4c5hhnfbn8teuqps influence 0 67323 6076528 5915706 2026-04-04T12:22:40Z Adelpine 34679 Agrega una pronunciación AFI (elaboración propia) 6076528 wikitext text/x-wiki == {{lengua|fr}} == {{pron-graf|leng=fr|fono=ɛ̃.fly.ɑ̃s|audio=Fr-influence.ogg|aunota=París, [y.nɛ̃.fly.ɑ̃s]}} === Etimología === {{etimología|leng=fr|la|influentia|significado=no}}. === {{sustantivo femenino|fr}} === {{fr.sust}} ;1: {{plm|influencia}}. == {{lengua|en}} == {{pron-graf|leng=en |pron=Received Pronunciation, General American, Canadá, Australia|fono=ˈɪn.flʊ.əns|fnota=raro en los EE. UU.|audio=en-us-influence.ogg|aunota=California|fono2=ˈɪn.flu.əns|fnota2=casual en el Reino Unido |2pron=EE. UU., no estándar|2fono=ɪnˈflu.əns }} === Etimología === {{etimología|leng=en|enm|influence}}, {{etim|leng=en|fro|influence}} ("emanación de las estrellas que afectan el destino de alguien"), {{etim|leng=en|la-med|influentia|alt=īnfluentia}}, {{etim|leng=en|la|influens|alt=īnfluēns}} ("fluyendo hacia dentro"). === {{sustantivo|en}} === {{en.sust|ci}} ;1: [[influencia|Influencia]]. === {{verbo|en}} === ;2: [[influenciar|Influenciar]]. ;3: [[motivar|Motivar]], [[impeler]]. === Conjugación === {{en.v}} okx2zdd13vldjzqr7j0u6z7h3h6m8lo sopa 0 70083 6076718 5912569 2026-04-05T03:48:23Z Tmagc 158167 6076718 wikitext text/x-wiki {{desambiguación|SOPA|sopá}} == {{lengua|es}} == {{pron-graf}} [[Archivo:Austrian Dish 5.JPG|thumb|[1]]] === Etimología 1 === {{etimología|la-lat|suppa}}, {{etim|gem-pro|*supô}}. ==== {{sustantivo femenino|es}} ==== {{es.sust}} ;1 {{csem|alimento}}: Preparación liquida y cocida junto con otros ingredientes como [[carne]] o [[verduras]]. {{hipónimo|potaje|caldo}}. {{relacionado|sope}}. ;2 {{csem|alimento}}: Dícese del [[sancocho]], preparación similar pero más cargada. {{ámbito|Venezuela}} {{uso|coloquial|familiar}} ==== Locuciones ==== * [[hecho una sopa]]: empapado, embebido en algún líquido (España, coloquial). * [[soltar la sopa]]: revelar lo que se sabe, confesar algún delito (Cuba, Puerto Rico, Venezuela; coloquial) ==== Véase también ==== {{w}} * [[sopar]] * [[ensopar]] ==== Traducciones ==== {{trad-arriba}} {{t|ain|t1=オハウ}} {{t|de|a1=1|g1=f|t1=Suppe}} {{t|fr|a1=1|g1=f|t1=soupe}} {{t|he|t1=מרק}} {{t|id|a1=1|t1=sup}} {{t|en|a1=1|t1=soup}} {{t|lb|a1=1|g1=f|t1=Zopp}} {{t|nl|a1=1|t1=soep}} {{t|pl|g1=f|t1=zupa}} {{trad-abajo}} === Etimología 2 === {{etimología|metátesis|paso}}. ==== {{sustantivo masculino|es}} ==== {{es.sust}} ;1: {{plm|paso}}. {{uso|coloquial}} {{ámbito|Argentina}} {{ejemplo|Las respuestas estallaron en la Trama: que no sabía lo que decía, que no le iba a hacer caso ni su nieto, que mejor vendiera tigres extinguidos, que era un '''sopa'''.|c=libro|t=Sinfín|a=Martín Caparrós|f=2020|isbn=9789877691030|editorial=Penguin Random House|p=304|parte=4|cap=5}} === Forma flexiva === ==== Forma verbal ==== ;1: {{forma verbo|sopar|m=indicativo|p=3s|t=presente}}. ;2: {{forma verbo|sopar|2s|imperativo|afirmativo=s}}. == {{lengua|sv}} == {{pron-graf|leng=sv|1audio1=Sv-sopa.ogg|1fone1=˘suːpa}} === Etimología 1 === {{etimología|leng=sv}}. ==== {{sustantivo|sv}} ==== ;1: {{plm|basura}}. {{uso|leng=sv}} se emplea casi siempre en plural. ;2: {{plm|persona}} sin [[valor]]. {{uso|leng=sv|coloquial|peyorativo}} ==== Declinación ==== {{sv.sust|c-or}} == Referencias y notas == <references /> e8c85j5ewfy7s5yu56jrdylyhabr6pw board 0 70884 6076624 6043125 2026-04-05T00:40:07Z Adelpine 34679 Mejora una pronunciación AFI 6076624 wikitext text/x-wiki == {{lengua|en}} == {{pron-graf|leng=en |pron=Received Pronunciation|fono=bɔːd |2pron=General American, Standard Canadian|2fono=boɹd|2audio=en-us-board.ogg|2aunota=California|2audio2=LL-Q1860 (eng)-Wodencafe-board.wav|2aunota2=Texas|2audio3=LL-Q1860 (eng)-Grendelkhan-board.wav|2aunota3=Connecticut |3pron=Australia, Nueva Zelanda|3fono=boːd |4pron=rótico sin la fusión horse–hoarse|4fono=bo(ː)ɹd |5pron=no rótico sin la fusión horse–hoarse|5fono=boəd |ls=1 |homófono=bored }} === Etimología === {{etimología|leng=en|enm|bord}}. === {{sustantivo|en}} === {{en.sust|ci}} ;1: {{plm|tabla}}, {{l|es|tablón}}. ;2: {{plm|trampolín}}. ;3: Abreviatura de [[pizarrón]]. ;4: {{plm|tablero}}. ;5: {{plm|cartelera}}. ;6: {{plm|mural}}. ;7: {{plm|junta}}, {{l|es|consejo}}. ;8: {{plm|tribunal}}. ;9: {{plm|borda}}. ;10: {{plm|alimentos}}. === {{verbo|en}} === ;11: {{plm|abordar}}. ;12: Proveer alimentos a cambio de una compensación. ;13: Recibir alimentos a cambio de una compensación. === Conjugación === {{en.v}} == Referencias y notas == <references /> ifzfui9723j7t0bm6g7su59dpdoig0l dinheiro 0 79975 6076656 5928018 2026-04-05T02:44:07Z TMCbot 164594 . 6076656 wikitext text/x-wiki == {{lengua|pt}} == {{pron-graf|leng=pt|audio=LL-Q5146 (por)-Sillim-dinheiro.wav|2audio=LL-Q5146 (por)-Nelson Ricardo 2500-dinheiro.wav|2audio2=LL-Q5146 (por)-Santamarcanda-dinheiro.wav}} === Etimología === {{etimología|leng=pt}} === {{sustantivo masculino|pt}} === {{pt.sust}} ;1: {{plm|dinero}}. == Referencias y notas == <references /> nvv7ck1twpv803obnmuojcxtjw59paf trazer 0 79981 6076705 5908215 2026-04-05T02:46:11Z TMCbot 164594 . 6076705 wikitext text/x-wiki == {{lengua|pt}} == {{pron-graf|leng=pt|ayuda=trazêr|2audio=LL-Q5146 (por)-Santamarcanda-trazer.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-trazer.wav}} === Etimología === {{etimología|leng=pt|roa-opt|trager}}, y este {{etim|leng=pt|la|trahere|alt=trahĕre}}, infinitivo activo de presente de {{l+|la|traho|trahō}} ("[[halar]], [[arrastrar]]"). === {{verbo transitivo|pt}} === ;1: {{plm|traer}}. {{antónimo|leng=pt|levar}} {{relacionado|leng=pt|atração|atrair|traz|trazida|trouxa}} ;2: {{plm|conducir}} (un vehículo). ;3: {{plm|ocasionar}} (una complicación). === Conjugación === {{pt.v}} == Referencias y notas == <references /> 16krpz0iellg2ipsbhgrq8libnr0vey beijo 0 82573 6076646 5826844 2026-04-05T02:43:31Z TMCbot 164594 . 6076646 wikitext text/x-wiki == {{lengua|pt}} == {{pron-graf|leng=pt|2audio=LL-Q5146 (por)-Santamarcanda-beijo.wav}} === Etimología === {{etimología|la|basium|leng=pt}} y este de etimología incierta. Compárese el español ''[[beso]]'' === {{sustantivo masculino|pt}} === {{pt.sust}} ;1: {{plm|beso}} == Referencias y notas == <references /> 91hx2wf52duewwnme87g2kxe40dnyce hoje 0 83114 6076668 5503549 2026-04-05T02:44:38Z TMCbot 164594 . 6076668 wikitext text/x-wiki == {{lengua|pt}} == {{pron-graf|leng=pt|ayuda=hôje|audio=LL-Q5146 (por)-Sillim-hoje.wav|2audio=LL-Q5146 (por)-Santamarcanda-hoje.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-hoje.wav}} === Etimología 1 === {{etimología|roa-opt|oge|leng=pt}}, y este {{etim|leng=pt|la|hodie}}. ==== {{adverbio de tiempo|pt}} ==== ;1: {{plm|hoy}}. == Referencias y notas == <references /> ieik5ccf0jyck9qbmzdvgidzjxanmli criança 0 83250 6076652 5826863 2026-04-05T02:43:57Z TMCbot 164594 . 6076652 wikitext text/x-wiki == {{lengua|pt}} == {{pron-graf|leng=pt|2audio=LL-Q5146 (por)-Santamarcanda-criança.wav}} === Etimología === {{etimología|la-vul|creantia|leng=pt}}. === {{sustantivo femenino|pt}} === {{pt.sust}} ;1: {{plm|niño}}, [[niña]]. {{relacionado|leng=pt|menino|menina}} ;2: {{plm|infante}}. == Referencias y notas == <references /> 35d7n286hm1p22dgoa7s6vs22qmg6it revenge 0 83262 6076540 6044327 2026-04-04T15:21:56Z Adelpine 34679 Separa algunas pronunciaciones AFI por dialecto o país 6076540 wikitext text/x-wiki == {{lengua|en}} == {{pron-graf|leng=en |pron=Received Pronunciation|fono=ɹɪˈvɛnd͡ʒ |2pron=General American, Standard Canadian|2fono=ɹɪˈvɛnd͡ʒ|2audio=en-us-revenge.ogg|2aunota=California|2fono2=ɹiˈvɛnd͡ʒ|2fono3=ɹəˈvɛnd͡ʒ |3pron=Australia|3fono=ɹɪˈvend͡ʒ|3fono2=ɹəˈvend͡ʒ |4pron=Nueva Zelanda|4fono=ɹəˈvend͡ʒ |ls=2 }} === Etimología === {{etimología|leng=en}}. === {{sustantivo|en}} === {{en.sust|gi}} ;1: {{plm|venganza}}. === {{verbo|en}} === ;2: {{plm|vengar}}, {{l|es|vengarse}}. === Conjugación === {{en.v}} == Referencias y notas == <references /> a0o10qx3x9xuwwcwzfxiqevmjtgigd5 ilha 0 83311 6076669 5826921 2026-04-05T02:44:41Z TMCbot 164594 . 6076669 wikitext text/x-wiki == {{lengua|pt}} == {{pron-graf|leng=pt|audio=Ilha - PORT.wav|2audio=LL-Q5146 (por)-Santamarcanda-ilha.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-ilha.wav}} === Etimología === {{etimología|leng=pt|roa-opt|illa}}, {{etim|leng=pt|la|insula|alt=īnsula}}. ==== {{sustantivo femenino|pt}} ==== {{pt.sust}} ;1 {{csem|leng=pt|geografía}}: {{plm|isla}}. ==== Véase también ==== {{W|idioma=pt}} == Referencias y notas == <references /> e1xo8ozorq6tejsygjg5bafyeph8mrc zéro 0 91161 6076550 5841412 2026-04-04T16:10:46Z Adelpine 34679 Mejora la pronunciación AFI 6076550 wikitext text/x-wiki {{desambiguación|zero|}} == {{lengua|fr}} == {{pron-graf|leng=fr|audio=Fr-zéro.ogg|aunota=París}} === Etimología === {{etimología|leng=fr}}. === {{sustantivo masculino|fr}} === {{fr.sust}} ;1: {{plm|cero}}. === Véase también === {{w|leng=fr}} == Referencias y notas == <references /> 53gtre2e0sana0h0b2qcw8db638g1rm ainda 0 92278 6076642 6060546 2026-04-05T02:43:14Z TMCbot 164594 . 6076642 wikitext text/x-wiki {{desambiguación|aínda}} == {{lengua|roa-opt}} == {{pron-graf|leng=roa-opt}} === {{adverbio|roa-opt}} === ;1: {{grafía|leng=roa-opt|aynda}}. == {{lengua|lad}} == {{pron-graf|leng=lad|fgraf=aínda |g=אינדה |v=ayinda|valt=ayínda}} === Etimología === {{etimología|leng=lad}} === {{adverbio|lad}} === ;1: {{plm|aún}}, {{l|es|todavía}}. {{sinónimo|leng=lad|dainda|alt=daínda}}. == {{lengua|pt}} == {{pron-graf|leng=pt|1audio1=LL-Q5146 (por)-Juliano P. Junho (Jjunho)-ainda.wav |2audio1=LL-Q5146 (por)-Santamarcanda-ainda.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-ainda.wav |g1=ahinda|gnota1=obsoleta|g2=ahynda|gnota2=obsoleta|g3=aynda|gnota3=obsoleta}} === Etimología === {{etimología|leng=pt|roa-opt|aynda|aún}}, y este de {{l+|roa-opt|a-}} e {{l+|roa-opt|inda}}. ==== {{adverbio|pt}} ==== ;1: {{plm|aun}}, {{l|es|aún}}, {{l|es|todavía}}. {{sinónimo|leng=pt|inda|nota=regional}}. {{ejemplo|leng=pt|'''Ainda''' não almocei, e falta ler um livro ainda.‎|trad=Aún no he almorzado, y aún me falta leer un libro.}} ;2: {{plm|aún}} (enfatiza una comparación). {{ejemplo|leng=pt|O Canadá é '''ainda''' mais frio que os Estados Unidos.‎|trad=Canadá es aún más frío que los Estados Unidos.}} ;3: {{plm|algún día}}. {{sinónimo|leng=pt|um dia}}. {{ejemplo|leng=pt|Andorinhas '''ainda''' conseguirão carregar cocos.‎|trad=Algún día las golondrinas conseguirán portar cocos.}} ;4: {{plm|apenas}}, {{l|es|solo}}. {{sinónimo|leng=pt|apenas|somente}}. {{ejemplo|leng=pt|'''Ainda''' há dez minutos falávamos de ti.‎|trad=Hablábamos de ti apenas hace diez minutos.}} ;5: {{plm|al menos}}. {{sinónimo|leng=pt|ao menos|pelo menos}}. {{ejemplo|leng=pt|'''Ainda''' se tivesse tempo, teria estudado.‎|trad=Si al menos hubiera tenido tiempo, habría estudiado.}} ;6: {{plm|aún}} (para ejemplos extremos). {{ejemplo|leng=pt|Já viajaram à França, Alemanha e '''ainda''' à Itália.‎|trad=Ya viajaron a Francia, Alemania y aún Italia.}} ;7: A pesar de todo ({{l|es|continuamente}}). {{ejemplo|leng=pt|Perdeste todo seu dinheiro mas '''ainda''' apostas?‎|trad=¿Perdiste toda tu pasta pero juegas a pesar de todo?}} ;8: {{plm|también}} (en {{l|es|adición}}). ==== Locuciones ==== *{{l+|pt|ainda assim}} *{{l+|pt|ainda bem}} *{{l+|pt|ainda por cima}} *{{l+|pt|ainda que}} == Referencias y notas == <references /> elmmi0grfu2yxcjptz9howtkcpp6pur janeiro 0 92521 6076670 5857792 2026-04-05T02:44:43Z TMCbot 164594 . 6076670 wikitext text/x-wiki == {{lengua|pt}} == {{pron-graf|leng=pt|audio=LL-Q5146 (por)-MedK1-janeiro.wav|2audio=LL-Q5146 (por)-Nelson Ricardo 2500-janeiro.wav|g=Janeiro|gnota=usada en Portugal hasta la entrada en vigencia del [[w:Acuerdo ortográfico de la lengua portuguesa de 1990|Acuerdo Ortográfico de la Lengua Portuguesa de 1990]]}} === Etimología === {{etimología|leng=pt|la|Ianuarius}}. ==== {{sustantivo masculino|pt}} ==== {{pt.sust}} ;1 {{csem|leng=pt|meses}}: {{plm|enero}}. ==== Véase también ==== {{w|leng=pt}} == Referencias y notas == <references /> rfbdnkwoaxjh9exxl412ld5r8rvcg8n lembrar 0 92577 6076672 5908535 2026-04-05T02:44:49Z TMCbot 164594 . 6076672 wikitext text/x-wiki == {{lengua|pt}} == {{pron-graf|leng=pt|2audio=LL-Q5146 (por)-Nelson Ricardo 2500-lembrar.wav|2audio2=LL-Q5146 (por)-Santamarcanda-lembrar.wav}} === Etimología === {{etimología|leng=pt|roa-opt|nembrar}}, {{etim|leng=pt|la|memorare|alt=memorāre}}. Compárese el español {{l+|es|membrar}}. === {{verbo transitivo|pt}} === ;1: {{plm|recordar}}. ;2: {{plm|asemejarse}} o [[parecerse]]. ;3: {{plm|sugerir}}. === Conjugación === {{pt.v}} === Véase también === *{{l|pt|lembrar-se}}. == Referencias y notas == <references /> 2usx9n6r6nqdqiqtxq6iyf7wka9sqqn Plantilla:marcar sin referencias 10 100111 6076628 6076364 2026-04-05T01:02:42Z Tmagc 158167 Revierto, sigue viéndose fatal. Prefiero que quede el error hasta que tomemos una mejor decisión. 6076628 wikitext text/x-wiki <span style="background-color:#fffeaa;">{{{1|}}}</span>{{cita requerida|{{{2|}}}}}<noinclude>[[Categoría:Plantillas de uso general]]</noinclude> rbv6oiyk3xwefrc4l96n7xkrccggdky jeito 0 104242 6076671 5826857 2026-04-05T02:44:45Z TMCbot 164594 . 6076671 wikitext text/x-wiki == {{lengua|es}} == {{pron-graf|audio=LL-Q1321 (spa)-Mentxuwiki-jeito.wav}} === Etimología === {{etimología|gl|xeito}} y este {{etim|la|iactus|tiro, lanzamiento}}. === {{sustantivo masculino|es}} === {{es.sust}} ;1: Tipo de red para pescar [[sardina]] o pescado similar con que se faena en las aguas atlánticas. === Locuciones === * [[al jeito]]: Usando jeitos para pescar sardina o pescado similar === Véase también === {{w}} === Traducciones === {{trad-arriba}} {{t|gl|t1=xeito}} {{trad-abajo}} == {{lengua|pt}} == {{pron-graf|leng=pt|audio=Pt-br-jeito.ogg|2audio=LL-Q5146 (por)-Nelson Ricardo 2500-jeito.wav|2audio2=LL-Q5146 (por)-Mentxuwiki-jeito.wav|2audio3=LL-Q5146 (por)-Santamarcanda-jeito.wav}} === Etimología === {{etimología|leng=pt|roa-opt|geito}}, {{etim|leng=pt|la-vul|*iectus}}, {{etim|leng=pt|la|iactus|lanzamiento}}. Compárese el gallego {{l+|gl|xeito}}, así como el italiano {{l+|it|getto}} y el francés {{l+|fr|jet}}. ==== {{sustantivo masculino|pt}} ==== {{pt.sust}} ;1: {{plm|manera}}, [[modo]], índole, carácter. ;2: {{plm|solución}}. ;3: {{plm|torcedura}}. ;4: {{plm|gesto}}. ==== Locuciones ==== {{trad-arriba|Locuciones}} * {{l|pt|com jeito}} * {{l|pt|dar um jeito}} * {{l|pt|de jeito}} * {{l|pt|de jeito maneira}} * {{l|pt|fazer jeito}} {{trad-abajo}} == Referencias y notas == <references /> 6wzm0hdo5nh1x51g40sz3qpb4g926oy adeus 0 109560 6076641 5503596 2026-04-05T02:43:12Z TMCbot 164594 . 6076641 wikitext text/x-wiki == {{lengua|gl}} == {{pron-graf|leng=gl}} === Etimología === {{etimología|leng=gl}} === {{interjección|gl}} === ;1: {{plm|adiós}} == {{lengua|pt}} == {{pron-graf|leng=pt|audio=Pt-br-adeus.ogg|audio2=LL-Q5146 (por)-Juliano P. Junho (Jjunho)-adeus.wav|2audio=LL-Q5146 (por)-Santamarcanda-adeus.wav|2audio2=Pt adeus.ogg}} === Etimología === {{etimología|leng=pt|compuesto|a|deus}}. === {{interjección|pt}} === ;1: {{plm|adiós}}. == Referencias y notas == <references /> d6yfoyjjxk1csqmjfz1yvyic5kbaz1p bastante 0 111173 6076644 6060468 2026-04-05T02:43:27Z TMCbot 164594 . 6076644 wikitext text/x-wiki == {{lengua|es}} == {{pron-graf|1audio1=LL-Q1321 (spa)-Marreromarco-bastante.wav|1aunota1=Venezuela}} === Etimología 1 === {{etimología|sufijo|bastar|nte|num=1}}. ==== {{adjetivo|es}} ==== {{es.adj|ng}} ;1: Que [[bastar|basta]].<ref name="dpu">{{LuisRamón|tomo=2}}</ref> {{sinónimo|suficiente}}. ;2: Muy, mucho, excesivo. {{sinónimo|demasiado}} ==== {{adverbio de cantidad|es}} ==== ;3: Ni [[mucho]] ni [[poco]], sin sobra ni falta, [[suficientemente]].<ref name="dpu"/> ;4: No poco.<ref name="dpu"/> ;5: Mucho. ==== Traducciones ==== {{trad-arriba}} {{t|ast|a1=1|t1=bastante}} {{t|br|a1=3|t1=a-walc'h|t2=trawalc'h}} {{t|ca|a1=3|t1=bastant|t2=prou}} {{t|co|a1=3|t1=abbastanza}} {{t|fr|a1=3|t1=assez|t2=suffisamment}} {{t|gl|a1=3|t1=abondo|t2=bastante|t3=dabondo|t4=suficientemente}} {{t|ia|a1=3|t1=bastante}} {{t|en|a1=3|t1=enough}} {{t|it|a1=1|t1=adeguato|t2=bastante|t3=sufficiente|a3=2|t4=abbastanza|t5=assai|t6=basta|t7=bastantemente|a7=3|t8=assai|t9=molto}} {{t|lad|a1=4–5|t1=bastante}} {{t|pap|a1=3|t1=bastante|t2=suficientemente}} {{t|pt|a1=4–5|t1=bastante}} {{t|ro|a1=1,3|t1=destul|t2=suficient}} {{t|sc|a1=3|t1=bastante}} {{t|scn|a1=3|t1=abbastanti}} {{trad-abajo}} == {{lengua|ast}} == {{pron-graf|leng=ast}} === Etimología 1 === {{etimología|leng=ast|sufijo|bastar|ante}}. ==== {{adjetivo|ast}} ==== {{ast.adj}} ;1: {{plm}}, {{l|es|cumplido}} o {{l|es|suficiente}}. == {{lengua|gl}} == {{pron-graf|leng=gl}} === Etimología 1 === {{etimología|leng=gl|sufijo|bastar|ante}}. ==== {{adverbio de cantidad|gl}} ==== ;1: {{plm|a suficiencia}}, {{l|es|bastante}}, {{l|es|bastantemente}}, {{l|es|cumplidamente}} o {{l|es|suficientemente}}. {{sinónimo|leng=gl|abondo|dabondo|suficientemente}}. {{antónimo|leng=gl|insuficientemente}}. ==== {{adjetivo|gl}} ==== {{gl.adj}} ;2: {{plm}}, {{l|es|cumplido}} o {{l|es|suficiente}}. {{sinónimo|leng=gl|abondo}} == {{lengua|ia}} == {{pron-graf|leng=ia}} === Etimología 1 === {{etimología|leng=ia}}. ==== {{adverbio de cantidad|ia}} ==== ;1: {{plm|a suficiencia}}, {{l|es|bastante}}, {{l|es|bastantemente}}, {{l|es|cumplidamente}} o {{l|es|suficientemente}}. == {{lengua|it}} == {{pron-graf|leng=it}} === Etimología 1 === {{etimología|leng=it|sufijo|bastare|ante}}. ==== {{adjetivo|it}} ==== {{it.adj|ng}} ;1: {{plm}} o {{l|es|suficiente}}. {{sinónimo|leng=it|adeguato|sufficiente}}. === Forma flexiva === ==== Forma verbal ==== ;1: {{participio|bastare|pr|leng=it}}. == {{lengua|nrf}} == {{pron-graf|leng=nrf}} === Forma flexiva === ==== Forma adjetiva ==== ;1: {{f.adj2|bastant|f|s}}. {{ámbito|leng=nrf|jerseyés}} == {{lengua|lad}} == {{pron-graf|leng=lad}} === Etimología 1 === {{etimología|leng=lad|sufijo|bastar|ante}}. ==== {{adverbio de cantidad|lad}} ==== ;1: {{plm|a suficiencia}}, {{l|es|bastante}}, {{l|es|bastantemente}}, {{l|es|cumplidamente}} o {{l|es|suficientemente}}. ;2: {{plm|mucho}} o {{l|es|muy}}. == {{lengua|pap}} == {{pron-graf|leng=pap}} === Etimología 1 === {{etimología|leng=pap}}. ==== {{adverbio de cantidad|pap}} ==== ;1: {{plm|a suficiencia}}, {{l|es|bastante}}, {{l|es|bastantemente}}, {{l|es|cumplidamente}} o {{l|es|suficientemente}}. == {{lengua|pt}} == {{pron-graf|leng=pt|1audio=LL-Q5146 (por)-Juliano P. Junho (Jjunho)-bastante.wav|2audio1=LL-Q5146 (por)-Santamarcanda-bastante.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-bastante.wav}} === Etimología 1 === {{etimología|leng=pt|sufijo|bastar|ante}}. ==== {{adverbio de cantidad|pt}} ==== ;1: {{plm|a suficiencia}}, {{l|es|bastante}}, {{l|es|bastantemente}}, {{l|es|cumplidamente}} o {{l|es|suficientemente}}. {{sinónimo|leng=pt|assaz|basta|bastantemente|chega|suficientemente}}. {{antónimo|leng=pt|insuficientemente}}. ;2: {{plm|mucho}} o {{l|es|muy}}. {{sinónimo|leng=pt|assaz|bem|demais|mui|muito}}. {{antónimo|leng=pt|pouco}}. ==== {{pronombre|pt}} ==== ;3: {{plm|mucho}}. {{sinónimo|leng=pt|muito}}. {{antónimo|leng=pt|pouco}}. {{ejemplo|Leio '''bastantes''' livros.|trad=Leo muchos libros.}} ==== {{adjetivo|pt}} ==== {{pt.adj|ng}} ;4: Que satisface los {{l|es|requisito}}s. {{uso|leng=pt|derecho}}. {{sinónimo|leng=pt|suficiente}}. ==== Locuciones ==== {{trad-arriba|locuciones}} * {{l|pt|o bastante}} {{trad-abajo}} ==== Información adicional ==== {{derivad|leng=pt|bastantão|bastantemente}} == {{lengua|sc}} == {{pron-graf|leng=sc}} === Etimología 1 === {{etimología|leng=sc}}. ==== {{adjetivo|sc}} ==== ;1: {{plm}}, {{l|es|cumplido}} o {{l|es|suficiente}}. == Referencias y notas == <references /> :*{{Aulete}} :*{{DALA}} :*{{DRAE}} :*{{DRAG}} :*{{Treccani}} qobpf3n6qpnfx9bre26ov2ervtmcif4 esquecer 0 118508 6076660 5916579 2026-04-05T02:44:19Z TMCbot 164594 . 6076660 wikitext text/x-wiki == {{lengua|gl}} == {{pron-graf|leng=gl|v=esquencer}} === Etimología === {{etimología|leng=gl|roa-opt|escaecer|olvidar}}, y este {{etim|leng=gl|la-vul|*excadescere}}, de {{l+|la|*excadere}}, {{etim|leng=gl|la|ex-}} y {{l+|la|cado|cadere|glosa=caer}}. Compárense el asturiano {{l+|ast|escaecer}}, el francés {{l+|fr|échoir}}, el italiano {{l+|it|scadere}} el portugués {{l+|pt|esquecer}}, el sardo {{l+|scn|iscaèssere}}, {{l+|scn|iscarèsciri}}, {{l+|scn|iscarèssere}}, {{l+|scn|iscadèssere}} y el rumano {{l+|ro|scădea}}. === {{verbo transitivo|gl}} === ;1: {{plm|olvidar}}. === Conjugación === {{gl.v}} == {{lengua|pt}} == {{pron-graf|leng=pt|2audio=LL-Q5146 (por)-Santamarcanda-esquecer.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-esquecer.wav}} === Etimología === {{etimología|leng=pt|roa-opt|escaecer|olvidar}}, y este {{etim|leng=pt|la-vul|*excadescere}}, de {{l+|la|*excadere}}, {{etim|leng=pt|la|ex-}} y {{l+|la|cado|cadere|glosa=caer}}. Compárense el asturiano {{l+|ast|escaecer}}, el francés {{l+|fr|échoir}}, el gallego {{l+|gl|esquecer}}, el italiano {{l+|it|scadere}}, el sardo {{l+|scn|iscaèssere}}, {{l+|scn|iscarèsciri}}, {{l+|scn|iscarèssere}}, {{l+|scn|iscadèssere}} y el rumano {{l+|ro|scădea}}. === {{verbo transitivo|pt}} === ;1: {{plm|olvidar}}. {{sinónimo|leng=pt|deslembrar|olvidar}}. {{antónimo|leng=pt|lembrar|recordar}}. === Conjugación === {{pt.v}} === Información adicional === {{derivad|leng=pt|esquecer-se|esquecimento|esquecível}}. == Referencias y notas == <references /> :*{{Aulete}} :*{{DRAG}} pgn03iy75coxjkcsarpgo0ikx20ez6o Plantilla:Página usuario 10 120997 6076634 5629812 2026-04-05T01:13:26Z Tmagc 158167 oscuro 6076634 wikitext text/x-wiki {| width="100%" align="center" style="text-align:center; border:1px solid #aaaaaa; border-radius:13px;" |- padding:1em;padding-top:0.5em;" {{#ifeq:{{{logo|si}}}|si| {{!}}[[Archivo:Wiktionary-logo.svg|60px|none|link=|alt=|Wiki<!---->pedia]]}} |style="font-size: {{#if:{{{font-size|}}}|{{{font-size}}}|85%}}"|'''Esto es una página de usuario de Wikcionario''' Esto no es una entrada. Si accede a esta página desde un sitio web diferente al de Wikcionario, puede que esté en un sitio espejo. En ese caso, tenga en cuenta que es posible que la versión de la página que está contemplando no esté actualizada y que su autor probablemente no comparta las opiniones vertidas en dicho sitio. La versión original de esta página se encuentra en <span class="plainlinks" style="white-space:nowrap;">[http://es.wik<!---->tionary.org/wiki/{{FULLPAGENAMEE}} <span>http://es.wiki</span><!----><span>tionary.org/wi</span><span>ki/{{FULLPAGENAMEE}}</span>].</span><br />Por favor, '''vea bien antes de editar una página de usuario que no es suya''' o deje su mensaje en la [[Usuario discusión:{{PAGENAMEE}}|página de discusión]] del usuario. Muchas gracias. |}<noinclude>[[Categoría:Plantillas para las páginas de usuario]]</noinclude> 4s9rebkgmjrcwbw01qfly3uylhn5iwk ludibrio 0 124583 6076728 5951626 2026-04-05T05:18:34Z JPDAMAY 176835 6076728 wikitext text/x-wiki {{desambiguación|ludíbrio}} == {{lengua|es}} == {{pron-graf}} === Etimología === {{año de documentación|1490}}.<ref>{{CNDHE}}</ref> {{etimología|la|ludibrium|sig=no}} ==== {{sustantivo masculino|es}} ==== {{es.sust}} ;1: {{plm|escarnio}}, [[desprecio]], [[mofa]].<ref name="dlc1914">{{DLC1914|629}}</ref> {{ejemplo|«{{l|es|ser|Fue}} [[la]] {{plm|edad}} [[de]] {{plm|oro}}; [[allí]] [[estar|estaba]] [[para]] '''''ludibrio''''' [[de]] [[ambos]] [[hermano]]s [[cuando]] [[algo]] [[les]] [[salir|salía]] [[mal]] (...)».|a={{versalita|Aub, Max}}|t=La calle de Valverde|fo=1961|p=130|editorial=José Antonio Pérez Bowie, Cátedra|l=Madrid|f=1985|c=libro}} {{sinónimo|escarnio|humillación|irrisión|mofa}}. ==== Traducciones ==== {{trad-arriba}} <!--{{t+|de|}}--> <!--{{t+|ar|}}--> <!--{{t+|bg|}}--> <!--{{t+|ca|}}--> <!--{{t+|eo|}}--> <!--{{t+|fr|}}--> {{t|gl|a1=1|t1=ludibrio|g1=m}} {{t|en|a1=1|t1=mockery|a2=1|t2=scorn}} {{t|it|a1=1|t1=lubibrio}} <!--{{t+|ja|}}--> <!--{{t+|nl|}}--> <!--{{t+|pl|}}--> {{t|pt|a1=1|t1=ludíbrio|g1=m}} {{trad-abajo}} == {{lengua|gl}} == {{pron-graf|leng=gl}} === Etimología === {{etimología|leng=gl|la|ludibrium}}. ==== {{sustantivo masculino|gl}} ==== {{gl.sust}} ;1: {{plm}}.<ref>{{DRAG}}</ref> {{ejemplo|«{{l|gl|non|Non}} {{l|gl|actuar|actuou}} {{l|gl|con}} {{l|gl|propósito}} {{l|gl|de}} '''ludibrio'''.»|traducción=«{{plm|no}} [[actuar|actuó]] [[con]] [[propósito]] [[de]] [[ludibrio]]».}} {{sinónimo|leng=gl|irrisión|mofa}}. == {{lengua|it}} == {{pron-graf|leng=it|ayuda=ludìbrio}} === Etimología === {{etimología|leng=it|la|ludibrium}}. ==== {{sustantivo masculino|it}} ==== {{it.sust|m}} ;1: {{plm}}.<ref>{{Treccani}}</ref> == {{lengua|la}} == {{pron-graf|leng=la|ayuda=lūdībriō}} === Forma flexiva === ==== Forma sustantiva ==== ;1: {{forma sustantivo|leng=la|ludibrium|dativo|caso2=ablativo|singular}}. == {{lengua|pt}} == {{pron-graf|leng=pt}} === Forma flexiva === ==== Forma verbal ==== ;1: {{forma verbo|leng=pt|ludibriar|p=1s|t=presente|m=indicativo|pron={{l|pt|eu}}}}. == Referencias y notas == <references /> l5ms9u7p3pmen2ddc50kge7g2z0thxb 6076729 6076728 2026-04-05T05:58:35Z JPDAMAY 176835 6076729 wikitext text/x-wiki {{desambiguación|ludíbrio}} == {{lengua|es}} == {{pron-graf}} === Etimología === Cultismo. {{año de documentación|1490}}.<ref>{{CNDHE}}</ref> {{etimología|la|ludibrium|sig=no}}. [[Categoría:ES:Cultismos]] ==== {{sustantivo masculino|es}} ==== {{es.sust}} ;1: {{plm|escarnio}}, [[desprecio]], [[mofa]].<ref name="dlc1914">{{DLC1914|629}}</ref> {{ejemplo|«{{l|es|ser|Fue}} [[la]] {{plm|edad}} [[de]] {{plm|oro}}; [[allí]] [[estar|estaba]] [[para]] '''''ludibrio''''' [[de]] [[ambos]] [[hermano]]s [[cuando]] [[algo]] [[les]] [[salir|salía]] [[mal]] (...)».|a={{versalita|Aub, Max}}|t=La calle de Valverde|fo=1961|p=130|editorial=José Antonio Pérez Bowie, Cátedra|l=Madrid|f=1985|c=libro}} {{sinónimo|escarnio|humillación|irrisión|mofa}}. ==== Traducciones ==== {{trad-arriba}} <!--{{t+|de|}}--> <!--{{t+|ar|}}--> <!--{{t+|bg|}}--> <!--{{t+|ca|}}--> <!--{{t+|eo|}}--> <!--{{t+|fr|}}--> {{t|gl|a1=1|t1=ludibrio|g1=m}} {{t|en|a1=1|t1=mockery|a2=1|t2=scorn}} {{t|it|a1=1|t1=lubibrio}} <!--{{t+|ja|}}--> <!--{{t+|nl|}}--> <!--{{t+|pl|}}--> {{t|pt|a1=1|t1=ludíbrio|g1=m}} {{trad-abajo}} == {{lengua|gl}} == {{pron-graf|leng=gl}} === Etimología === Cultismo. {{etimología|leng=gl|la|ludibrium}}. [[Categoría:GL:Cultismos]] ==== {{sustantivo masculino|gl}} ==== {{gl.sust}} ;1: {{plm}}.<ref>{{DRAG}}</ref> {{ejemplo|«{{l|gl|non|Non}} {{l|gl|actuar|actuou}} {{l|gl|con}} {{l|gl|propósito}} {{l|gl|de}} '''ludibrio'''.»|traducción=«{{plm|no}} [[actuar|actuó]] [[con]] [[propósito]] [[de]] [[ludibrio]]».}} {{sinónimo|leng=gl|irrisión|mofa}}. == {{lengua|it}} == {{pron-graf|leng=it|ayuda=ludìbrio}} === Etimología === Cultismo. {{etimología|leng=it|la|ludibrium}}. [[Categoría:IT:Cultismos]] ==== {{sustantivo masculino|it}} ==== {{it.sust|m}} ;1: {{plm}}.<ref>{{Treccani}}</ref> == {{lengua|la}} == {{pron-graf|leng=la|ayuda=lūdībriō}} === Forma flexiva === ==== Forma sustantiva ==== ;1: {{forma sustantivo|leng=la|ludibrium|dativo|caso2=ablativo|singular}}. == {{lengua|pt}} == {{pron-graf|leng=pt}} === Forma flexiva === ==== Forma verbal ==== ;1: {{forma verbo|leng=pt|ludibriar|p=1s|t=presente|m=indicativo|pron={{l|pt|eu}}}}. == Referencias y notas == <references /> etmwbohsrcozcn3ooxo353rx7gne34m leninismo 0 124882 6076673 5947886 2026-04-05T02:44:50Z TMCbot 164594 . 6076673 wikitext text/x-wiki == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología|sufijo|Lenin|ista}} === {{sustantivo masculino|es}} === {{es.sust}} ;1 {{csem|política|filosofía|historia}}: {{plm|conjunto}} de [[doctrina]]s y [[posición|posiciones]] [[político|políticas]] [[fundamentada]]s en la [[obra]] de '''Vladímir Ilich [[Lenin]]'''. Estas doctrinas están [[basado|basadas]] en el [[marxismo]] y son [[considerado|consideradas]] como el [[origen]] del [[comunismo]] [[soviético]]. === Locuciones === * [[marxismo-leninismo]] === Véase también === {{w}} *[[socialismo|Socialismo]] *[[izquierdismo|Izquierdismo]] *[[estalinismo|Estalinismo]] *[[maoísmo|Maoísmo]] *[[trotskismo|Trotskismo]] *[[leninista|Leninista]] *[[bolchevique|Bolchevique]] === Traducciones === {{trad-arriba}} {{t|af|t1=leninisme}} {{t|de|t1=Leninismus|g1=m}} {{t|ar|t1=ﻟﻴﻨﻴﻨﻴﺔ|g1=f}} {{t|arz|t1=ﻟﻴﻨﻴﻨﻴﻪ}} {{t|an|t1=leninismo}} {{t|ast|t1=leninismu}} {{t|az|t1=leninizm}} {{t|hy|t1=լենինիզմ}} {{t|bn|t1=লেনিনবাদ}} {{t|be|t1=ленинизъм|g1=m}} {{t|bg|t1=ленинизъм|g1=m}} {{t|ca|t1=leninisme|g1=m}} {{t|sh|t1=lenjinizam|t2=лењинизам}} {{t|zh|t1=列宁主义}} {{t|cs|t1=leninismus|g1=m}} {{t|ko|t1=레닌주의}} {{t|da|t1=leninisme|g1=c}} {{t|sco|t1=Leninism}} {{t|sk|t1=leninizmus|g1=m}} {{t|sl|t1=leninizem|g1=m}} {{t|eo|t1=leninismo}} {{t|et|t1=leninism}} {{t|eu|t1=leninismo}} {{t|fi|t1=leninismi}} {{t|fo|t1=leninisma|g1=f}} {{t|fr|t1=léninisme|g1=m}} {{t|gl|t1=leninismo}} {{t|ka|t1=ლენინიზმი}} {{t|el|t1=λενινισμός|g1=m}} {{t|he|t1=לניניזם|g1=m}} {{t|hi|t1=लेनिनवाद|g1=m|t2=लेनिनवाद}} {{t|hu|t1=leninizmus}} {{t|en|t1=Leninism}} {{t|id|t1=leninisme}} {{t|it|t1=leninismo|g1=m}} {{t|ja|t1=レーニン主義}} {{t|kk|t1=ленинизм}} {{t|ky|t1=ленинизм}} {{t|lv|t1=ļeņinisms|g1=m}} {{t|lt|t1=leninizmas|g1=m}} {{t|mk|t1=ленинизам|g1=m}} {{t|gv|t1=leninaght|g1=f}} {{t|nl|t1=leninisme|g1=n}} {{t|nb|t1=leninisme}} {{t|nn|t1=leninisme}} {{t|pnb|t1=ﻟﯿﻨﻨﺰﻡ}} {{t|fa|t1=لنینیسم}} {{t|pl|t1=leninizm|g1=m}} {{t|pt|t1=leninismo|g1=m}} {{t|ro|t1=leninism}} {{t|ru|t1=ленинизм|g1=m}} {{t|sh|t1=лењинизам|g1=m|t2=lenjinizam|g2=m}} {{t|sv|t1=leninism|g1=c}} {{t|th|t1=ลัทธิเลนิน}} {{t|ta|t1=லெனினிசம்}} {{t|tr|t1=Leninizm|t2=Lenincilik}} {{t|uk|t1=ленінізм|g1=m}} {{t|vi|t1=chủ nghĩa Lenin}} {{t|wuu|t1=列寧主義}} {{t|yi|t1=לעניניזם|g1=m}} {{trad-abajo}} == {{lengua|an}} == {{pron-graf|leng=an |fono= |fone= |audio=}} === Etimología === {{etimología|leng=an |sufijo |Lenin |ismo}} === {{sustantivo|an}} === ;1: {{plm}} === Véase también === {{w|idioma=an}} == {{lengua|eo}} == {{pron-graf|leng=eo|fono=le.niˈnis.mo}} === Etimología === {{etimología|leng=eo |sufijo |Lenin |ismo}} === {{sustantivo|eo}} === ;1: {{plm}} === Véase también === {{w|idioma=eo}} == {{lengua|eu}} == {{pron-graf|leng=eu}} === Etimología === {{etimología|leng=eu}}. === {{sustantivo|eu}} === ;1: {{plm}}. == {{lengua|gl}} == {{pron-graf|leng=gl |fono= |fone= |audio=}} === Etimología === {{etimología|leng=gl |sufijo |Lenin |ismo}} === {{sustantivo|gl}} === ;1: {{plm}} === Véase también === {{w|idioma=gl}} == {{lengua|it}} == {{pron-graf|leng=it|fono=leniˈnismo|fone=l̺e.n̺iˈn̺iz̪.mo|audio=}} === Etimología === {{etimología|leng=it |sufijo |Lenin |ismo}} === {{sustantivo|it|masculino}} === {{it.sust|m}} ;1: {{plm}} === Véase también === {{w|idioma=it}} == {{lengua|pt}} == {{pron-graf|leng=pt}} === Etimología === {{etimología|leng=pt |sufijo |Lenin |ismo}} === {{sustantivo masculino|pt}} === ;1: {{plm}} === Véase también === {{w|idioma=pt}} == Referencias y notas == <references /> 7x5a966isdprp0gs6us8tcazrqnki7a talvez 0 125280 6076700 5505233 2026-04-05T02:45:59Z TMCbot 164594 . 6076700 wikitext text/x-wiki == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología}} === {{adverbio de duda|es}} === ;1: {{impropia|Expresa una falta de seguridad, una duda sobre lo previamente expresado}}. {{ámbito|América}} {{sinónimo|quizá|quizás|tal vez}} {{ejemplo|''Talvez'' no haya en el vaso de la vida una gota/ cuando llegue: quizás no tenemos «mañana». |título=¿Poesias...?|formato=pdf|editorial=Imprenta Nacional|páginas=55|c=libro|u=http://www.memoriachilena.cl/temas/top_descarga.asp?id=MC0013432&tipo=1|a=Max Jara|fecha=1914|l=Santiago}} === Traducciones === {{trad-arriba}} <!--{{t+|de|}}--> <!--{{t+|ar|}}--> <!--{{t+|bg|}}--> <!--{{t+|ca|}}--> <!--{{t+|eo|}}--> <!--{{t+|fr|}}--> <!--{{t+|en|}}--> <!--{{t+|it|}}--> <!--{{t+|ja|}}--> <!--{{t+|nl|}}--> <!--{{t+|pl|}}--> <!--{{t+|pt|}}--> {{trad-abajo}} == {{lengua|pt}} == {{pron-graf|leng=pt|ayuda=talvêz|audio=LL-Q5146 (por)-Juliano P. Junho (Jjunho)-talvez.wav|audio2=LL-Q5146 (por)-Sillim-talvez.wav|2audio=LL-Q5146 (por)-Santamarcanda-talvez.wav}} === Etimología === {{etimología|leng=pt}} === {{adverbio de duda|pt}} === ;1: {{plm|quizá}}, [[quizás]], [[tal vez]]. == Referencias y notas == <references /> r4ogc36q0e6og6j5hivl40ps379gjse lhes 0 165339 6076675 6074316 2026-04-05T02:44:53Z TMCbot 164594 . 6076675 wikitext text/x-wiki == {{lengua|pt}} == {{pron-graf|leng=pt|audio=LL-Q5146 (por)-Juliano P. Junho (Jjunho)-lhes.wav|2audio=LL-Q5146 (por)-Santamarcanda-lhes.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-lhes.wav}} === Etimología 1 === {{etimología|leng=pt|la|ille}} en su forma [[dativo|dativa]] plural, ''illīs''. ==== {{pronombre personal|pt}} ==== {{pt.sust}} ;1: {{plm|les}} (forma del [[dativo]] para la [[tercera persona]] del [[plural]]). {{uso|leng=pt}} se emplea para indicar el objeto indirecto de {{l+|pt|eles|glosa=ellos}}, {{l+|pt|elas|glosa=ellas}} y {{l+|pt|vocês}} ("[[ustedes]], [[vosotros]]"). {{ejemplo|vou ''lhes'' dizer a verdade.|trad=les voy a decir la verdad.}} ==== Declinación ==== {{pt.pron}} ==== Véase también ==== {{w|idioma=pt|Pronome pessoal do caso reto}} == Referencias y notas == <references /> sx3300fbvm5efobnbh0cjgxcvvom6g6 ter 0 165793 6076702 5916654 2026-04-05T02:46:03Z TMCbot 164594 . 6076702 wikitext text/x-wiki {{desambiguación|tèr|-ter}} == {{lengua|gl}} == {{pron-graf|leng=gl}} === Etimología === {{etimología|leng=gl|roa-opt|teer||roa-opt|tẽer|glosa2=tener}}, del anterior {{l+|roa-opt|tener}}, y esta {{etim|leng=gl|la|tenere|tener}}. ==== {{verbo transitivo|gl}} ==== ;1: {{plm|tener}}.<ref>{{DRAG}}</ref> {{ejemplo| Home, '''teño''' na casa esta noite vinte e dous dragós.|trad=¡Hombre, '''tengo''' veintidós dragones en casa esta noche!}} ==== Conjugación ==== {{gl.v}} == {{lengua|la}} == {{pron-graf|leng=la}} {{numeral latino|antes1=bis|antes2=II|siga1=quater|siga2=IV|Título=III|card={{l*|la|tres|trēs}}|ord={{l*|la|tertius}}|adv=ter|dist={{l*|la|terni|ternī}} ''o'' {{l*|la|trini|trīnī}}}} === Etimología 1 === {{etimología|leng=la|itc-pro|*tris}} (> ''*ters''), y este {{etim|leng=la|ine-pro|*tris}} ("tres veces").<ref name="vaan">{{DeVaan|628-9}}</ref> Compárese el sánscrito {{l+|sa|त्रिस्}} (trís, "tres veces") y el avéstico {{l+|ae|θriš}} ("tres veces").<ref name="vaan" /> ==== {{adverbio|la|multiplicador}} ==== ;1: {{plm|tres}} [[vez|veces]], en [[tres]] [[ocasión|ocasiones]].<ref name="ol">{{Oxf-lat}}</ref> ;2: ''Como multiplicador con numerales'': [[tres]] [[vez|veces]], [[tres]] (multiplicado) [[por]].<ref name="ol" /> == {{lengua|pt}} == {{pron-graf|leng=pt|ayuda=têr|g1=têr|gnota1=obsoleta|1audio=LL-Q5146 (por)-Juliano P. Junho (Jjunho)-ter.wav|2audio=LL-Q5146 (por)-Santamarcanda-ter.wav|2audio2=LL-Q5146 (por)-Waldyrious-ter.wav}} === Etimología 1 === {{etimología|leng=pt|roa-opt|teer}}, del anterior {{l+|roa-opt|tẽer}}, y este {{etim|leng=pt|la|teneo|alt=teneō, tenēre}}. ==== {{verbo transitivo|pt}} ==== ;1: {{plm|tener}}. {{ejemplo|Tenho a mesma opinião|trad=Tengo la misma opinión}} {{ejemplo|Ela tem uma casa grande|trad=Ella tiene una casa grande}} {{ejemplo|O bebê tem gripe|trad=El bebé tiene gripe}} {{ejemplo|Tínhamos razão|trad=Teníamos razón }} ;2: {{plm|tener que ver}}, estar [[relacionado]] (con). {{ejemplo|O que eu tenho com isso?|trad=¿Qué tengo que ver yo con eso?}} ;3 ''ter de, ter que'' + infinitivo: Tener que, [[necesitar]], [[deber]] (hacer algo). {{uso|leng=pt}} con la preposición {{l+|pt|de}} se indica un deber más fuerte. {{ejemplo|Você tem de terminar esse trabalho hoje!|trad=¡Tú tienes que terminar ese trabajo hoy!}} ;4: {{plm|haber}} ''(indicando existencia)''. {{ejemplo|Na portaria tem um senhor querendo vê-la|trad=En la portería hay un señor que quiere verla}} ==== {{verbo auxiliar|pt}} ==== ;5: {{plm|haber}}: {{impropia|forma los tiempos compuestos con el [[participio]], indicando aspecto [[perfectivo]] (acciones completadas)}}. {{ejemplo|A esportista tinha corrido durante horas|trad=La deportista había corrido durante horas}} ==== Locuciones ==== * {{l|pt|ter por onde}}: tener cómo, tener manera de; tener motivos * {{l|pt|ter sangue de barata}} * {{l|pt|ter sangue nas veias}} * {{l|pt|ter sangue no olho}} * {{l|pt|ter sangue quente}} * {{l|pt|ter rabo-de-palha}}: tener rabo de paja, saber que se han cometido actos similares a los que se critica o condena ==== Conjugación ==== {{pt.v}} ==== Información adicional ==== {{derivad|leng=pt|ater|conter|deter|entreter|manter|obter|reter}} ==== Véase también ==== * [[ter-se]] == {{lengua|tr}} == {{pron-graf|leng=tr}} === Etimología 1 === {{etimología|leng=tr}}. ==== {{sustantivo|tr}} ==== ;1: {{plm|sudor}}. ==== Véase también ==== {{W|idioma=tr}} == {{lengua|uz}} == {{pron-graf|leng=uz}} === Etimología 1 === {{etimología|leng=uz}}. ==== {{sustantivo|uz}} ==== ;1: {{plm|sudor}}. == Referencias y notas == <references /> fmnp0fzr2rnyg2rx7ltyxezj7i7uuhf chorar 0 166526 6076650 5916547 2026-04-05T02:43:49Z TMCbot 164594 . 6076650 wikitext text/x-wiki == {{lengua|es}} == {{pron-graf}} === Etimología 1 === {{etimología|rmq|chorar|alt=chorar}}. ==== {{verbo|es|transitivo|intransitivo}} ==== ;1: {{plm|mangar}}, [[robar]], [[atracar]]. {{ámbito|España}}. {{uso|coloquial}}. {{sinónimos|mangar|robar|atracar|sisar}}. ==== Conjugación ==== {{es.v}} ==== Información adicional ==== {{cognados|chorear}} ==== Traducciones ==== {{trad-arriba}} {{trad-abajo}} == {{lengua|roa-opt}} == {{pron-graf|leng=roa-opt|1fone1=t͡ʃo.ˈɾaɾ}} === Etimología 1 === {{etimología|leng=roa-opt|la|plorare|alt=plorāre}}. ==== {{verbo intransitivo|roa-opt}} ==== ;1 {{csem|leng=roa-opt|fisiología}}: {{plm|lagrimear}} o [[llorar]]. == {{lengua|gl}} == {{pron-graf|leng=gl}} === Etimología 1 === {{etimología|leng=gl|roa-opt|chorar}}, y este {{etim|leng=gl|la|plorare}}. ==== {{verbo intransitivo|gl}} ==== ;1 {{csem|leng=gl|fisiología}}: {{plm|lagrimear}} o [[llorar]]. {{sinónimo|leng=gl|bagoar|bagoxar|bagullar|esbagoar|esbagullar|lagrimexar|lepear}}. ==== {{verbo transitivo|gl}} ==== ;2: {{plm|llorar}}. {{sinónimo|leng=gl|fungar}}. ==== Conjugación ==== {{gl.v}} ==== Información adicional ==== {{derivad|leng=gl|choradeira|chorosamente|choroso}} == {{lengua|pt}} == {{pron-graf|leng=pt|2audio=LL-Q5146 (por)-Santamarcanda-chorar.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-chorar.wav}} === Etimología 1 === {{etimología|leng=pt|roa-opt|chorar}}, y este {{etim|leng=pt|la|plorare}}. ==== {{verbo intransitivo|pt}} ==== ;1 {{csem|leng=pt|fisiología}}: {{plm|lagrimear}} o [[llorar]]. {{sinónimo|leng=pt|carpir|esbagoar|gaitar|grojer|lagrimar|planger|planhir|prantear}}. {{hipónimo|leng=pt|choramigar|chorincar}}. ==== {{verbo transitivo|pt}} ==== ;2: {{plm|llorar}}. {{sinónimo|leng=pt|fungar}}. ==== Conjugación ==== {{pt.v}} ==== Información adicional ==== {{derivad|leng=pt|chora|chora-migas|choradamente|choradeira|choradinho|chorador|choramigador|choramigar|choramigueiro|choramingar|chorosamente|choro|choroso}} == Referencias y notas == <references /> snharbg8wlpmmd7vuu9umzji509y1b4 beijar 0 170428 6076645 5908394 2026-04-05T02:43:30Z TMCbot 164594 . 6076645 wikitext text/x-wiki == {{lengua|pt}} == {{pron-graf|leng=pt|2audio=LL-Q5146 (por)-Santamarcanda-beijar.wav}} [[Archivo:Novios beso.jpg|thumb|150px|[1]]] === Etimología === {{etimología|leng=pt|la|basiare|alt=basiāre}}. === {{verbo transitivo|pt}} === ;1: {{plm|besar}}. === Conjugación === {{pt.v}} === Véase también === {{w|idioma=pt}} == Referencias y notas == <references /> q6uwk8gstd7mszyug54wc3e2ip0tn6e chegar 0 170867 6076648 5908404 2026-04-05T02:43:46Z TMCbot 164594 . 6076648 wikitext text/x-wiki == {{lengua|pt}} == {{pron-graf|leng=pt|1audio=LL-Q5146 (por)-Juliano P. Junho (Jjunho)-chegar.wav|2audio1=LL-Q5146 (por)-Santamarcanda-chegar.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-chegar.wav}} === Etimología === {{etimología|leng=pt|roa-opt|chegar}}, {{etim|leng=pt|la|plicare|alt=plicāre}}. ==== {{verbo|pt|intransitivo}} ==== ;1: {{plm|llegar}}. ==== Conjugación ==== {{pt.v}} == Referencias y notas == <references /> 466rlo5mqxhla1yiluolyjwb1yv3ob4 Plantilla:tecla/base 10 171656 6076630 5629470 2026-04-05T01:09:26Z Tmagc 158167 6076630 wikitext text/x-wiki <span class="keyboard-key" style="font-size: 0.85em; border:1px solid; border-bottom-width: 2px; padding: 1px 3px; white-space:nowrap; border-radius:3px;">{{#switch:{{lc:{{{1}}}}} | bloq mayus = ⇪ Bloq mayús | bloq mayús = ⇪ Bloq mayús | [[bloq mayus]] = ⇪ [[Bloq mayús]] | [[bloq mayús]] = ⇪ [[Bloq mayús]] | shift = ⇧ Mayús | mayus = ⇧ Mayús | mayús = ⇧ Mayús | [[tecla shift|shift]] = ⇧ [[Shift (tecla)|Mayús]] | enter = ↵ Entrar | entrar = ↵ Entrar | intro = ↵ Entrar | [[tecla enter|enter]] = ↵ [[Entrar (tecla)|Entrar]] | cmd = ⌘ Cmd | [[tecla cmd|cmd]] | [[tecla comando|cmd]]= ⌘ [[Comando (tecla)|Cmd]] | opt = ⌥ Opt | [[tecla opt|opt]] | [[tecla option|opt]]= ⌥ [[Opción (tecla)|Opt]] | tab = Tab ↹ | [[tecla tab|tab]] = [[Tabulador|Tab]] ↹ | retroceso = ← Retroceso | [[retroceso]] = ← [[Retroceso]] | win = ⊞ Win | [[win key|win]] | [[tecla windows|win]]= ⊞ [[Windows (tecla)|Win]] | menu = ≣ Menú | menú = ≣ Menú | [[tecla menu|menu]] = ≣ [[Menú (tecla)|Menú]] | arriba = ↑ | [[flecha|arriba]] = [[Tecla de dirección|↑]] | abajo = ↓ | [[flecha|abajo]] = [[Tecla de dirección|↓]] | izquierda = ← | [[flecha|izquierda]] = [[Tecla de dirección|←]] | derecha = → | [[flecha|derecha]] = [[Tecla de dirección|→]] | * = <nowiki>*</nowiki> | # = <nowiki>#</nowiki> | [[#]] = [[Almohadilla|#]] | : = <nowiki>:</nowiki> | [[:]] = [[Dos puntos|:]] | [[|]] = [[Pleca|{{!}}]] | #default = {{{1}}} }}</span><noinclude>{{documentación}}</noinclude> r8b6t9qjms3kelo7l7pzcjsoi0kscac português 0 171802 6076693 5899642 2026-04-05T02:45:36Z TMCbot 164594 . 6076693 wikitext text/x-wiki == {{lengua|pt}} == {{pron-graf|leng=pt|2audio=LL-Q5146 (por)-MedK1-português.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-português.wav}} === Etimología === {{etimología|leng=pt}}. ==== {{adjetivo|pt}} ==== {{pt.adj}} ;1: {{plm|portugués}}. {{uso|utcs}} ==== Locuciones ==== * {{l|pt|português com açúcar}}: ''portugués brasileño''. ==== Véase también ==== {{w|idioma=pt}} == Referencias y notas == <references /> ka04ahaq8o1bkji316vawbxyfwx7ze7 6076712 6076693 2026-04-05T03:22:19Z Tmagc 158167 6076712 wikitext text/x-wiki == {{lengua|pt}} == {{pron-graf|leng=pt|1audio=LL-Q5146 (por)-MedK1-português.wav|2audio1=LL-Q5146 (por)-Nelson Ricardo 2500-português.wav}} === Etimología === {{etimología|leng=pt}}. ==== {{adjetivo|pt}} ==== {{pt.adj}} ;1: {{plm|portugués}}. {{uso|utcs}} ==== Locuciones ==== * {{l|pt|português com açúcar}}: ''portugués brasileño''. ==== Véase también ==== {{w|idioma=pt}} == Referencias y notas == <references /> lrvmrwqm80lf9dtzdkjbidl1if5afqa abacate 0 172810 6076640 5826696 2026-04-05T02:43:07Z TMCbot 164594 . 6076640 wikitext text/x-wiki == {{lengua|pt}} == {{pron-graf|leng=pt|2audio=LL-Q5146 (por)-Nelson Ricardo 2500-abacate.wav}} === Etimología === {{etimología|leng=pt|es|aguacate}}. === {{sustantivo masculino|pt}} === {{pt.sust}} ;1 {{csem|frutos|leng=pt}}: {{plm|palta}}, [[aguacate]]. {{relacionado|leng=pt|abacatal|abacateiro}} === Véase también === {{w|leng=pt}} == Referencias y notas == * {{Aulete}} knxp5us7aponbk2g1zc7hxi0n1bxbvp presque 0 370883 6076573 5469735 2026-04-04T17:49:24Z Adelpine 34679 Corrige la etimología según [https://www.cnrtl.fr/etymologie/presque] 6076573 wikitext text/x-wiki == {{lengua|fr}} == {{pron-graf|leng=fr|g1=presqu’|gnota1=antes de vocales|1audio1=Fr-presque.ogg|1aunota1=París}} === Etimología 1 === {{etimología|leng=fr|frm|a bien près}}. ==== {{adverbio|fr}} ==== ;1: {{plm|aproximadamente}}, [[casi]], [[con corta diferencia]], [[poco menos de]] o [[por poco]]. {{sinónimo|leng=fr|à la louche|à peu près|au pifomètre|à vue d’œil|à vue de nez|approximativement|au doigt mouillé|au feeling|au jugé|au pif|dans ces eaux-là|dans les grandes lignes|en gros|environ|grosso merdo|grosso modo|quasi|quasiment|sommairement|nota7=coloquial|nota10=coloquial}}. {{antónimo|leng=fr|exactement|dans le mille|dans le mille, Émile|parfaitement|pile|pile poil|précisément|rigoureusement|strictement|tu l’as dit bouffi}}. ==== Locuciones ==== {{trad-arriba|locuciones}} * {{l|fr|presque partout}} * {{l|fr|presque sûr}} * {{l|fr|presque sûrement}} * {{l|fr|presque tout}} {{trad-abajo}} == {{lengua|frm}} == {{pron-graf|leng=frm|g1=presqu’|gnota1=antes de vocales}} === Etimología 1 === {{etimología|leng=frm|compuesto|pres|que}}. ==== {{adverbio|frm}} ==== ;1: {{plm|casi}}. == Referencias y notas == <references /> 4kwpbpwc8fv21iw66t1wqy3eo2e7mz9 falar 0 519067 6076661 6068102 2026-04-05T02:44:22Z TMCbot 164594 . 6076661 wikitext text/x-wiki {{desambiguación|fallar|fallaar|}} == {{lengua|pt}} == {{pron-graf|leng=pt|audio=LL-Q5146 (por)-Sillim-falar.wav|2audio=LL-Q5146 (por)-Santamarcanda-falar.wav}} === Etimología === {{etimología|roa-opt|falar|leng=pt}}, y este {{etim|leng=pt|la|fabulari}}. === {{verbo transitivo|pt}} === ;1: {{plm|hablar}}. === {{verbo intransitivo|pt}} === ;2: {{plm|hablar}}. === Conjugación === {{pt.v}} === Véase tamién === {{w|leng=pt}} === Locuciones === * {{l|pt|falar com a porta}} == Referencias y notas == <references /> l7us6v7otioijc3ey10yfuqe8566rkq menino 0 541085 6076679 5826310 2026-04-05T02:45:03Z TMCbot 164594 . 6076679 wikitext text/x-wiki == {{lengua|it}} == {{pron-graf|leng=it}} === Forma flexiva === ==== Forma verbal ==== ;1: {{f.v|leng=it|menare|3p|pres|subj|nopron=x}}. ;2: {{f.v|leng=it|menare|3p|imperativo|nopron=x}}. == {{lengua|pt}} == {{pron-graf|leng=pt|2audio=LL-Q5146 (por)-Santamarcanda-menino.wav}} === Etimología 1 === {{etimología|leng=pt|roa-opt|menino||roa-opt|menỹo}}, de origen incierto. ==== {{sustantivo masculino y femenino|pt}} ==== {{pt.sust|mf}} ;1 {{csem|biología|leng=pt}}: {{plm|chico}}, [[muchacho]] o [[niño]]. {{sinónimo|leng=pt|crila|curumi|curumim|garoto|guri|miúdo|moço|pequeno|piá|puto|rapaz|nota10=Portugal}}. {{antónimo|leng=pt|adulto}}. {{hiperónimo|leng=pt|criança}}. ==== Información adicional ==== {{derivad|leng=pt|menina|meninada|meninão|menininha|menininho|meninona}}. ==== Véase también ==== {{w|leng=pt}} == Referencias y notas == <references /> suztyjxo1ti1s6atn6ycu5s8gjhry3c chinado 0 636247 6076717 5760012 2026-04-05T03:41:34Z Tmagc 158167 6076717 wikitext text/x-wiki == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología}}. ==== {{adjetivo|es}} ==== {{es.adj}} ;1: {{variante|achinado}}. === Forma flexiva === ==== Forma verbal ==== {{es.adj}} ;1: {{participio|chinar|irregular=|leng=es}}. == Referencias y notas == <references /> l3behlttdgx4yczizyu8t4vle6tkcg9 leninista 0 862288 6076674 5952354 2026-04-05T02:44:52Z TMCbot 164594 . 6076674 wikitext text/x-wiki == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología|sufijo|leninismo|ista}} === {{adjetivo|es}} === {{es.adj|ng}} ;1 {{csem|política}}: {{plm|relativo}}, [[perteneciente]] o [[partidario]] del [[leninismo]]. {{uso|utcs}} ;2 {{csem|política|filosofía}}: Propio de o relativo a la persona de [[Lenin]], su gobierno o su ideología. {{uso|utcs}} === Véase también === {{w|leninismo}} === Traducciones === {{trad-arriba}} {{t|de|t1=leninistisch|c1=a|t2=Leninist|g2=m|c2=s|t3=Leninistin|g3=f|c3=s}} {{t|ar|t1=ﻟﻴﻨﻴﻨﻲ|g1=m|c1=s}} {{t|hy|t1=լենինական|c1=s}} {{t|ca|t1=leninista}} {{t|fr|t1=léniniste}} {{t|ka|t1=ლენინელი|c1=s}} {{t|hu|t1=leninista|c1=s}} {{t|en|t1=Leninist|t2=Leninian}} {{t|it|t1=leninista}} {{t|pl|t1=leninowski}} {{t|pt|t1=leninista}} {{t|ro|t1=leninist|g1=m|t2=leninistă|g2=f}} {{t|ru|t1=ле́нинский|c1=a|t2=ле́нинец|g2=m|c2=s|t3=ленини́ст|g3=m|c3=s|t4=ленини́стка|g4=f|c4=s}} {{t|sv|t1=leninistisk|c1=a|t2=leninsk|c2=a|t3=leninist|g3=c|c3=s}} {{t|tr|t1=Leninci|c1=s}} {{t|yi|t1=לעניניסטיש|c1=a|t2=לעניניסט|g2=m|c2=s}} {{trad-abajo}} == {{lengua|it}} == {{pron-graf|leng=it |tl= |fono= leniˈnista |fone=l̺e.n̺iˈn̺is̪.t̪a |audio=}} === Etimología === {{etimología|leng=it |sufijo |leninismo |ista}} === {{adjetivo|it}} === {{it.adj}} ;1: {{plm}} {{uso|leng=it|utcs}} === Véase también === {{w|idioma=it}} == {{lengua|pt}} == {{pron-graf|leng=pt}} === Etimología === {{etimología|leng=pt |sufijo |leninismo |ista}} === {{adjetivo|pt}} === {{pt.adj|ng}} ;1: {{plm}} {{uso|leng=pt|utcs}} === Véase también === {{w|idioma=pt}} == Referencias y notas == <references /> sx503bcnhyzydysq30z2x5b6rqljxb0 chinar 0 874368 6076716 5804539 2026-04-05T03:40:52Z Tmagc 158167 6076716 wikitext text/x-wiki == {{lengua|es}} == {{pron-graf}} === Etimología 1 === {{etimología|ONOM}} ==== {{verbo intransitivo|es}} ==== ;1: {{variante|rechinar}}.<ref name="drae">{{DLE1925}}</ref> ==== Conjugación ==== {{es.v}} === Etimología 2 === {{etimología|sufijo|china|ar}} ==== {{verbo transitivo|es}} ==== ;1: Embutir con chinas los revoques de mampostería.<ref name="drae" /> ==== Conjugación ==== {{es.v}} == Referencias y notas == <references /> dka12558e7m0vbf0x8y2001c1zz1256 fechar 0 875995 6076662 5908492 2026-04-05T02:44:24Z TMCbot 164594 . 6076662 wikitext text/x-wiki {{desambiguación}} {{esbozo}} == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología}} === {{verbo transitivo|es}} === ;1: <ref name="drae">{{DRAE2001}}</ref> ;2: <ref name="drae" /> === Conjugación === {{es.v}} === Traducciones === {{trad-arriba}} {{t|nl|i1=s|t1=dagtekenen|t2=dateren}} {{trad-abajo}} == {{lengua|pt}} == {{pron-graf|leng=pt|audio=LL-Q5146 (por)-Stríðsdrengur-fechar.wav|2audio=LL-Q5146 (por)-MedK1-fechar.wav|2audio2=LL-Q5146 (por)-Santamarcanda-fechar.wav|2audio3=LL-Q5146 (por)-Nelson Ricardo 2500-fechar.wav}} === Etimología 1 === {{etimología|leng=pt}}. ==== {{verbo|pt|transitivo|intransitivo}} ==== ;1: {{plm|cerrar}}. ==== Conjugación ==== {{pt.v}} == Referencias y notas == <references /> 8a5ksx5or3a1s25gzrz0n666v85n3p3 matonear 0 876549 6076721 5812109 2026-04-05T04:03:27Z Tmagc 158167 6076721 wikitext text/x-wiki == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología|sufijo|matón|ear}} === {{verbo transitivo|es}} === ;1: Comportarse como un [[matón]]. {{sinónimo|prepotentear|amedrentar|hostigar|bulinizar|bravuconear|patotear}} {{ejemplo|...si se hubieran dedicado a inventar las formas políticas apropiadas para las nuevas formas económicas. Pero no; imaginaron que debían reivindicar las viejas obsoletas. Gritaban, '''matoneaban''', trataban de atajar la lluvia con las manos, culpaban a los inmigrantes y a la nación de al lado, y así llegamos adonde llegamos.|c=libro|t=Sinfín|a=Martín Caparrós|f=2020|isbn=9789877691030|editorial=Penguin Random House|p=313|parte=4|cap=6}} === Conjugación === {{es.v}} === Traducciones === {{trad-arriba}} {{trad-abajo}} == Referencias y notas == <references /> bj3qaa6no8dc2f6o7dn2xqbrw85ts4l reportear 0 877233 6076720 5802575 2026-04-05T03:58:39Z Tmagc 158167 6076720 wikitext text/x-wiki == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología|sufijo|reportaje|ear}} === {{verbo transitivo|es}} === ;1: Dicho de un periodista: tomar un [[reportaje]] a alguien.<ref name="drae">{{DRAE2001}}</ref> {{ámbito|América}} {{sinónimo|entrevistar}} ;2: Tomar fotografías como parte de un [[reportaje]].<ref name="drae" /> {{ámbito|América}} ;3: Difundir noticias en un medio de comunicación.<ref name="drae" /> {{ámbito|Argentina|Honduras|México|Uruguay}} === Conjugación === {{es.v}} === Traducciones === {{trad-arriba}} {{trad-abajo}} == Referencias y notas == <references /> 2bazaaavrk02ry9nig9czu4jxux9k83 dez 0 882352 6076654 5863237 2026-04-05T02:44:04Z TMCbot 164594 . 6076654 wikitext text/x-wiki {{desambiguación|dež}} == {{lengua|roa-opt}} == {{pron-graf|leng=roa-opt|1fono1=ˈdɛd͡z}} === Etimología 1 === {{etimología|leng=roa-opt|la|decem|diez}}, y este {{etim|leng=roa-opt|itc-pro|*dekm}}, {{etim|leng=roa-opt|ine-pro|*déḱm̥t}}. ==== {{adjetivo cardinal|roa-opt}} ==== ;1 {{csem|números|leng=roa-opt}}: {{plm|diez}}, [[x]], [[X]] o [[10]]. ==== Descendientes ==== {{trad-arriba|Descendientes}} {{d|gl|niv=1|d1=dez}} {{d|pt|niv=1|d1=dez}} {{trad-abajo}} == {{lengua|gl}} == {{pron-graf|leng=gl|1audio1=Gl-dez.ogg|ayuda=dèz}} {{gl.tabla-cardinal|10|ord=|nprev=9|nsig=11|r=X|prev=nove|sig=once}} === Etimología 1 === {{etimología|leng=gl|roa-opt|dez|diez}}, y este {{etim|leng=gl|la|decem}}, {{etim|leng=gl|itc-pro|*dekm}}, {{etim|leng=gl|ine-pro|*déḱm̥t}}. ==== {{adjetivo cardinal|gl}} ==== {{gl.adj|p}} ;1: {{plm|diez}}.<ref>{{DRAG}}</ref> ==== {{sustantivo masculino|gl}} ==== {{gl.sust}} ;2 {{csem|números|leng=gl}}: {{plm|diez}}. {{ejemplo|En numeración romana, o dez escríbese '''X''' e en numeración arábiga é '''10'''.}} ==== Información adicional ==== {{derivad|leng=gl|década|decaedro|decágono|decena|décimo|décuplo}}. ==== Véase también ==== {{w|leng=gl}} [[Categoría:GL:Adjetivos]] == {{lengua|idb}} == {{pron-graf|leng=idb}} === Etimología 1 === {{etimología|leng=idb}}. ==== {{adjetivo cardinal|idb}} ==== ;1 {{csem|números|leng=idb}}: {{plm|diez}}. == {{lengua|pt}} == {{pron-graf|leng=pt|2audio=LL-Q5146 (por)-Santamarcanda-dez.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-dez.wav}} === Etimología 1 === {{etimología|leng=pt|roa-opt|dez|diez}}, y este {{etim|leng=pt|la|decem}}, {{etim|leng=pt|itc-pro|*dekm}}, {{etim|leng=pt|ine-pro|*déḱm̥t}}. ==== {{adjetivo cardinal|pt}} ==== {{pt.adj|p}} ;1 {{csem|números|leng=pt}}: {{plm|diez}}, [[x]], [[X]] o [[10]].<ref>{{Aulete}}</ref> {{ejemplo|Eu tenho '''dez''' dedos nas mãos.}} ==== {{sustantivo masculino|pt}} ==== {{pt.sust}} ;2: {{plm|diez}}. {{ejemplo|Baixei o '''dez''' e o rei.}} ==== Locuciones ==== {{trad-arriba|locuciones}} * {{l|pt|dar de dez em}} * {{l|pt|nota dez}} * {{l|pt|ser dez}} {{trad-abajo}} ==== Información adicional ==== {{derivad|leng=pt|década|decágono|décimo|décuplo|dezena}}. ==== Véase también ==== {{w|leng=pt}} == Referencias y notas == <references /> 0lob54j0xhmhal3b4ymzgl0yatignl0 sete 0 899155 6076699 5895105 2026-04-05T02:45:54Z TMCbot 164594 . 6076699 wikitext text/x-wiki {{desambiguación|Sète|setè|sete-|seté}} == {{lengua|fro}} == {{pron-graf|leng=fro|g1=seite|g2=sette}} === Etimología 1 === {{etimología|leng=fro}}. ==== {{sustantivo femenino|fro}} ==== {{inflect.fro.sust.f}} ;1 {{csem|leng=fro|mamíferos}}: {{ucf|ludria}} o {{l|es|nutria}}. == {{lengua|roa-opt}} == {{pron-graf|leng=roa-opt}} === Etimología 1 === {{etimología|leng=roa-opt|la|septem|siete}}, y este del protoitálico {{l+|itc-pro|*septṃ|glosa=siete}}, del protoindoeuropeo {{l|ine-pro|*septḿ|glosa=siete}}. ==== {{adjetivo cardinal|roa-opt}} ==== ;1 {{csem|leng=roa-opt|números}}: {{ucf|siete}}, [[vii]], [[VII]] o [[7]]. ==== Descendientes ==== {{trad-arriba|descendientes}} {{d|gl|d1=sete}} {{d|pt|d1=sete}} {{trad-abajo}} == {{lengua|gl}} == {{pron-graf|leng=gl|1audio1=Gl-sete.ogg|ayuda=sète}} {{gl.tabla-cardinal|7|nprev=6|nsig=8|ord=|prev=seis|r=VII|sig=oito}} === Etimología 1 === {{etimología|leng=gl|roa-opt|sete|siete}}, y este del latín {{l+|la|septem|glosa=siete}}, del protoitálico {{l+|itc-pro|*septṃ|glosa=siete}}, del protoindoeuropeo {{l|ine-pro|*septḿ|glosa=siete}}. ==== {{adjetivo cardinal|gl}} ==== {{gl.adj|p}} ;1: {{ucf|siete}}.<ref>{{DRAG}}</ref> ==== {{sustantivo masculino|gl}} ==== ;2 {{csem|leng=gl|números}}: {{plm|siete}}. {{ejemplo|En numeración romana, o sete escríbese '''VII''' e en numeración arábiga é '''7'''.}} ==== Información adicional ==== {{derivad|leng=gl|séptuplo|sétimo}}. ==== Véase también ==== {{w|leng=gl}} == {{lengua|it}} == {{pron-graf|leng=it}} === Etimología 1 === {{etimología|leng=it|roa-oit|sete|sed}}, y este del latín {{l+|la|sitis|sitim|glosa=sed}}. ==== {{sustantivo|it|femenino}} ==== {{it.sust|f}} ;1 {{csem|leng=it|Fisiología}}: {{ucf|sed}}. {{ejemplo|Ho '''sete'''.|trad=Tengo sed.}} ;2: {{ucf|sed}} (ansia). {{uso|leng=it|figurado}}. ==== Información adicional ==== {{derivad|leng=it|assetare|assetato}} ==== Véase también ==== {{w|leng=it}} * {{l|it|fame}} === Forma flexiva === ==== Forma sustantiva ==== ;1: {{f.s.p|leng=it|seta}}. == {{lengua|roa-oit}} == {{pron-graf|leng=roa-oit}} === Etimología 1 === {{etimología|leng=roa-oit|la|sitis|sed|alt=sitim}}. ==== {{sustantivo femenino|roa-oit}} ==== ;1: {{ucf|sed}}. == {{lengua|pt}} == {{pron-graf|leng=pt|2audio=LL-Q5146 (por)-Santamarcanda-sete.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-sete.wav}} === Etimología 1 === {{etimología|leng=pt|roa-opt|sete|siete}}, y este del latín {{l+|la|septem|glosa=siete}}, del protoitálico {{l+|itc-pro|*septṃ|glosa=siete}}, del protoindoeuropeo {{l|ine-pro|*septḿ|glosa=siete}}. ==== {{adjetivo cardinal|pt}} ==== {{pt.adj|p}} ;1 {{csem|leng=pt|números}}: {{ucf|siete}}, [[vii]], [[VII]] o [[7]]. ==== {{sustantivo masculino|pt}} ==== {{pt.sust}} ;2: {{ucf|siete}}. ==== Descendientes ==== {{trad-arriba|descendientes}} {{d|kbc|d1=seete}} {{trad-abajo}} ==== Información adicional ==== {{derivad|leng=pt|septenal|septenário|septenial|septénio|séptuplo|setembro|setenta|sétimo}} ==== Véase también ==== {{w|leng=pt}} == {{lengua|ro}} == {{pron-graf|leng=ro}} === Etimología 1 === {{etimología|leng=ro|la|sitis|sed|alt=sitim}}. ==== {{sustantivo femenino|ro}} ==== ;1 {{csem|leng=ro|Fisiología}}: {{ucf|sed}}. {{sinónimo|leng=ro|însetare|însetoșare}}. ;2: {{ucf|sed}}. {{uso|leng=ro|figurado}}. {{sinónimo|leng=ro|arzătoare|dor|dorință|oftă}}. ==== Locuciones ==== {{trad-arriba|Locuciones}} * {{l|ro|a muri de sete}} * {{l|ro|a se usca de sete}} * {{l|ro|cu sete}} {{trad-abajo}} ==== Información adicional ==== {{derivad|leng=ro|înseta|însetare|însetat|însetoșa|însetoșare|însetoșat|seteciune|setos|setoșa|setui|setuire|setuit}} ==== Véase también ==== {{w|leng=ro}} * {{l|ro|foame}} * {{l|ro|secetă}} * {{l|ro|uscăciune}} ==== Declinación ==== {{ro.sust|f|num=sg|na_def_sg=setea|gd_indef_sg=sete}} === Forma flexiva === ==== Forma sustantiva ==== ;1: {{forma sustantivo|leng=ro|setă|nominativo|plural}}. ;2: {{forma sustantivo|leng=ro|setă|acusativo|plural}}. ;3: {{forma sustantivo|leng=ro|setă|genitivo|singular}}. ;4: {{forma sustantivo|leng=ro|setă|dativo|singular}}. ;5: {{forma sustantivo|leng=ro|setă|genitivo|plural}}. ;6: {{forma sustantivo|leng=ro|setă|dativo|plural}}. == {{lengua|sc}} == {{pron-graf|leng=sc|v1=seti}} === Etimología 1 === {{etimología|leng=sc|la|septem|siete}}, y este del protoitálico {{l+|itc-pro|*septṃ|glosa=siete}}, del protoindoeuropeo {{l|ine-pro|*septḿ|glosa=siete}}. ==== {{adjetivo cardinal|sc}} ==== ;1 {{csem|leng=sc|números}}: {{ucf|siete}}, [[vii]], [[VII]] o [[7]]. == {{lengua|wa}} == {{pron-graf|leng=wa}} === Etimología 1 === {{etimología|leng=wa|fro|set|siete}}. ==== {{adjetivo cardinal|wa}} ==== ;1: {{grafía|leng=wa|set}}. == {{lengua|vec}} == {{pron-graf|leng=vec}} === Etimología 1 === {{etimología|leng=vec|la|septem|siete}}, y este del protoitálico {{l+|itc-pro|*septṃ|glosa=siete}}, del protoindoeuropeo {{l|ine-pro|*septḿ|glosa=siete}}. ==== {{adjetivo cardinal|vec}} ==== ;1 {{csem|leng=vec|números}}: {{ucf|siete}}, [[vii]], [[VII]] o [[7]]. ==== {{adjetivo ordinal|vec}} ==== ;2: {{ucf|setimo}}. == Referencias y notas == <references /> * {{Aulete}} * {{dexonline}} * {{DRAG}} * {{Godefroy}} * {{Treccani}} czqo6so6hsvk2yevi0pnq5q3n9a4xz4 manhã 0 900060 6076677 5827033 2026-04-05T02:44:58Z TMCbot 164594 . 6076677 wikitext text/x-wiki {{desambiguación|manha}} == {{lengua|mzs}} == {{pron-graf|leng=mzs}} === Etimología 1 === {{etimología|leng=mzs|pt|manhã|mañana}}, y este {{etim|leng=mzs|roa-opt|mannãa}}, del latín vulgar {{l+|la|*maneāna|glosa=mañana}}, del latín {{l+|la|mane|māne|glosa=por la mañana}}, del protoindoeuropeo {{l+|ine-pro|*meh₂-}}. ==== {{sustantivo|mzs}} ==== ;1 {{csem|cronología|leng=mzs}}: {{plm|mañana}}. == {{lengua|pt}} == {{pron-graf|leng=pt|audio=Pt-manhã.ogg|2audio=LL-Q5146 (por)-Santamarcanda-manhã.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-manhã.wav}} === Etimología 1 === {{etimología|leng=pt|roa-opt|mannãa|mañana}}, y este {{etim|leng=pt|la-vul|*maneāna|glosa=mañana}}, {{etim|leng=pt|la|mane|māne|glosa=por la mañana}}, {{etim|leng=pt|ine-pro|*meh₂-}}. Compárense el aragonés {{l+|an|manyana}}, el asturiano {{l+|ast|mañana}}, el español {{l+|es|mañana}}, el gallego {{l+|gl|mañá}}, el judeoespañol {{l+|lad|manyana}}, el leonés {{l+|roa-leo|mañana}} y el mirandés {{l+|mwl|manhana}}. ==== {{sustantivo femenino|pt}} ==== {{pt.sust}} ;1 {{csem|cronología|leng=pt}}: {{plm|mañana}}. {{relacionado|leng=pt|noite|tarde}}. {{trad-arriba|descendientes}} {{d|kea|d1=manhan}} {{d|pov|d1=manha}} {{d|idb|d1=manhão}} {{d|mzs|d1=manhã}} {{d|pre|d1=manha}} {{trad-abajo}} ==== Locuciones ==== {{trad-arriba|locuciones}} * {{l|pt|de manhã}} * {{l|pt|de manhã cedo}} * {{l|pt|pela manhã}} {{trad-abajo}} ==== Información adicional ==== {{derivad|leng=pt|amanhã}}. ==== Véase también ==== {{w|leng=pt}} == Referencias y notas == <references /> :*{{Aulete}} q80getgdcwwruxrkp0bgxghgwohyooh item 0 900317 6076529 6043978 2026-04-04T12:31:55Z Adelpine 34679 Agrega un audio 6076529 wikitext text/x-wiki {{desambiguación|ítem}} == {{lengua|fr}} == {{pron-graf|leng=fr|audio=LL-Q150 (fra)-WikiLucas00-item.wav|aunota=Lyon|h1=items|p1=idem}} === Etimología === {{etimología|leng=fr|frm|item|asimismo}}, y este del francés antiguo {{l+|fro|item|glosa=asimismo}}, del latín {{l+|la|item|glosa=asimismo}}. === {{adverbio de modo|fr}} === ;1: {{plm|asimismo}}, {{l|es|de la misma manera}}, {{l|es|del mismo modo}}, {{l|es|igualmente}} o {{l|es|también}}. {{sinónimo|leng=fr|aussi|de même|également|idem|ibid|itou|pareillement}}. ;2: {{plm|además}}. {{sinónimo|leng=fr|au par delà de cela|de plus|de surcroît|en outre|en plus|outre ce|outre cela|outre plus|par surcroît|qui plus est}}. === {{sustantivo masculino|fr}} === {{fr.sust}} ;3: {{plm|elemento}} o {{l|es|ítem}}. === Véase también === {{w|leng=fr}} == {{lengua|fro}} == {{pron-graf|leng=fro}} === Etimología === {{etimología|leng=fro|la|item|asimismo}}. === {{adverbio de modo|fro}} === ;1: {{plm|asimismo}}, {{l|es|de la misma manera}}, {{l|es|del mismo modo}}, {{l|es|igualmente}} o {{l|es|también}}. == {{lengua|frm}} == {{pron-graf|leng=frm}} === Etimología === {{etimología|leng=frm|fro|item|asimismo}}, y este del latín {{l+|la|item|glosa=asimismo}}. === {{adverbio de modo|frm}} === ;1: {{plm|asimismo}}, {{l|es|de la misma manera}}, {{l|es|del mismo modo}}, {{l|es|igualmente}} o {{l|es|también}}. == {{lengua|en}} == {{pron-graf|leng=en |2audio2=En-us-item.ogg|2aunota2=California|2fone2=ˈaɪ̯.ɾəm|2fone3=ˈaɪ̯.ɾm̩ |2fono1=ˈaɪ.təm|2pron1=General American, Standard Canadian|3fone2=ˈɑe̯.ɾəm|3fone3=ˈɑe̯.ɾm̩ |3fono1=ˈɑe.təm|3pron1=Australia|4fone2=ˈɑe̯.ɾəm|4fone3=ˈɑe̯.ɾm̩ |4fono1=ˈaɪ.təm|4pron1=Nueva Zelanda|1fono1=ˈaɪ.təm |ls=2|1pron1=Received Pronunciation}} === Etimología === {{etimología|leng=en|enm}}, {{etim|leng=en|la}} ("además; asimismo, de la misma manera"). === {{sustantivo|en}} === {{en.sust|c}} ;1: {{plm|ítem}}. === Véase también === {{w|leng=en}} == {{lengua|it}} == {{pron-graf|leng=it}} === Etimología === {{etimología|leng=it|roa-oit|item|glosa=asimismo}}, y este del latín {{l+|la|item|asimismo}}. === {{adverbio de modo|it}} === ;1 {{csem|leng=it|derecho}}: {{plm|asimismo}}, {{l|es|de la misma manera}}, {{l|es|del mismo modo}}, {{l|es|igualmente}} o {{l|es|también}}. === {{sustantivo masculino|it}} === {{it.sust|inv}} ;2 {{csem|leng=it|informática|lingüística}}: {{plm|ítem}}. == {{lengua|roa-oit}} == {{pron-graf|leng=roa-oit}} === Etimología === {{etimología|leng=roa-oit|la|item|asimismo}}. === {{adverbio de modo|roa-oit}} === ;1: {{plm|asimismo}}, {{l|es|de la misma manera}}, {{l|es|del mismo modo}}, {{l|es|igualmente}} o {{l|es|también}}. == {{lengua|la}} == {{pron-graf|leng=la}} === Etimología === {{etimología|leng=la|}} === {{adverbio de modo|la}} === ;1: {{plm|asimismo}}, {{l|es|de la misma manera}}, {{l|es|del mismo modo}}, {{l|es|igualmente}} o {{l|es|también}}. == {{lengua|oc}} == {{pron-graf|leng=oc}} === Etimología === {{etimología|leng=oc|la|item|asimismo}}. === {{adverbio de modo|oc}} === ;1: {{plm|asimismo}}, {{l|es|de la misma manera}}, {{l|es|del mismo modo}}, {{l|es|igualmente}} o {{l|es|también}}. === {{sustantivo masculino|oc}} === {{oc.sust|m}} ;2: {{plm|ítem}}. == {{lengua|pt}} == {{pron-graf|leng=pt}} === Etimología === {{etimología|leng=pt|la|item|asimismo}}. === {{sustantivo masculino|pt}} === {{pt.sust}} ;1: {{plm|ítem}}. ;2: {{plm|objeto}}. {{sinónimo|leng=pt|objeto}}. === Locuciones === {{trad-arriba|Locuciones}} * {{l|pt|item lexical}} {{trad-abajo}} == {{lengua|ro}} == {{pron-graf|leng=ro}} === Etimología 1 === {{etimología|leng=ro|la|item|asimismo}}. ==== {{adverbio de modo|ro}} ==== ;1: {{plm|asimismo}}, {{l|es|de la misma manera}}, {{l|es|del mismo modo}}, {{l|es|igualmente}} o {{l|es|también}}. {{uso|leng=ro|literario}}. {{sinónimo|leng=ro|dealtfel|în plus}}. === Etimología 2 === {{etimología|leng=ro|en|item|ítem}}. ==== {{sustantivo masculino|ro}} ==== ;1: {{plm|ítem}}. ==== {{sustantivo neutro|ro}} ==== ;2: {{plm|ítem}}. ==== Declinación ==== {{ro.sust|m}} == Referencias y notas == <references /> :* {{Aulete}} :* {{DAF8}} :* {{dexonline}} :* {{Treccani}} kka3zhaj1z32q61hq7op3pigdghy0fy 6076739 6076529 2026-04-05T11:57:30Z Adelpine 34679 Completa la etimología y uso según [[fr:item]] 6076739 wikitext text/x-wiki {{desambiguación|ítem}} == {{lengua|fr}} == {{pron-graf|leng=fr|audio=LL-Q150 (fra)-WikiLucas00-item.wav|aunota=Lyon|h1=items|p1=idem}} === Etimología === Adverbio: {{etimología|leng=fr|frm|item|asimismo}}, y este del francés antiguo {{l+|fro|item|glosa=asimismo}}, del latín {{l+|la|item|glosa=asimismo}}. Sustantivo: Préstamo {{etim|leng=fr|en|item}}. === {{adverbio de modo|fr|invariable}} === ;1: {{plm|asimismo}}, {{l|es|de la misma manera}}, {{l|es|del mismo modo}}, {{l|es|igualmente}} o {{l|es|también}}. {{sinónimo|leng=fr|aussi|de même|également|idem|ibid|itou|pareillement}}. {{uso|desusado}} ;2: (por extensión) {{plm|además}}. {{sinónimo|leng=fr|au par delà de cela|de plus|de surcroît|en outre|en plus|outre ce|outre cela|outre plus|par surcroît|qui plus est}}. {{uso|desusado}} === {{sustantivo masculino|fr}} === {{fr.sust}} ;3: {{plm|elemento}} o {{l|es|ítem}}. === Véase también === {{w|leng=fr}} == {{lengua|fro}} == {{pron-graf|leng=fro}} === Etimología === {{etimología|leng=fro|la|item|asimismo}}. === {{adverbio de modo|fro}} === ;1: {{plm|asimismo}}, {{l|es|de la misma manera}}, {{l|es|del mismo modo}}, {{l|es|igualmente}} o {{l|es|también}}. == {{lengua|frm}} == {{pron-graf|leng=frm}} === Etimología === {{etimología|leng=frm|fro|item|asimismo}}, y este del latín {{l+|la|item|glosa=asimismo}}. === {{adverbio de modo|frm}} === ;1: {{plm|asimismo}}, {{l|es|de la misma manera}}, {{l|es|del mismo modo}}, {{l|es|igualmente}} o {{l|es|también}}. == {{lengua|en}} == {{pron-graf|leng=en |2audio2=En-us-item.ogg|2aunota2=California|2fone2=ˈaɪ̯.ɾəm|2fone3=ˈaɪ̯.ɾm̩ |2fono1=ˈaɪ.təm|2pron1=General American, Standard Canadian|3fone2=ˈɑe̯.ɾəm|3fone3=ˈɑe̯.ɾm̩ |3fono1=ˈɑe.təm|3pron1=Australia|4fone2=ˈɑe̯.ɾəm|4fone3=ˈɑe̯.ɾm̩ |4fono1=ˈaɪ.təm|4pron1=Nueva Zelanda|1fono1=ˈaɪ.təm |ls=2|1pron1=Received Pronunciation}} === Etimología === {{etimología|leng=en|enm}}, {{etim|leng=en|la}} ("además; asimismo, de la misma manera"). === {{sustantivo|en}} === {{en.sust|c}} ;1: {{plm|ítem}}. === Véase también === {{w|leng=en}} == {{lengua|it}} == {{pron-graf|leng=it}} === Etimología === {{etimología|leng=it|roa-oit|item|glosa=asimismo}}, y este del latín {{l+|la|item|asimismo}}. === {{adverbio de modo|it}} === ;1 {{csem|leng=it|derecho}}: {{plm|asimismo}}, {{l|es|de la misma manera}}, {{l|es|del mismo modo}}, {{l|es|igualmente}} o {{l|es|también}}. === {{sustantivo masculino|it}} === {{it.sust|inv}} ;2 {{csem|leng=it|informática|lingüística}}: {{plm|ítem}}. == {{lengua|roa-oit}} == {{pron-graf|leng=roa-oit}} === Etimología === {{etimología|leng=roa-oit|la|item|asimismo}}. === {{adverbio de modo|roa-oit}} === ;1: {{plm|asimismo}}, {{l|es|de la misma manera}}, {{l|es|del mismo modo}}, {{l|es|igualmente}} o {{l|es|también}}. == {{lengua|la}} == {{pron-graf|leng=la}} === Etimología === {{etimología|leng=la|}} === {{adverbio de modo|la}} === ;1: {{plm|asimismo}}, {{l|es|de la misma manera}}, {{l|es|del mismo modo}}, {{l|es|igualmente}} o {{l|es|también}}. == {{lengua|oc}} == {{pron-graf|leng=oc}} === Etimología === {{etimología|leng=oc|la|item|asimismo}}. === {{adverbio de modo|oc}} === ;1: {{plm|asimismo}}, {{l|es|de la misma manera}}, {{l|es|del mismo modo}}, {{l|es|igualmente}} o {{l|es|también}}. === {{sustantivo masculino|oc}} === {{oc.sust|m}} ;2: {{plm|ítem}}. == {{lengua|pt}} == {{pron-graf|leng=pt}} === Etimología === {{etimología|leng=pt|la|item|asimismo}}. === {{sustantivo masculino|pt}} === {{pt.sust}} ;1: {{plm|ítem}}. ;2: {{plm|objeto}}. {{sinónimo|leng=pt|objeto}}. === Locuciones === {{trad-arriba|Locuciones}} * {{l|pt|item lexical}} {{trad-abajo}} == {{lengua|ro}} == {{pron-graf|leng=ro}} === Etimología 1 === {{etimología|leng=ro|la|item|asimismo}}. ==== {{adverbio de modo|ro}} ==== ;1: {{plm|asimismo}}, {{l|es|de la misma manera}}, {{l|es|del mismo modo}}, {{l|es|igualmente}} o {{l|es|también}}. {{uso|leng=ro|literario}}. {{sinónimo|leng=ro|dealtfel|în plus}}. === Etimología 2 === {{etimología|leng=ro|en|item|ítem}}. ==== {{sustantivo masculino|ro}} ==== ;1: {{plm|ítem}}. ==== {{sustantivo neutro|ro}} ==== ;2: {{plm|ítem}}. ==== Declinación ==== {{ro.sust|m}} == Referencias y notas == <references /> :* {{Aulete}} :* {{DAF8}} :* {{dexonline}} :* {{Treccani}} a5fo15m1vzxr1a58s50i504czu65w23 fixe 0 909594 6076666 6060663 2026-04-05T02:44:31Z TMCbot 164594 . 6076666 wikitext text/x-wiki {{desambiguación|fixé}} == {{lengua|fr}} == {{pron-graf|leng=fr|audio=Fr-fixe.ogg|fono=fiks|g=fix|gnota=como derivado inglés|h=fixent|h2=fixes}} === Etimología 1 === {{etimología|leng=fr|frm|fixe|inmóvil}}, y este del latín {{l+|la|fixus|fixum}}.<ref name="DAF8">{{DAF8}}</ref> ==== {{adjetivo|fr}} ==== {{fr.adj}} ;1: {{plm|inmóvil}} (que no puede moverse). {{sinónimo|leng=fr|immobile}}. {{ejemplo|Le siège de la douleur était '''fixe'''.|trad=El asiento del dolor estaba inmóvil.}} ;2: {{plm|constante}} (que no varia). {{sinónimo|leng=fr|définitif|invariant}}. {{ejemplo|Vendre à prix '''fixe'''.|trad=Vender a un precio constante.}} ==== {{sustantivo|fr|masculino}} ==== {{fr.sust}} ;3: {{plm|renta}} {{l|es|básico|básica}}. {{hiperónimo|leng=fr|revenu}}. {{ejemplo|Son '''fixe''' est de trente-mille francs.}} ==== {{interjección|fr}} ==== ;4 {{csem|leng=fr|milicia}}: ¡{{plm|alto}}! ¡Parados! ¡Quedados! {{ejemplo|À vos rangs ! '''Fixe''' !}} ==== Forma verbal ==== ;5: {{f.v|leng=fr|fixer|1s|pres|ind|pron=je}}. ;6: {{f.v|leng=fr|fixer|3s|pres|ind|pron=elle, on, il}}. ;7: {{f.v|leng=fr|fixer|1s|pres|sub|pron=je}}. ;8: {{f.v|leng=fr|fixer|3s|pres|sub|pron=elle, on, il}}. ==== Locuciones ==== {{trad-arriba|Locuciones}} * {{l+|fr|barre fixe}} * {{l+|fr|idée fixe}} {{trad-abajo}} === Etimología 2 === {{etimología|leng=fr|en|fix|reparación}}. ==== {{sustantivo|fr|masculino}} ==== {{fr.sust}} ;9: {{plm|inyección}} {{l|es|narcótico|narcótica}}. {{ejemplo|Faire un '''fixe''', se faire un '''fixe'''.}} == {{lengua|frm}} == {{pron-graf|leng=frm}} === Etimología === {{etimología|leng=frm|la|fixus|alt=fīxum}}. === {{adjetivo|frm}} === {{inflect.frm.adj.no-género}} ;1: {{plm|inmueble}}. == {{lengua|la}} == {{pron-graf|leng=la|ayuda=fīxe}} === Forma adjetiva === ;1: {{forma adjetivo|leng=la|fixus|vocativo|masculino|singular|alt=fīxus}}. == {{lengua|nrf}} == {{pron-graf|leng=nrf}} === Etimología === {{etimología|leng=nrf|la|fixus|alt=fīxum}}. === {{adjetivo|nrf}} === {{inflect.nrf.adj.no-género}} ;1: {{plm|inmueble}}. === Información adicional === {{derivad|leng=nrf|fixément}}. == {{lengua|pt}} == {{pron-graf|leng=pt|ayuda=fishe|ayudanota=adjetivo, interj.|ayuda2=fikse|ayudanota2=verbo}} === Etimología === {{etimología|leng=pt|fonética|fixo}}, influido por el francés {{l+|fr|fixe}}, ambos del latín {{l+|la|fixus|fīxum}}. === {{adjetivo|pt}} === {{pt.adj|ng}} ;1: {{plm|calmo}} y {{l|es|audaz}}. {{ámbito|leng=pt|Portugal}}. {{uso|leng=pt|informal}}. === {{interjección|pt}} === ;2: ¡{{plm|chévere}}! ¡{{plm|genial}}! {{ámbito|leng=pt|Portugal}}. {{uso|leng=pt|informal}}. {{sinónimo|leng=pt|legal|nota=Brasil}}. === Forma verbal === ;3: {{f.v|leng=pt|fixar|1s|pres|sub|pron=eu}}. ;4: {{f.v|leng=pt|fixar|3s|pres|sub|pron=ela, você, ele}}. ;5: {{f.v|leng=pt|fixar|1s||imp|pron=eu}}. ;6: {{f.v|leng=pt|fixar|3s||imp|pron=ela, você, ele}}. == Referencias y notas == <references /> kwtdsz8qqpaoc0vq2bnqxw7hyvuhm44 cigarra 0 911690 6076556 5737236 2026-04-04T16:33:18Z Limotecariu 6752 /* Traducciones */ 6076556 wikitext text/x-wiki {{desambiguación|Cigarra}} == {{lengua|es}} == {{pron-graf|v=chicharra}} === Etimología === {{etimología|la|cicada|diacrítico=cicāda}}.<ref name="dlc">{{DLC1914|232}}</ref> === {{sustantivo femenino|es}} === {{es.sust}} [[Archivo:Neotibicen linnei.jpg|miniaturadeimagen|[1]]] ;1 {{csem|insectos}}: (''[[species:Cicadidae|Cicadidae]]'') {{plm|insecto}} [[hemíptero]], de unos [[cuatro]] [[centímetro]]s de [[largo]], de [[color]] [[comúnmente]] [[verdoso]] [[amarillento]], con [[cabeza]] [[gruesa]], [[ojo]]s [[saliente]]s, [[antena]]s [[pequeña]]s, [[ala]]s [[membranosa]]s y [[abdomen]] [[cónico]], en cuya [[extremidad]] tienen los [[macho]]s un [[aparato]] [[doble]] muy [[complicado]], con el cual, en [[tiempo]] de mucho [[calor]], producen un [[ruido]] [[estridente]] y [[monótono]].<ref name="dlc" /> ;2: {{plm|bolsa}} (saco para guardar dinero). {{ámbito|germanía}} === Véase también === * {{l|es|cigarro}} {{Wikipedia}} === Traducciones === {{trad-arriba}} {{t|ast|a1=1|t1=cantariella|t2=chicharra|t3=cigarra}} {{t|en|t1=cicada}} {{trad-abajo}} == Referencias y notas == <references /> gzdwfba002yn2bufwdvn15valqhgxi7 anjo 0 912152 6076643 5912180 2026-04-05T02:43:20Z TMCbot 164594 . 6076643 wikitext text/x-wiki {{desambiguación|Anjo}} == {{lengua|mwl}} == {{pron-graf|leng=mwl}} === Etimología === {{etimología|leng=mwl|roa-opt|angeo|ángel}}, y este del latín tardío {{l+|la|angelus|angelum}}, del griego antiguo {{l+|grc|ἄγγελος|tr=ángelos|glosa=mensajero}}. Cognado del castellano {{l+|es|ángel}}, el catalán {{l+|ca|àngel}}, el francés {{l+|fr|ange}}, el gallego {{l+|gl|anxo}}, el italiano {{l+|it|angelo}}, el occitano {{l+|oc|àngel}} y el rumano {{l+|ro|înger}}. === {{sustantivo masculino|mwl}} === ;1 {{csem|religión|leng=mwl}}: {{plm|ángel}}. == {{lengua|pt}} == {{pron-graf|leng=pt|2audio=LL-Q5146 (por)-Nelson Ricardo 2500-anjo.wav}} === Etimología === {{etimología|leng=pt|roa-opt|angeo|ángel}}, y este {{etim|leng=pt|la-lat|angelus|alt=angelum}}, {{etim|leng=pt|grc|ἄγγελος|tr=ángelos|glosa=mensajero}}. Cognado del castellano {{l+|es|ángel}}, el catalán {{l+|ca|àngel}}, el francés {{l+|fr|ange}}, el gallego {{l+|gl|anxo}}, el italiano {{l+|it|angelo}}, el occitano {{l+|oc|àngel}} y el rumano {{l+|ro|înger}}. === {{sustantivo masculino|pt}} === {{pt.sust}} ;1 {{csem|religión|leng=pt}}: {{plm|ángel}}. ;2: {{plm|persona}} {{l|es|óptimo|óptima}}. {{uso|leng=pt|figurado}}. === Locuciones === *{{l+|pt|anjo da guarda}} *{{l+|pt|anjo da morte}} *{{l+|pt|anjo de neve}} *{{l+|pt|bolos de anjo}} *{{l+|pt|cação-anjo}} === Información adicional === {{derivad|leng=pt|anja}}. ==== Descendientes ==== {{trad-arriba|Descendientes}} {{d|kbc|niv=1|d1=aanjo}} {{trad-abajo}} === Véase también === {{w|leng=pt}} == Referencias y notas == <references /> 38hc2y7980v5kczdgo0l655rkknmkrv nossa 0 914131 6076684 5497082 2026-04-05T02:45:13Z TMCbot 164594 . 6076684 wikitext text/x-wiki == {{lengua|fax}} == {{pron-graf|leng=fax |g=nosa}} === Etimología === {{etimología|leng=fax}} === Forma adjetiva === ;1: {{f.adj2|leng=fax|nossu|femenino|singular}}. == {{lengua|roa-opt}} == {{pron-graf|leng=roa-opt}} === Etimología === {{etimología|leng=roa-opt|la-vul|*nossa|nuestra}}, y esta del latín {{l+|la|noster|nostram|glosa=nuestra}}. === Forma adjetiva === ;1: {{f.adj2|leng=roa-opt|nosso|femenino|singular}}. == {{lengua|pt}} == {{pron-graf|leng=pt|audio=LL-Q5146 (por)-Juliano P. Junho (Jjunho)-nossa.wav|audio2=LL-Q5146 (por)-Sillim-nossa.wav|2audio=LL-Q5146 (por)-Santamarcanda-nossa.wav}} === Etimología 1 === {{etimología|leng=pt|roa-opt|nossa|nuestra}}, y esta del latín vulgar {{l+|la|*nossa|glosa=nuestra}}, del latín {{l+|la|noster|nostram|glosa=nuestra}}. ==== Forma adjetiva ==== ;1: {{f.adj2|leng=pt|nosso|femenino|singular}}. === Etimología 2 === {{etimología|leng=pt|acort|nossa senhora|glosa=nuestra señora}}. ==== {{interjección|pt}} ==== ;1: ¡Dios mío!, ¡Ay {{l|es|caramba}}!, ¡{{plm|señor}}! {{sinónimo|leng=pt|ai meu Deus|nossa senhora}}. {{uso|leng=pt|coloquial}} == {{lengua|rm}} == {{pron-graf|leng=rm}} === Etimología === {{etimología|leng=rm|la-vul|*nossa|nuestra}}, y esta del latín {{l+|la|noster|nostram|glosa=nuestra}}. === Forma adjetiva === ;1: {{f.adj2|leng=rm|nies|femenino|singular}}. ;2: {{f.adj2|leng=rm|nos|femenino|singular}}. ;3: {{f.adj2|leng=rm|noss|femenino|singular}}. == Referencias y notas == <references /> 1mixde2zt53f4944gatxhg9486vzyht fevereiro 0 923676 6076664 5857790 2026-04-05T02:44:27Z TMCbot 164594 . 6076664 wikitext text/x-wiki == {{lengua|pt}} == {{pron-graf|leng=pt|audio=Fevereiro - PORT.wav|audio2=LL-Q5146 (por)-MedK1-fevereiro.wav|2audio=LL-Q5146 (por)-Nelson Ricardo 2500-fevereiro.wav}} === Etimología === {{etimología|leng=pt|la|februarius}}.<ref>{{MICHAELIS}}</ref> ==== {{sustantivo masculino|pt}} ==== ;1 {{csem|leng=pt|meses}}: {{plm|febrero}}. ==== Véase también ==== * {{w|leng=pt}} * [[:Categoría:PT:Meses|Meses del año en portugués en el Wikcionario]] == Referencias y notas == <references /> 55x5p4cnzclo09ue44yk88dwm47lfph saxofone 0 926548 6076697 5827401 2026-04-05T02:45:49Z TMCbot 164594 . 6076697 wikitext text/x-wiki == {{lengua|pt}} == {{pron-graf|leng=pt}} === Etimología === {{etimología2|leng=pt|de fabricante Adolphe Sax}}.<ref>{{MICHAELIS}}</ref> === {{sustantivo masculino|pt}} === {{pt.sust}} ;1 {{csem|instrumentos musicales|leng=pt}}: {{plm|saxofón}}, [[saxófono]]. {{hiperónimo|leng=pt|instrumento de sopro}}. === Véase también === {{w|idioma=pt}} == Referencias y notas == <references /> f9iddc2og75w6mzeh8fahpq0h13f82u rainha 0 1003838 6076695 5828808 2026-04-05T02:45:43Z TMCbot 164594 . 6076695 wikitext text/x-wiki == {{lengua|pt}} == {{pron-graf|leng=pt|2audio=LL-Q5146 (por)-Santamarcanda-rainha.wav|2audio2=LL-Q5146 (por)-Nelson Ricardo 2500-rainha.wav}} === Etimología === {{etimología|leng=pt|la|regina}}.<ref>{{Priberam}}</ref> === {{sustantivo femenino|pt}} === {{pt.sust}} ;1 {{csem|leng=pt|política}}: {{plm|reina}}. ;2: Primera o el más destacado entre los de su clase o área. ;3 {{csem|leng=pt|ajedrez}}: ([[♕]], [[♛]]) {{plm|reina}}. === Véase también === {{pt.ajedrez}} == Referencias y notas == <references /> kygjrhl73ty1xaq1ibhzr371sxh9obo Usuario discusión:Tmagc 3 1016821 6076616 6076440 2026-04-04T23:18:43Z Tmagc 158167 /* Pronunciación en portugués */ Respuesta 6076616 wikitext text/x-wiki {{{{ns:3}}:{{ROOTPAGENAME}}/Archivo plantilla}} == Conjugación en inglés == Hola. Encontré unos errores en el módulo de conjugación de verbos en inglés (ej.: [[swim]]): el futuro y condicional simple se muestran con la forma de participio ("will swum", etc.) en lugar de la de infinitivo. [[Usuario:26agcp|26agcp]] ([[Usuario discusión:26agcp|discusión]]) 02:14 8 ene 2026 (UTC) :@[[Usuario:26agcp|26agcp]] Corregido, gracias. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 02:58 8 ene 2026 (UTC) ::@[[Usuario:Tmagc|Tmagc]] Excelente. Solo que para el verbo [[can]] habría que desactivar esos dos tiempos. [[Usuario:26agcp|26agcp]] ([[Usuario discusión:26agcp|discusión]]) 03:19 8 ene 2026 (UTC) :::@[[Usuario:26agcp|26agcp]] Hecho. Si ves más verbos defectivos así, avisame. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 03:29 8 ene 2026 (UTC) ::::@[[Usuario:Tmagc|Tmagc]] Hace falta un parámetro para desactivar el imperativo en verbos como can, shall, must. ::::En otro tema, las formas arcaicas del presente y pretérito de indicativo (terminadas en -est, -st) se usan solo con el pronombre thou. Pero por la forma en que se muestran en la tabla pareciera que se usan con you. No sé si sería mejor moverlas a una nueva columna o agregar una nota para aclarar su uso. [[Usuario:26agcp|26agcp]] ([[Usuario discusión:26agcp|discusión]]) 00:56 12 ene 2026 (UTC) :::::@[[Usuario:26agcp|26agcp]] Listo. Ahora con <nowiki>|fut=no, |cond=no, |imper=no</nowiki> se pueden desactivar esos tiempos. En cuanto a las formas arcaicas terminadas en -est, -st, lo mejor sería moverlas a las tablas del inglés medio o inglés antiguo, el día en que se hagan. Mientras tanto, pondría en el encabezado algo como "you (thou)" para salir del paso. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 21:40 13 ene 2026 (UTC) == Usuaria:19Tarrestnom65 == Buenas tardes, Tmagc, muchas gracias por el mensaje. Me preocupaba haberme creado enemigos, cosa que es muy mala cuando intentas editar. Agradezco muchísimo la idea de la base de datos. Yo los vocablos los saco de un libro en el que están puestos en un glosario, con la definición, pero no es un diccionario y por ejemplo no indica mucho más a parte de decir en algunos el posible origen. Trabajamos últimamente sobre zonas donde usan castellano churro que tiene ciertos términos curiosos. De todos modos, aunque no dejo en saco roto tu propuesta, que me gusta, hoy mismo hemos empezado la preparación de un proyecto que tenemos que tener terminado para principios de marzo y durante al menos lo que queda de mes nos centraremos en esto. En febrero miro de elaborar una hoja de cálculo con las palabras, definiciones y demás información que tenga, ¿podría servirte eso? Seguimos en contacto. Muchísimas gracias por la sugerencia y por vuestra dedicación al proyecto. Un saludo.[[Usuario:19Tarrestnom65|19Tarrestnom65]] ([[Usuario discusión:19Tarrestnom65|discusión]]) 18:29 9 ene 2026 (UTC) :@[[Usuario:19Tarrestnom65|19Tarrestnom65]] En principio sí. El proceso de leer y analizar el libro y extraer las palabras es obviamente una tarea demasiado larga pero si te resulta más fácil organizar las palabras de otro modo yo puedo convertirla al formato de este sitio. Deberías contar con, además de las palabras y las definiciones, las marcas gramaticales de clase, género, etc., las marcas de uso o ámbito y opcionalmente la etimología. Cuando tengas un par de decenas avisame así puedo hacer una prueba primero. Y no busco enemigos, lo único que no quiero es que cada usuario nuevo que venga al sitio se convierta en un problema más del que nos tengamos que preocupar. Saludos. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 19:55 9 ene 2026 (UTC) == Tiempos compuestos en italiano/francés == Hola de nuevo. Encontré un error en los módulos para estos idiomas. En italiano, cuando se forman los tiempos compuestos con el auxiliar essere, el participio debe concordar en género y número con el sujeto. Por ejemplo, ''eravamo arrivat'''i'''''. Mientras que cuando se usa avere, el participio es invariante: ''avevamo arrivato''. En francés ocurre lo mismo (debe haber concordancia cuando se usa être): ''nous sommes arrivé'''s'''''. [[Usuario:26agcp|26agcp]] ([[Usuario discusión:26agcp|discusión]]) 12:12 18 ene 2026 (UTC) :@[[Usuario:26agcp|26agcp]] Hecho, creo. Asumo que todos los participios en plural se forman reemplazando la o por la i en el italiano, y concatenando una s final en francés. En cuanto al género, muestro solamente el masculino por una cuestión de economía. Gracias por avisar. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 15:37 18 ene 2026 (UTC) == Plural en locuciones == Hola @[[Usuario:Tmagc|Tmagc]]. Noté que en entradas de locuciones, como [[plot twist]] o [[árbol de Navidad]], en el plural nuevo que añadiste genera los enlaces [[plot]] [[twists]] por separado, en vez de [[plot twists]], que sería lo correcto. [[Usuario:PFSV-UY|PFSV-UY]] ([[Usuario discusión:PFSV-UY|discusión]]) 18:05 13 feb 2026 (UTC) :@[[Usuario:PFSV-UY|PFSV-UY]] Eliminamos hace tiempo los plurales de locuciones, más que nada para desincentivar el farmeo excesivo e incentivar a que los usuarios se centren en agregar el contenido propiamente dicho, antes que generar automáticamente entradas de formas flexivas en masa sin siquiera revisar nada. Por lo que esa entrada debería ser eliminada. Saludos. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 18:13 13 feb 2026 (UTC) ::¿En todos los casos? Porque en algunos idiomas hay palabras que son técnicamente locuciones porque tienen espacio entre ambos términos, pero que dichos términos por separado no tienen significado alguno (como si Sri Lanka tuviera plural me entiendes). [[Usuario:PFSV-UY|PFSV-UY]] ([[Usuario discusión:PFSV-UY|discusión]]) 18:16 13 feb 2026 (UTC) :::@[[Usuario:PFSV-UY|PFSV-UY]] No eliminamos las locuciones, eliminamos las formas flexivas de locuciones como entradas independientes. [[Sri Lanka]] es una entrada válida que no tiene plural, y por lo tanto la plantilla no generará forma flexiva alguna al invocarse <del><nowiki>{{es.sust|s}}</nowiki></del> (perdón, en español no mostramos la plantilla de flexión para los nombres propios). [[árbol de Navidad]] vale, pero no [[árboles de Navidad]]. Estoy revisando tus contribuciones y veo que agregaste unas cuantas formas flexivas de locuciones en klingon. Cuando implemente la nueva plantilla, recopilaré dichas entradas y le pediré a @[[Usuario:Peter Bowman|Peter Bowman]] que las elimine, tal como ocurrió con los demás idiomas. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 18:19 13 feb 2026 (UTC) ::::Pero no entiendes lo que me refiero: hay locuciones que tienen plural en su idioma (imagínate [[palabra1 palabra2-plural]], que no tendría sentido [[palabra1]] [[palabra2-plural]] ya que [[palabra2-plural]] no existe como palabra con dicho plural (o a veces en la locución cambia de tipo de plural, ej. si la locución forma una palabra sobre profesión (plural pu') y la palabra que recibe el plural por separado tiene el plural mey. [[Usuario:PFSV-UY|PFSV-UY]] ([[Usuario discusión:PFSV-UY|discusión]]) 18:25 13 feb 2026 (UTC) :::::Considero que la decisión es muy centrada en el español o idiomas indoeuropeos y no considera locuciones como unidad léxica única inseparable, en lugar de locuciones nominales típicas de los idiomas occidentales. [[Usuario:PFSV-UY|PFSV-UY]] ([[Usuario discusión:PFSV-UY|discusión]]) 18:27 13 feb 2026 (UTC) :::::@[[Usuario:PFSV-UY|PFSV-UY]] Si ese es el caso del klingon, optaría por tratar a todas las entradas como sustantivos y no como locuciones para no confundir a los (futuros) bots de mantenimiento que implemente. Y así, puedo configurar la plantilla {{ep|tlh.sust}} para que no fragmente los plurales de las locuciones. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 18:28 13 feb 2026 (UTC) :::::@[[Usuario:PFSV-UY|PFSV-UY]] En efecto, somos indoeurocéntricos o romanocéntricos porque fuera de las lenguas romances no tenemos ecosistemas vivos, por lo tanto no puedo esquematizar lo que no conozco. Pero podemos ser flexibles en ese punto, no veo por qué no. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 18:30 13 feb 2026 (UTC) ::::::Creo que tratarlas como sustantivos (aunque técnicamente son locuciones sustantivas) sería un buen punto medio, así no se generan plurales sin sentido que podrían ser engañosos (como el ejemplo que te di). Agradezco la comprensión. Me preguntaba si tu solución es que se mantengan las entradas del plural como si fueran sustantivos normales, o si tu solución es simplemente para que aparezcan en la entrada principal, sin entrada flexiva. [[Usuario:PFSV-UY|PFSV-UY]] ([[Usuario discusión:PFSV-UY|discusión]]) 18:37 13 feb 2026 (UTC) == Klingon fonología == El klingon tiene un sistema fonético exacto letra a letra que no cambia en lo absoluto. Entiendo que ahora no estás enfocado tanto en la pronunciación y más en la flexión, pero podríamos incluirlo eventualmente así como incluímos al toki pona en su momento. En [https://es.wikipedia.org/wiki/Idioma_klingon#Fonología este artículo] se encuentra la tabla fonética del idioma, suficiente como para poder hacer el módulo. [[Usuario:PFSV-UY|PFSV-UY]] ([[Usuario discusión:PFSV-UY|discusión]]) 03:03 16 feb 2026 (UTC) :@[[Usuario:PFSV-UY|PFSV-UY]] veo que la g aparece en los digrafos "gh" y "ng". No puede aparecer sola? [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 03:13 16 feb 2026 (UTC) :Misma observación para la h. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 03:14 16 feb 2026 (UTC) ::No, la g sólo aparece en los digrafos, lo mismo pasa con la h (supongo que es una rareza a propósito del conlang), nunca aparecen fuera de esos dígrafos. Si estás preocupado sobre qué pasa si en una entrada la g o h está sola, no te preocupes, es una señal de que esa entrada no debe existir. [[Usuario:PFSV-UY|PFSV-UY]] ([[Usuario discusión:PFSV-UY|discusión]]) 03:30 16 feb 2026 (UTC) :@[[Usuario:PFSV-UY|PFSV-UY]] Dónde debo acentuar las palabras? [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 03:58 16 feb 2026 (UTC) :: La regla de acentuación es bastante lógica pero depende de si la palabra es un sustantivo o un verbo:<br>* '''Sustantivos''': El acento cae en la última sílaba de la raíz (ignorando sufijos). Sin embargo, si un sufijo termina en ' (el saltillo), el acento se desplaza hacia esa sílaba.<br>* '''Verbos''': El acento cae normalmente en la propia raíz verbal. Pero si hay un sufijo que termina en ' y está separado de la raíz por al menos otro sufijo, ese sufijo con ' también se acentúa.<br>Como tiene estas reglas, no estoy seguro de si sea automatizable. Como opción podríamos hacer un sistema simplificado sin acentuación por el momento. [[Usuario:PFSV-UY|PFSV-UY]] ([[Usuario discusión:PFSV-UY|discusión]]) 04:47 16 feb 2026 (UTC) :::@[[Usuario:PFSV-UY|PFSV-UY]] Si tenemos una lista con todos los sufijos, se puede automatizar. Sino, podemos hacerlo sin acentuación por el momento. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 04:50 16 feb 2026 (UTC) ::::[https://klingon.wiki/En/SuffixType Aquí] está la lista de sufijos. Recuerda que solamente vamos a considerar los sufijos que terminan en ', ya que son los únicos que cambian la regla general. [[Usuario:PFSV-UY|PFSV-UY]] ([[Usuario discusión:PFSV-UY|discusión]]) 05:01 16 feb 2026 (UTC) :::::@[[Usuario:PFSV-UY|PFSV-UY]] El acento cae en la última sílaba de la raíz, por lo tanto necesito separar los sufijos antes de acentuar. Es decir, no puedo ignorar el resto. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 05:16 16 feb 2026 (UTC) ::::::Claro. Si es un sufijo sin ', no se cuenta y se acentúa en la última palabra antes de esa, si es con ', esa cuenta como última palabra y se acentúa. [[Usuario:PFSV-UY|PFSV-UY]] ([[Usuario discusión:PFSV-UY|discusión]]) 05:50 16 feb 2026 (UTC) :::::Solo para asegurarme, decime que no tenemos casos de falsos sufijos, análogos a los casos de falsos prefijos en español. Es decir, palabras que terminen con esa secuencia y que superficialmente aparenten llevar el sufijo, pero que no lo lleven en absoluto. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 05:18 16 feb 2026 (UTC) ::::::No tengo el conocimiento del 100% de las palabras de Klingon, pero no es algo para nada común y no puedo recordar un ejemplo. Si tal caso llegase a existir, se podría simplemente agregar de forma manual. [[Usuario:PFSV-UY|PFSV-UY]] ([[Usuario discusión:PFSV-UY|discusión]]) 05:56 16 feb 2026 (UTC) == Latín tardío == Hola. Me preguntaba si se podría añadir «latín tardío» a la lista de ámbitos de Wikcionario:Lista de etiquetas, para que esta pueda ser detectada por el auto cat. [[Usuario:PFSV-UY|PFSV-UY]] ([[Usuario discusión:PFSV-UY|discusión]]) 06:17 20 feb 2026 (UTC) :@[[Usuario:PFSV-UY|PFSV-UY]] Por ahora, las variantes del latín están consideradas como idiomas aparte. El motivo de no unificarlas es que de ser así debería unificarlas también en la etimología, puesto que todavía no tengo tiempo para crear un nuevo submódulo e importar los códigos de idioma solamente etimológicos, tal como se hizo en en.wikt. Si en el futuro lo hago, se unificaría todo y efectivamente pasarían las variantes a ser consideradas ámbitos. Saludos. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 13:05 20 feb 2026 (UTC) ::Sí, y me parece bien que estén separados personalmente (claramente no son el mismo idioma), pero no parece haber un código aparte para latín tardío como lo hay con el latín vulgar o el neolatín, por eso preguntaba. [[Usuario:PFSV-UY|PFSV-UY]] ([[Usuario discusión:PFSV-UY|discusión]]) 14:20 20 feb 2026 (UTC) :::@[[Usuario:PFSV-UY|PFSV-UY]] Ya modifiqué tus ediciones. Saludos. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 14:21 20 feb 2026 (UTC) ::::Ya veo. No conocía la etiqueta la-lat. Eso está mucho mejor. [[Usuario:PFSV-UY|PFSV-UY]] ([[Usuario discusión:PFSV-UY|discusión]]) 14:23 20 feb 2026 (UTC) == Palabras asturianas acabadas en -au/-eu/-ou == ¡Hola! En principio, y de manera general, las palabras que terminan en asturianu en diptongo decreciente con glide velar, es decir, /aw, ew, ow/ son en general agudas, por lo que ortográficamente llevan acento gráfico en la vocal abierta, -áu, -éu, -óu (excepto si son monosílabos, claro, como llau, prau, feu, mou), y suele corresponderse a las terminaciones castellanas "-ado, -edo/-eo, *-odo/-oo"; este último, /ow/ es muy raro en el asturiano estándar y apenas si aparece en mou (modo), protozóu, y alguna palabra dialectal incorporada al estándar, como fou (bellota) o ḥou (hondonada en el terreno); sí es habitual en el asturiano occidental, básicamente en la terminación de tercera persona singular del pretérito perfecto: falóu, cantóu, comenzóu, etc. (en el estándar y asturiano centrooriental, faló, cantó, comenzó, etc.). Sin ser este diptongo tónico, así a bote pronto sólo me parece que existen palabras acabadas en -eu, como las dichas de gluteu, mediterraneu, contemporaneu, yerbaceu y similares. Quizá pueda existir alguna terminada en -au, muy raro sería en -ou, pero no me parece que haya en ninguno de los dos casos. Todo sería hacer una búsqueda en el DALLA, en la búsqueda avanzada de "que finen en", para encontrar alguna (eso sí, habría que buscar por -bau, -cau, -dau, etc., porque si buscamos directamente por -au, da como respuesta "demasiados resultados" -no diferencia o no tienen en cuenta la acentuación gráfica). Una cosa con respecto a los adjetivos tipo mediterraneu, contemporaneu y similares: aunque esta es la forma estándar y única admitida, hay escritores que usan las formas adaptando la -e- a -i-, es decir, mediterraniu, contemporaniu, yerbaciu, etc. (y lógicamente en toda su flexión: mediterrania, mediterranios...), ya que realmente la pronunciación patrimonial es trasformar esa -e- en una -i- y hacer diptongo con la vocal siguiente (una escritora, Esther Prieto, autora del manual ''Gramática del asturianu. Guía de consulta rápida'' (ISBN: 978-84-10345-75-1), que recientemente viene de publicar su segunda edición, así lo menciona). Cuidado, porque palabras como craniu y llinia son siempre con -i- en asturiano. [[Usuario:Limotecariu|Limotecariu]] ([[Usuario discusión:Limotecariu|discusión]]) 15:49 22 feb 2026 (UTC) :@[[Usuario:Limotecariu|Limotecariu]] Gracias por la información. De momento, solo detecto -eu porque los otros casos me parecerían muy raros, ni siquiera tendrían equivalente etimológico en castellano. El mero hecho de que sean muy raros hace que sea incluso conveniente que haya que completar las formas a mano, por precaución. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 23:14 22 feb 2026 (UTC) == Plantillas de pronombres == Hola. Noté que las nuevas plantillas de pronombres ({{ep|es.pron}}, {{ep|la.pron}}, etc.) no se ven bien en la vista móvil: hacen falta las etiquetas al principio de cada renglón (supongo que deberían decir nom., acus., dat., etc.) y ocultar el renglón donde están los encabezados (tal como se hace en los módulos de flexión con <code>class="pc"</code>). [[Usuario:26agcp|26agcp]] ([[Usuario discusión:26agcp|discusión]]) 01:40 28 feb 2026 (UTC) :@[[Usuario:26agcp|26agcp]] Gracias por avisar. Como veo que será muy poco práctico hacerlo fuera de un módulo, preferiría quitar la doble vista y que quede como funcionaban antes las plantillas de flexión: saliendo de la pantalla y que haya que deslizarse. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 01:47 28 feb 2026 (UTC) == Pronunciación en portugués == Hola. Por alguna razón, no se genera la pronunciación de las palabras en portugués con la plantilla pron-graf (ej.: [[coração]]), a pesar de que ya estaba implementada. [[Usuario:26agcp|26agcp]] ([[Usuario discusión:26agcp|discusión]]) 01:19 20 mar 2026 (UTC) :@[[Usuario:26agcp|26agcp]] Sí, desactivé el módulo porque lo había roto en una gran migración "interna" que hice a finales del año pasado. Como no me gustaba la estructura calcada de en.wikt, reescribí todos los módulos de acuerdo a mi criterio, pero por alguna razón había cosas del portugués y creo que del francés que no terminaban de funcionar igual de bien que como estban. Igual gracias por recordármelo, lo voy a revisar. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 01:26 20 mar 2026 (UTC) :@[[Usuario:26agcp|26agcp]] Ya restauré el módulo y corregí la mayoría de errores que tenía ([[Módulo:generar-pron/pt/test]]). En esta nueva versión, solamente se generan dos pronunciaciones, una general para Brasil y otra para Portugal. Anteriormente se generaban ocho pronunciaciones (o dieciséis), pero decidí reducirlas porque: 1. es antiestético una tabla de pronunciación tan grande 2. la mayoría de diferencias eran nimias y fonéticas (no fonológicas), mientras que decidí restringirlo a la fonología porque la fonética del portugués es bastante complicada e irregular como para tratarla con un módulo. Quedan algunos detalles con las vocales, sobre todo cuándo deben ser abiertas o cerradas y cuando deben formar diptongo o hiato, que espero corregirlos en un futuro. PEro en lo grueso ya se puede usar. Ahora en un rato corrijo la posición de los audios. Saludos. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 23:18 4 abr 2026 (UTC) == Edición errónea == Hola!, asumiré que fué un error de edición del bot [[Special:Diff/60745321|acá]]. Procedí a revertirla. De tal modo, creo no es apropiado que se editen páginas de usuario, sin antes consultarlo con el usuario en cuestión. Un gran saludo! — <span style="text-shadow:grey 0.8em 0,5em ;font-family:serif">[[User:Mazbel|ℳazbel]]&nbsp;<sup><nowiki>[</nowiki>[[User talk:Mazbel|Talk]]<nowiki>]</nowiki></sup></span> 17:51 2 abr 2026 (UTC) :Hola, @[[Usuario:Tmagc|Tmagc]]. Aparte de lo que indica Mazbel, ediciones como [[Especial:Diff/6076166|esta]] o [[Especial:Diff/6076138|esta]] no son simple cosmética, alteran el contenido y/o su presentación. Convendría revisar lo que ha hecho el bot y revertir esos cambios. Un saludo, [[Usuario:Peter Bowman|Peter Bowman]] ([[Usuario discusión:Peter Bowman|discusión]]) 19:51 2 abr 2026 (UTC) :@[[Usuario:Mazbel|Mazbel]] @[[Usuario:Peter Bowman|Peter Bowman]] El motivo de las ediciones es simplemente eliminar los [[Especial:Errores de sintaxis|errores de sintaxis]], conviene que queden todos o casi todos en 0. Discrepo con lo que dicen, el motivo de retirar los tags es que evidentemente están mal colocados y no tengo tiempo para acomodar cada par, el sistema solamente me dice vagamente qué etiqueta produce el error, no dónde ni cómo. Si tienen una solución mejor, procedan. Pero no reviertan simplemente para volver a dejar los 1k errores de sintaxis que teníamos. Y no me echen ahora la culpa a mí de las irresponsabilidades que cometieron en el pasado, gran favor les estoy haciendo en arreglarlas. Saludos. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 20:31 2 abr 2026 (UTC) ::@[[Usuario:Tmagc|Tmagc]]: aunque la página especial se llame "errores", generalmente no lo son, raramente tienen repercusión alguna. Si alguien decidió en su día subrayar un texto o formatear una línea de código, tendría sus motivos; no puedes editar arbitrariamente (hasta donde sé, no hay ningún problema en emplear etiquetas &lt;u&gt; o &lt;code&gt;) discusiones pasadas solo con el pretexto de vaciar una lista de mantenimiento. Voy a ignorar tu tono victimista y jactancioso y sí, debes tomarte el tiempo en hacerlo bien, de lo contrario es mejor que no lo hagas, que ya lo revisará otro. En la página de Mazbel eliminaste contenido válido, y a saber cuántas páginas más habrán resultado afectadas. [[Usuario:Peter Bowman|Peter Bowman]] ([[Usuario discusión:Peter Bowman|discusión]]) 22:41 2 abr 2026 (UTC) ::@[[Usuario:Peter Bowman|Peter Bowman]] Te faltó mencionar que el problema de la anidación se extendió al espacio principal y muchas páginas de allí se vieron afectadas, sobre todo por no haber cerrado el contenedor de {{ep|trad-arriba}}, aparte de que había también algunos tags mal puestos. Puesto que no hay módulo que arroje error por ello, y que no hay una forma de excluir o limitar los errores de sintaxis a páginas del espacio principal, mantengo mi postura. Tener las listas en 0 sirve como una herramienta adicional para poder traquear errores graves de formato en el espacio principal y en espacios no de discusión, cuando no hay módulo que pueda hacerlo. Obviamente sé que no todos los errores son importantes, si pensara eso hubiese vaciado las páginas que contienen etiquetas obsoletas o hubiese vaciado páginas con el otro error de "Existe una regla de estilo para el color de fondo a nivel de línea sin un color de texto correspondiente", tan bobo no soy. Para el resto, no me queda claro a qué te referís con lo de que lo "revisará otro", quién más hace mantenimiento en el sitio? Veré de revisar un poco pero me parece un disparate: primero revertir todo porque me he metido con cosillas de usuarios que ni siquiera participan del proyecto en pos de facilitar la tarea de mantenimiento (explicado primera frase de la respuesta), segundo que me carguen a mí la responsabilidad de arreglar las PU cuando a los usuarios afectados les llegará la notificación y pueden optar por arreglar ellos el formato de sus propias páginas, pueden colaborar también, no (el usuario que vino ni siquiera se ocupó de revisar los errores de sus PU's, qué fácil es quejarse así)? Y tercero, porque hay errores que a mi juicio son imposibles de solucionar sin eliminar las etiquetas, requeriría ir a buscar a cada uno de los usuarios y preguntarles cuál fue su intención en ese momento de haber usado la etiqueta para saber en dónde hay que cerrarla. Todavía no me termina de cerrar tu propuesta. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 23:03 2 abr 2026 (UTC) :::@[[Usuario:Tmagc|Tmagc]]: de acuerdo, hay cosas que conviene corregir antes que otras, ahí viene bien que el sistema las categorice por su prioridad. De vez en cuando reviso esas listas en plwiktionary y, francamente, cuando veo resultados en el espacio de usuario (o su discusión), casi siempre los ignoro, que cada cual se haga responsable de poner orden en su propia casa (y si renderiza mal, pues es su problema). Mi observación anterior incidía en el hecho de que borraste etiquetas válidas tratando de corregir otras que no lo eran. [[Usuario:Peter Bowman|Peter Bowman]] ([[Usuario discusión:Peter Bowman|discusión]]) 09:50 3 abr 2026 (UTC) 5cg0n7lk8zolo7y7hr9rdq0bwiekfo9 genro 0 1017651 6076667 5858851 2026-04-05T02:44:35Z TMCbot 164594 . 6076667 wikitext text/x-wiki == {{lengua|pt}} == {{pron-graf|leng=pt|2audio=LL-Q5146 (por)-Waldyrious-genro.wav}} === Etimología === {{etimología|leng=pt|roa-opt|genrro}}, {{etim|leng=pt|la|gener|alt=generum}}. ==== {{sustantivo masculino|pt}} ==== ;1: {{plm|yerno}}. == Referencias y notas == <references /> ll0tu4vrmco7qxlcdk1ba4v439nt3kj Módulo:generar-pron/pt 828 1031430 6076531 6076524 2026-04-04T14:01:58Z Tmagc 158167 6076531 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^(.*)([aeiou])([iu]?"..CONS.."+)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ʧ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([ieéèẹēêëEy])", "s%1") text = gsub(text, "g([ieéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([ieéèẹēêëE])", "g%1") text = gsub(text, "qu([ieéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "ie", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")it", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "i%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "e("..SEPSIL..")i", "ɐ%1i") br = gsub(br, ".", convertir_vocales_br) pt = gsub(br, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "i)", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "i)", "%1a%2") pt = gsub(pt, "([eo])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") local pt_uv = {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"} pt = gsub(pt, "[aeo]", pt_uv) local pt_sv = {["A"] = "a", ["E"] = "e", ["O"] = "o"} pt = gsub(pt, "[AEO]", pt_sv) pt = gsub(pt, "[sz]"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) pt = gsub(pt, "ʧ", "ʃ") br = gsub(br, "ʧ", "ʃ") br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "("..VOCAL..")("..SEPSIL..")", function (x, y) return nasalizar[x]..y end) br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") br = gsub(br, "[eE]", "é") br = gsub(br, "[oO]", "ó") br = gsub(br, "[aA]", "á") -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export pysoz6iprvuz3fpi2hv2ar0jp7a3e87 6076532 6076531 2026-04-04T14:14:43Z Tmagc 158167 6076532 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^(.*)([aeiou])([iu]?"..CONS.."+)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ʧ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([ieéèẹēêëEy])", "s%1") text = gsub(text, "g([ieéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([ieéèẹēêëE])", "g%1") text = gsub(text, "qu([ieéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "ie", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")it", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "i%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "e("..SEPSIL..")i", "ɐ%1i") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "i)", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "i)", "%1a%2") pt = gsub(pt, "([eo])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") local pt_uv = {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"} pt = gsub(pt, "[aeo]", pt_uv) local pt_sv = {["A"] = "a", ["E"] = "e", ["O"] = "o"} pt = gsub(pt, "[AEO]", pt_sv) pt = gsub(pt, "[sz]"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) pt = gsub(pt, "ʧ", "ʃ") br = gsub(br, "ʧ", "ʃ") br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "("..VOCAL..")("..SEPSIL..")", function (x, y) return nasalizar[x]..y end) br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") br = gsub(br, "[eE]", "é") br = gsub(br, "[oO]", "ó") br = gsub(br, "[aA]", "á") -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export 5usaahvnn05mfwpjnzujhfwdquxipv9 6076533 6076532 2026-04-04T14:16:08Z Tmagc 158167 6076533 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^(.*)([aeiou])([iu]?"..CONS.."+)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ʧ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([ieéèẹēêëEy])", "s%1") text = gsub(text, "g([ieéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([ieéèẹēêëE])", "g%1") text = gsub(text, "qu([ieéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "ie", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")it", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "i%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "e("..SEPSIL..")i", "ɐ%1i") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "i)", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "i)", "%1a%2") pt = gsub(pt, "([eo])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") local pt_uv = {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"} pt = gsub(pt, "[aeo]", pt_uv) local pt_sv = {["A"] = "a", ["E"] = "e", ["O"] = "o"} pt = gsub(pt, "[AEO]", pt_sv) pt = gsub(pt, "[sz]"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) pt = gsub(pt, "ʧ", "ʃ") br = gsub(br, "ʧ", "ʃ") br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") br = gsub(br, "[eE]", "é") br = gsub(br, "[oO]", "ó") br = gsub(br, "[aA]", "á") -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export ncz6va9ywrdt4qtax9tzujqxltlgdgr 6076539 6076533 2026-04-04T15:16:16Z Tmagc 158167 6076539 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^(.*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ʧ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([ieéèẹēêëEy])", "s%1") text = gsub(text, "g([ieéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([ieéèẹēêëE])", "g%1") text = gsub(text, "qu([ieéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "ie", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")it", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "i%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "e("..SEPSIL..")i", "ɐ%1i") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "i)", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "i)", "%1a%2") pt = gsub(pt, "([eo])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") local pt_uv = {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"} pt = gsub(pt, "[aeo]", pt_uv) local pt_sv = {["A"] = "a", ["E"] = "e", ["O"] = "o"} pt = gsub(pt, "[AEO]", pt_sv) pt = gsub(pt, "[sz]"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) pt = gsub(pt, "ʧ", "ʃ") br = gsub(br, "ʧ", "ʃ") br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") br = gsub(br, "[eE]", "é") br = gsub(br, "[oO]", "ó") br = gsub(br, "[aA]", "á") -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export 4vyzg73f9faqfi85af1onkupi5ke0x2 6076542 6076539 2026-04-04T15:30:10Z Tmagc 158167 6076542 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^(.*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ʧ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([ieéèẹēêëEy])", "s%1") text = gsub(text, "g([ieéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([ieéèẹēêëE])", "g%1") text = gsub(text, "qu([ieéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "ie", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")it", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "i%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "e("..SEPSIL..")i", "ɐ%1i") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "i)", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "i)", "%1a%2") pt = gsub(pt, "([eo])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") local pt_uv = {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"} pt = gsub(pt, "[aeo]", pt_uv) local pt_sv = {["A"] = "a", ["E"] = "e", ["O"] = "o"} pt = gsub(pt, "[AEO]", pt_sv) pt = gsub(pt, "[kg]?[sz]"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) pt = gsub(pt, "ʧ", "ʃ") br = gsub(br, "ʧ", "ʃ") br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") br = gsub(br, "[eE]", "é") br = gsub(br, "[oO]", "ó") br = gsub(br, "[aA]", "á") -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export 074rhbpl81x07bn3o7ybcbg0oeb06ki 6076543 6076542 2026-04-04T15:31:19Z Tmagc 158167 6076543 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^(.*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ʧ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([ieéèẹēêëEy])", "s%1") text = gsub(text, "g([ieéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([ieéèẹēêëE])", "g%1") text = gsub(text, "qu([ieéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "ie", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")it", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "i%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "e("..SEPSIL..")i", "ɐ%1i") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "i)", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "i)", "%1a%2") pt = gsub(pt, "([eo])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") local pt_uv = {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"} pt = gsub(pt, "[aeo]", pt_uv) local pt_sv = {["A"] = "a", ["E"] = "e", ["O"] = "o"} pt = gsub(pt, "[AEO]", pt_sv) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) pt = gsub(pt, "ʧ", "ʃ") br = gsub(br, "ʧ", "ʃ") br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") br = gsub(br, "[eE]", "é") br = gsub(br, "[oO]", "ó") br = gsub(br, "[aA]", "á") -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export l53gw2fdc2rlub3lpvl92i63bkupo9z 6076547 6076543 2026-04-04T16:00:20Z Tmagc 158167 6076547 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" local LETRA_NO_TILDE = "[^" .. separador .. vocal_tilde .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^(.*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ʧ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([ieéèẹēêëEy])", "s%1") text = gsub(text, "g([ieéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([ieéèẹēêëE])", "g%1") text = gsub(text, "qu([ieéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "ie", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")it", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "i%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "e("..SEPSIL..")i", "ɐ%1i") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "i)", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "i)", "%1a%2") pt = gsub(pt, "([eo])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(INICIO_PALABRA.."o("..LETRA_NO_TILDE.."*"..VOCAL..LETRA_NO_TILDE.."*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEO]", {["A"] = "a", ["E"] = "e", ["O"] = "o"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) pt = gsub(pt, "ʧ", "ʃ") br = gsub(br, "ʧ", "ʃ") br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEO]", {["A"] = "á", ["E"] = "é", ["O"] = "ó"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export 1cvcgr9qpjie2nwd0qpzo9bvi9rjemr 6076548 6076547 2026-04-04T16:01:04Z Tmagc 158167 6076548 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" local LETRA_NO_TILDE = "[^" .. separador .. vocal_tilde .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^(.*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ʧ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([ieéèẹēêëEy])", "s%1") text = gsub(text, "g([ieéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([ieéèẹēêëE])", "g%1") text = gsub(text, "qu([ieéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "ie", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")it", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "i%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "e("..SEPSIL..")i", "ɐ%1i") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "i)", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "i)", "%1a%2") pt = gsub(pt, "([eo])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o("..LETRA_NO_TILDE.."*"..VOCAL..LETRA_NO_TILDE.."*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEO]", {["A"] = "a", ["E"] = "e", ["O"] = "o"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) pt = gsub(pt, "ʧ", "ʃ") br = gsub(br, "ʧ", "ʃ") br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEO]", {["A"] = "á", ["E"] = "é", ["O"] = "ó"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export 01i75sgyz7asjsoqralyjybvts6t8ct 6076549 6076548 2026-04-04T16:02:58Z Tmagc 158167 6076549 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^(.*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ʧ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([ieéèẹēêëEy])", "s%1") text = gsub(text, "g([ieéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([ieéèẹēêëE])", "g%1") text = gsub(text, "qu([ieéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "ie", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")it", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "i%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "e("..SEPSIL..")i", "ɐ%1i") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "i)", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "i)", "%1a%2") pt = gsub(pt, "([eo])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEO]", {["A"] = "a", ["E"] = "e", ["O"] = "o"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) pt = gsub(pt, "ʧ", "ʃ") br = gsub(br, "ʧ", "ʃ") br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEO]", {["A"] = "á", ["E"] = "é", ["O"] = "ó"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export qook2ish1r4fka4q7kg4et0nvh06qpj 6076553 6076549 2026-04-04T16:25:25Z Tmagc 158167 6076553 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^(.*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ʧ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([ieéèẹēêëEy])", "s%1") text = gsub(text, "g([ieéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([ieéèẹēêëE])", "g%1") text = gsub(text, "qu([ieéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "ie", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")it", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "i%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "e("..SEPSIL..")i", "ɐ%1i") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "i)", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "i)", "%1a%2") pt = gsub(pt, "([eo])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])i", function(x) return palatalize_td[x].."i" end) br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEO]", {["A"] = "a", ["E"] = "e", ["O"] = "o"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) pt = gsub(pt, "ʧ", "ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ʧ", "ʃ") br = gsub(br, "ʤ", "d͡ʒ") br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEO]", {["A"] = "á", ["E"] = "é", ["O"] = "ó"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export kgjrcfcxlk8cu8jhcb3dqv4e9vmyfzz 6076554 6076553 2026-04-04T16:30:08Z Tmagc 158167 6076554 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^(.*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ʧ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([ieéèẹēêëEy])", "s%1") text = gsub(text, "g([ieéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([ieéèẹēêëE])", "g%1") text = gsub(text, "qu([ieéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "ie", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")it", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "i%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "e("..SEPSIL..")i", "ɐ%1i") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "i)", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "i)", "%1a%2") pt = gsub(pt, "([eo])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEO]", {["A"] = "a", ["E"] = "e", ["O"] = "o"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEO]", {["A"] = "á", ["E"] = "é", ["O"] = "ó"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])i", function(x) return palatalize_td[x].."i" end) br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ʧ", "ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ʧ", "ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export boeauvsr9e1t3the9fs5r33r5wmi4oo 6076555 6076554 2026-04-04T16:33:18Z Tmagc 158167 6076555 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^(.*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([ieéèẹēêëEy])", "s%1") text = gsub(text, "g([ieéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([ieéèẹēêëE])", "g%1") text = gsub(text, "qu([ieéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "ie", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")it", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "i%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "e("..SEPSIL..")i", "ɐ%1i") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "i)", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "i)", "%1a%2") pt = gsub(pt, "([eo])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEO]", {["A"] = "a", ["E"] = "e", ["O"] = "o"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEO]", {["A"] = "á", ["E"] = "é", ["O"] = "ó"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])i", function(x) return palatalize_td[x].."i" end) br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export o9v4p64w54fksgufukjdij1ybp1bivd 6076557 6076555 2026-04-04T16:41:29Z Tmagc 158167 6076557 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^(.*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "ie", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "e("..SEPSIL..")i", "ɐ%1i") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([eo])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEO]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export 1eiosvv7ylcvktzph5jj9j21o893jzq 6076558 6076557 2026-04-04T16:42:52Z Tmagc 158167 6076558 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^(.*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "ie", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "e("..SEPSIL..")i", "ɐ%1i") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([eo])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export 4o5k7a81n3qsp4nk7l36tyi0gv56iiw 6076560 6076558 2026-04-04T16:50:36Z Tmagc 158167 6076560 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^(.*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "ie", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "e("..SEPSIL..")i", "ɐ%1i") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([eo])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export tle6xroo7zhqx8wnid8rpom7ybqmhz9 6076561 6076560 2026-04-04T16:54:58Z Tmagc 158167 6076561 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^(.*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "ie", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "e("..SEPSIL..")i", "ɐ%1i") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([eo])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export q862enlzeebxd3p6gseld3q69q9mguq 6076562 6076561 2026-04-04T17:03:12Z Tmagc 158167 6076562 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "e("..SEPSIL..")i", "ɐ%1i") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([eo])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export pkpyicdfynawmeuzlp3twhf3lkogkfz 6076563 6076562 2026-04-04T17:04:52Z Tmagc 158167 6076563 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "e("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "ej", "ɐj") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([eo])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export k4jv967mmdjz4awce8vljyg40v5ml3k 6076564 6076563 2026-04-04T17:07:02Z Tmagc 158167 6076564 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([eo])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export grfnwpai9u4ypy7e4b2wq2cq0ln2dq4 6076565 6076564 2026-04-04T17:11:13Z Tmagc 158167 6076565 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([eo])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export 3wxgyog3b92wdo6eh86qj1hkoc2u1qw 6076566 6076565 2026-04-04T17:25:45Z Tmagc 158167 6076566 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([eo])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export 9isroju9cq9nl64m3wik2lkm8hpsd8f 6076567 6076566 2026-04-04T17:27:40Z Tmagc 158167 6076567 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([eo])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export 5ew7reunv763onfrsk9vus5glperjx8 6076569 6076567 2026-04-04T17:37:09Z Tmagc 158167 6076569 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([eo])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])([^l])", function(x, y) local arr = {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}; return arr[x]..y end) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export ni9cy8opow672snar2cb5tviu12ja4u 6076570 6076569 2026-04-04T17:38:27Z Tmagc 158167 Se ha deshecho la revisión [[Special:Diff/6076569|6076569]] de [[Special:Contributions/Tmagc|Tmagc]] ([[User talk:Tmagc|disc.]]) 6076570 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([eo])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export 5ew7reunv763onfrsk9vus5glperjx8 6076571 6076570 2026-04-04T17:40:52Z Tmagc 158167 6076571 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([eo])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export fonpvu2z4pqv4s1katxdt4eig02kej6 6076572 6076571 2026-04-04T17:46:44Z Tmagc 158167 6076572 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export 2g7s1x4k5dsvfldj9btgzd98k6dmbai 6076574 6076572 2026-04-04T17:49:27Z Tmagc 158167 6076574 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export 95v88s1hsqpjcmc4ukomkrluxjd5408 6076575 6076574 2026-04-04T17:56:24Z Tmagc 158167 6076575 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export 2rcfvn088zgcum64xpgnhpl08go07ie 6076576 6076575 2026-04-04T17:58:28Z Tmagc 158167 6076576 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mn])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export 2c5j34yc7nizvivkse7bk8lagtk5k6l 6076578 6076576 2026-04-04T18:02:49Z Tmagc 158167 6076578 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeio])", function (p, q) return "w"..q end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export 9qr1r6eog492g0rp21t7ryzi6k8fw77 6076579 6076578 2026-04-04T18:05:18Z Tmagc 158167 6076579 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioãẽĩõáéíóàèìòâêîô])", function (p, q) return "w"..q end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export m5jsuzy3gwrfyupqy68temzrzkk7ncj 6076580 6076579 2026-04-04T18:11:35Z Tmagc 158167 6076580 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioãẽĩõáéíóàèìòâêîô])", function (p, q) return "w"..q end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export 1w0peke5wo2y35bta826odtty5jtz2n 6076581 6076580 2026-04-04T18:18:25Z Tmagc 158167 6076581 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüAⱯEƐAEIƗOƆÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxyzçBCDFGHJKLMNPQRSTVWXYZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioãẽĩõáéíóàèìòâêîô])", function (p, q) return "w"..q end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export oi607owayjvi8vxug02pz5o9ddowelt 6076582 6076581 2026-04-04T18:25:05Z Tmagc 158167 6076582 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuyāēōạẹọàèòäëïöüAⱯEƐAEIƗOƆYẠẸỌÀÈÒĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüyAⱯEƐAEIƗOƆYÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxzçBCDFGHJKLMNPQRSTVWXZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", ["y"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", ["y"] = "i", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioãẽĩõáéíóàèìòâêîô])", function (p, q) return "w"..q end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export 4x31srn3uotc5pxm8s1c00mu6bpd1gt 6076583 6076582 2026-04-04T18:32:54Z Tmagc 158167 6076583 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuyāēōạẹọàèìòùäëïöüAⱯEƐAEIƗOƆYẠẸỌÀÈÌÒÙĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüyAⱯEƐAEIƗOƆYÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxzçBCDFGHJKLMNPQRSTVWXZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", ["y"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ì"] = "i", ["ù"] = "u", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", ["y"] = "i", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioãẽĩõáéíóàèìòâêîô])", function (p, q) return "w"..q end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export f6eu548sdex9b0bjjk68q1maceeclmr 6076584 6076583 2026-04-04T18:38:28Z Tmagc 158167 6076584 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuyāēōạẹọàèìòùäëïöüAⱯEƐAEIƗOƆYẠẸỌÀÈÌÒÙĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüyAⱯEƐAEIƗOƆYÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxzçBCDFGHJKLMNPQRSTVWXZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", ["y"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ì"] = "i", ["ù"] = "u", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", ["y"] = "i", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["ã"] = "ã", ["ẽ"] = "ẽ", ["ĩ"] = "ĩ", ["õ"] = "õ", ["ũ"] = "ũ", ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..divsil.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..divsil.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..divsil..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..divsil.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioãẽĩõáéíóàèìòâêîô])", function (p, q) return "w"..q end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export 36tuabte8i0mnhfjmgcf1dt3dj1nka8 6076591 6076584 2026-04-04T21:14:10Z Tmagc 158167 6076591 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuyāēōạẹọàèìòùäëïöüAⱯEƐAEIƗOƆYẠẸỌÀÈÌÒÙĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüyAⱯEƐAEIƗOƆYÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxzçBCDFGHJKLMNPQRSTVWXZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", ["y"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ì"] = "i", ["ù"] = "u", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", ["y"] = "i", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["ã"] = "ã", ["ẽ"] = "ẽ", ["ĩ"] = "ĩ", ["õ"] = "õ", ["ũ"] = "ũ", ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..SEPSIL.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..SEPSIL.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..SEPSIL..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..SEPSIL.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioãẽĩõáéíóàèìòâêîô])", function (p, q) return "w"..q end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export 9zhgq2k28ez2wd5wdxs0nd3g359h4oh 6076592 6076591 2026-04-04T21:22:46Z Tmagc 158167 6076592 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuyāēōạẹọàèìòùäëïöüAⱯEƐAEIƗOƆYẠẸỌÀÈÌÒÙĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüyAⱯEƐAEIƗOƆYÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxzçBCDFGHJKLMNPQRSTVWXZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", ["y"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ì"] = "i", ["ù"] = "u", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", ["y"] = "i", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["ã"] = "ã", ["ẽ"] = "ẽ", ["ĩ"] = "ĩ", ["õ"] = "õ", ["ũ"] = "ũ", ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada -- p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([íÍuú])([hH]?"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..SEPSIL.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..SEPSIL.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..SEPSIL..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..SEPSIL.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioãẽĩõáéíóàèìòâêîô])", function (p, q) return "w"..q end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export cfftfxu09kzoq06ixkc816amgq2pjcs 6076593 6076592 2026-04-04T21:24:44Z Tmagc 158167 6076593 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuyāēōạẹọàèìòùäëïöüAⱯEƐAEIƗOƆYẠẸỌÀÈÌÒÙĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüyAⱯEƐAEIƗOƆYÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxzçBCDFGHJKLMNPQRSTVWXZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", ["y"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ì"] = "i", ["ù"] = "u", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", ["y"] = "i", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["ã"] = "ã", ["ẽ"] = "ẽ", ["ĩ"] = "ĩ", ["õ"] = "õ", ["ũ"] = "ũ", ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada -- p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([íÍúÚ])([hH]?"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..SEPSIL.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..SEPSIL.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..SEPSIL..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..SEPSIL.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eoEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioãẽĩõáéíóàèìòâêîô])", function (p, q) return "w"..q end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export 0z6xtir36miybhuyhjkjsbot2c9mplz 6076594 6076593 2026-04-04T21:26:21Z Tmagc 158167 6076594 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuyāēōạẹọàèìòùäëïöüAⱯEƐAEIƗOƆYẠẸỌÀÈÌÒÙĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüyAⱯEƐAEIƗOƆYÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxzçBCDFGHJKLMNPQRSTVWXZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", ["y"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ì"] = "i", ["ù"] = "u", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", ["y"] = "i", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["ã"] = "ã", ["ẽ"] = "ẽ", ["ĩ"] = "ĩ", ["õ"] = "õ", ["ũ"] = "ũ", ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada -- p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([íÍúÚ])([hH]?"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..SEPSIL.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..SEPSIL.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..SEPSIL..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..SEPSIL.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eêoEÊO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioãẽĩõáéíóàèìòâêîô])", function (p, q) return "w"..q end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export iybujvmo5bgwv4bh0mrko8ozbp1udrz 6076595 6076594 2026-04-04T21:29:34Z Tmagc 158167 6076595 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuyāēōạẹọàèìòùäëïöüAⱯEƐAEIƗOƆYẠẸỌÀÈÌÒÙĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüyAⱯEƐAEIƗOƆYÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxzçBCDFGHJKLMNPQRSTVWXZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", ["y"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ì"] = "i", ["ù"] = "u", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", ["y"] = "i", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["ã"] = "ã", ["ẽ"] = "ẽ", ["ĩ"] = "ĩ", ["õ"] = "õ", ["ũ"] = "ũ", ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada -- p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([íÍúÚ])([hH]?"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..SEPSIL.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..SEPSIL.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..SEPSIL..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..SEPSIL.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) return gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eêoEÊO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioãẽĩõáéíóàèìòâêîô])", function (p, q) return "w"..q end) -- iu text = gsub(text, "([iyĩíìî])([uũûúù])", function (p, q) return p.."w" end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export 9ki0vmrtprkvkr2x7vge5jq9czi1xoy 6076596 6076595 2026-04-04T21:36:58Z Tmagc 158167 6076596 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuyāēōạẹọàèìòùäëïöüAⱯEƐAEIƗOƆYẠẸỌÀÈÌÒÙĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüyAⱯEƐAEIƗOƆYÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxzçBCDFGHJKLMNPQRSTVWXZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", ["y"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ì"] = "i", ["ù"] = "u", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", ["y"] = "i", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["ã"] = "ã", ["ẽ"] = "ẽ", ["ĩ"] = "ĩ", ["õ"] = "õ", ["ũ"] = "ũ", ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada -- p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([íÍúÚ])([hH]?"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..SEPSIL.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..SEPSIL.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..SEPSIL..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..SEPSIL.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) local sust x, sust = gsub(x, "^("..CONS.."*)(i)(u?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) if sust > 0 then return x end x = gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) return x end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eêoEÊO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioãẽĩõáéíóàèìòâêîô])", function (p, q) return "w"..q end) -- iu text = gsub(text, "([iyĩíìî])([uũûúù])", function (p, q) return p.."w" end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export b96gde5mu11qblg60kz2le3440e44x3 6076597 6076596 2026-04-04T21:39:29Z Tmagc 158167 6076597 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuyāēōạẹọàèìòùäëïöüAⱯEƐAEIƗOƆYẠẸỌÀÈÌÒÙĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüyAⱯEƐAEIƗOƆYÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxzçBCDFGHJKLMNPQRSTVWXZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", ["y"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ì"] = "i", ["ù"] = "u", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", ["y"] = "i", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["ã"] = "ã", ["ẽ"] = "ẽ", ["ĩ"] = "ĩ", ["õ"] = "õ", ["ũ"] = "ũ", ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "("..VOCAL_NO_NASAL..")([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada -- p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([íÍúÚ])([hH]?"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..SEPSIL.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..SEPSIL.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..SEPSIL..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..SEPSIL.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) local sust x, sust = gsub(x, "^("..CONS.."*)(i)(u?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) if sust > 0 then return x end x = gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) return x end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eêoEÊO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioAEIOãẽĩõáéíóàèìòâêîô])", function (p, q) return "w"..q end) -- iu text = gsub(text, "([iIyĩíìî])([uũûúù])", function (p, q) return p.."w" end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export idtb48b9fp0dimkwa5genupvrxofka9 6076598 6076597 2026-04-04T21:49:44Z Tmagc 158167 6076598 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuyāēōạẹọàèìòùäëïöüAⱯEƐAEIƗOƆYẠẸỌÀÈÌÒÙĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüyAⱯEƐAEIƗOƆYÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxzçBCDFGHJKLMNPQRSTVWXZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", ["y"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ì"] = "i", ["ù"] = "u", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", ["y"] = "i", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["ã"] = "ã", ["ẽ"] = "ẽ", ["ĩ"] = "ĩ", ["õ"] = "õ", ["ũ"] = "ũ", ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "([aeoAEOáéóàèòâêô])([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal ABIERTA no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada -- p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([íÍúÚ])([hH]?"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..SEPSIL.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..SEPSIL.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..SEPSIL..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..SEPSIL.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) local sust x, sust = gsub(x, "^("..CONS.."*)(i)(u?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) if sust > 0 then return x end x = gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) return x end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eêoEÊO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioAEIOãẽĩõáéíóàèìòâêîô])", function (p, q) return "w"..q end) -- iu text = gsub(text, "([iIyĩíìî])([uũûúù])", function (p, q) return p.."w" end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export kfsves49jn2efcxw2npodd75kgpr550 6076599 6076598 2026-04-04T21:58:39Z Tmagc 158167 6076599 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuyāēōạẹọàèìòùäëïöüAⱯEƐAEIƗOƆYẠẸỌÀÈÌÒÙĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüyAⱯEƐAEIƗOƆYÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxzçBCDFGHJKLMNPQRSTVWXZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", ["y"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ì"] = "i", ["ù"] = "u", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", ["y"] = "i", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["ã"] = "ã", ["ẽ"] = "ẽ", ["ĩ"] = "ĩ", ["õ"] = "õ", ["ũ"] = "ũ", ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "([aeoAEOáéóàèòâêô])([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal ABIERTA no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada -- p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([íÍúÚ])([hH]?"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..SEPSIL.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..SEPSIL.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..SEPSIL..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..SEPSIL.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) local sust x, sust = gsub(x, "^("..CONS.."*)(i)(u?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) if sust > 0 then return x end x = gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) return x end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eéêoôóEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aáâA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioAEIOãẽĩõáéíóàèìòâêîô])", function (p, q) return "w"..q end) -- iu text = gsub(text, "([iIyĩíî])([uũûúù])", function (p, q) return p.."w" end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export 2hr5ygvbh45qkdcl3pjecdok8bpzfky 6076600 6076599 2026-04-04T22:04:03Z Tmagc 158167 6076600 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuyāēōạẹọàèìòùäëïöüAⱯEƐAEIƗOƆYẠẸỌÀÈÌÒÙĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüyAⱯEƐAEIƗOƆYÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxzçBCDFGHJKLMNPQRSTVWXZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", ["y"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ì"] = "i", ["ù"] = "u", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", ["y"] = "i", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["ã"] = "ã", ["ẽ"] = "ẽ", ["ĩ"] = "ĩ", ["õ"] = "õ", ["ũ"] = "ũ", ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "([aeoAEOáéóàèòâêô])([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal ABIERTA no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada -- p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([íÍúÚ])([hH]?"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..SEPSIL.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..SEPSIL.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..SEPSIL..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..SEPSIL.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) local sust x, sust = gsub(x, "^("..CONS.."*)(i)(u?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) if sust > 0 then return x end x = gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) return x end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iíìĩIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iíìĩIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iíìĩIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iíìĩIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eéêoôóEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aáâA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioAEIOãẽĩõáéíóàèìòâêîô])", function (p, q) return "w"..q end) -- iu text = gsub(text, "([iIyĩíî])([uũûúù])", function (p, q) return p.."w" end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export mu9kof3jprnbm1t46gbokdtv9vhcv3e 6076601 6076600 2026-04-04T22:07:29Z Tmagc 158167 6076601 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuyāēōạẹọàèìòùäëïöüAⱯEƐAEIƗOƆYẠẸỌÀÈÌÒÙĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüyAⱯEƐAEIƗOƆYÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxzçBCDFGHJKLMNPQRSTVWXZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", ["y"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ì"] = "i", ["ù"] = "u", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", ["y"] = "i", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["ã"] = "ã", ["ẽ"] = "ẽ", ["ĩ"] = "ĩ", ["õ"] = "õ", ["ũ"] = "ũ", ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "([aeoAEOáéóàèòâêô])([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal ABIERTA no nasal + [aeo] (excluyo ão, ãe, õe) -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada -- p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([íÍúÚ])([hH]?"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..SEPSIL.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..SEPSIL.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..SEPSIL..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..SEPSIL.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) local sust x, sust = gsub(x, "^("..CONS.."*)(i)(u?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) if sust > 0 then return x end x = gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) return x end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iíìĩIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iíìĩIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iíìĩIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iíìĩIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eéêoôóEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aáâA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioAEIOãẽĩõáéíóâêîô])", function (p, q) return "w"..q end) -- ia, ie, io text = gsub(text, "(i)([aeoAEOãẽõáéóâêô])", function (p, q) return "j"..q end) -- iu text = gsub(text, "([iIyĩíî])([uũûúù])", function (p, q) return p.."w" end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export crks2eyz3suo9iq9u16283y45nnrlhd 6076602 6076601 2026-04-04T22:16:23Z Tmagc 158167 6076602 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuyāēōạẹọàèìòùäëïöüAⱯEƐAEIƗOƆYẠẸỌÀÈÌÒÙĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüyAⱯEƐAEIƗOƆYÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxzçBCDFGHJKLMNPQRSTVWXZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", ["y"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ì"] = "i", ["ù"] = "u", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", ["y"] = "i", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["ã"] = "ã", ["ẽ"] = "ẽ", ["ĩ"] = "ĩ", ["õ"] = "õ", ["ũ"] = "ũ", ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "([aeoAEOáéóàèòâêô])([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal ABIERTA no nasal + [aeo] (excluyo ão, ãe, õe) p = gsubrep(p, "(õ)([hH]?[aoAOáóÁÓàòÀÒâôÂÔäöÄÖ])", "%1"..divsil.."%2") -- õa -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada -- p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([íÍúÚ])([hH]?"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..SEPSIL.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..SEPSIL.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..SEPSIL..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..SEPSIL.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) local sust x, sust = gsub(x, "^("..CONS.."*)(i)(u?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) if sust > 0 then return x end x = gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) return x end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iíìĩIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iíìĩIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iíìĩIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iíìĩIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eéêoôóEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aáâA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioAEIOãẽĩõáéíóâêîô])", function (p, q) return "w"..q end) -- ia, ie, io text = gsub(text, "(i)([aeoAEOãẽõáéóâêô])", function (p, q) return "j"..q end) -- iu text = gsub(text, "([iIyĩíî])([uũûúù])", function (p, q) return p.."w" end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export 1m7j190otg760tlj4bgm8ubfecez34b 6076603 6076602 2026-04-04T22:20:56Z Tmagc 158167 6076603 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuyāēōạẹọàèìòùäëïöüAⱯEƐAEIƗOƆYẠẸỌÀÈÌÒÙĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüyAⱯEƐAEIƗOƆYÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxzçBCDFGHJKLMNPQRSTVWXZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", ["y"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ì"] = "i", ["ù"] = "u", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", ["y"] = "i", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["ã"] = "ã", ["ẽ"] = "ẽ", ["ĩ"] = "ĩ", ["õ"] = "õ", ["ũ"] = "ũ", ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "([aeoAEOáéóàèòâêô])([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal ABIERTA no nasal + [aeo] (excluyo ão, ãe, õe) p = gsubrep(p, "([aeoAEOáéóàèòâêôẽẼ])([hH]?[aoAOáóÁÓàòÀÒâôÂÔäöÄÖãẽõÃẼÕ])", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEOáéóàèòâêôõÕ])([hH]?[aoAOáóÁÓàòÀÒâôÂÔäöÄÖãõÃÕ])", "%1"..divsil.."%2") -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada -- p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([íÍúÚ])([hH]?"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..SEPSIL.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..SEPSIL.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..SEPSIL..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..SEPSIL.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) local sust x, sust = gsub(x, "^("..CONS.."*)(i)(u?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) if sust > 0 then return x end x = gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) return x end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iíìĩIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iíìĩIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iíìĩIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iíìĩIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eéêoôóEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aáâA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioAEIOãẽĩõáéíóâêîô])", function (p, q) return "w"..q end) -- ia, ie, io text = gsub(text, "(i)([aeoAEOãẽõáéóâêô])", function (p, q) return "j"..q end) -- iu text = gsub(text, "([iIyĩíî])([uũûúù])", function (p, q) return p.."w" end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export mpbdfx9u4i5fhcp4t3cgdbpoddxmnrq 6076604 6076603 2026-04-04T22:25:26Z Tmagc 158167 6076604 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuyāēōạẹọàèìòùäëïöüAⱯEƐAEIƗOƆYẠẸỌÀÈÌÒÙĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüyAⱯEƐAEIƗOƆYÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxzçBCDFGHJKLMNPQRSTVWXZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["á"] = "â", ["é"] = "ê", ["ó"] = "ô", ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["ã"] = "â", ["ẽ"] = "ê", ["õ"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", ["y"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ì"] = "i", ["ù"] = "u", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", ["y"] = "i", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["ã"] = "ã", ["ẽ"] = "ẽ", ["ĩ"] = "ĩ", ["õ"] = "õ", ["ũ"] = "ũ", ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "([aeoAEOáéóàèòâêô])([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal ABIERTA no nasal + [aeo] (excluyo ão, ãe, õe) p = gsubrep(p, "([aeoAEOáéóàèòâêôẽẼ])([hH]?[aoAOáóÁÓàòÀÒâôÂÔäöÄÖãẽõÃẼÕ])", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEOáéóàèòâêôõÕ])([hH]?[aoAOáóÁÓàòÀÒâôÂÔäöÄÖãõÃÕ])", "%1"..divsil.."%2") -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada -- p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([íÍúÚ])([hH]?"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..SEPSIL.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..SEPSIL.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..SEPSIL..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..SEPSIL.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) local sust x, sust = gsub(x, "^("..CONS.."*)(i)(u?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) if sust > 0 then return x end x = gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) return x end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iíìĩIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iíìĩIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iíìĩIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iíìĩIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eéêoôóEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aáâA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioAEIOãẽĩõáéíóâêîô])", function (p, q) return "w"..q end) -- ia, ie, io text = gsub(text, "(i)([aeoAEOãẽõáéóâêô])", function (p, q) return "j"..q end) -- iu text = gsub(text, "([iIyĩíî])([uũûúù])", function (p, q) return p.."w" end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export j2520jqk8z18f2gmg26i4x6lron8cgd 6076605 6076604 2026-04-04T22:34:13Z Tmagc 158167 6076605 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuyāēōạẹọàèìòùäëïöüAⱯEƐAEIƗOƆYẠẸỌÀÈÌÒÙĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüyAⱯEƐAEIƗOƆYÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxzçBCDFGHJKLMNPQRSTVWXZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["á"] = "â", ["é"] = "ê", ["ó"] = "ô", ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["ã"] = "â", ["ẽ"] = "ê", ["õ"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", ["y"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ì"] = "i", ["ù"] = "u", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", ["y"] = "i", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["ã"] = "ã", ["ẽ"] = "ẽ", ["ĩ"] = "ĩ", ["õ"] = "õ", ["ũ"] = "ũ", ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "([aeoAEOáéóàèòâêô])([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal ABIERTA no nasal + [aeo] (excluyo ão, ãe, õe) p = gsubrep(p, "([aeoAEOáéóàèòâêôẽẼ])([hH]?[aoAOáóÁÓàòÀÒâôÂÔäöÄÖãẽõÃẼÕ])", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEOáéóàèòâêôõÕ])([hH]?[aoAOáóÁÓàòÀÒâôÂÔäöÄÖãõÃÕ])", "%1"..divsil.."%2") -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada -- p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([íÍúÚ])([hH]?"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..SEPSIL.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..SEPSIL.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..SEPSIL..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..SEPSIL.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) local sust x, sust = gsub(x, "^("..CONS.."*)(i)(u?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) if sust > 0 then return x end x = gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) return x end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iíìĩIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iíìĩIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iíìĩIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iíìĩIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eéèêoôóòEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aáàâA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioAEIOãẽĩõáéíóàèìòâêîô])", function (p, q) return "w"..q end) -- ia, ie, io text = gsub(text, "(i)([aeoAEOãẽõáéóàèòâêô])", function (p, q) return "j"..q end) -- iu text = gsub(text, "([iIyĩíî])([uũûúù])", function (p, q) return p.."w" end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export a8umqj30snn1z3fbolufiq8pdto5gil 6076606 6076605 2026-04-04T22:36:01Z Tmagc 158167 6076606 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuyāēōạẹọàèìòùäëïöüAⱯEƐAEIƗOƆYẠẸỌÀÈÌÒÙĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüyAⱯEƐAEIƗOƆYÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxzçBCDFGHJKLMNPQRSTVWXZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["á"] = "â", ["é"] = "ê", ["ó"] = "ô", ["à"] = "â", ["è"] = "ê", ["ò"] = "ô", ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["ã"] = "â", ["ẽ"] = "ê", ["õ"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", ["y"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ì"] = "i", ["ù"] = "u", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", ["y"] = "i", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["ã"] = "ã", ["ẽ"] = "ẽ", ["ĩ"] = "ĩ", ["õ"] = "õ", ["ũ"] = "ũ", ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "([aeoAEOáéóàèòâêô])([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal ABIERTA no nasal + [aeo] (excluyo ão, ãe, õe) p = gsubrep(p, "([aeoAEOáéóàèòâêôẽẼ])([hH]?[aoAOáóÁÓàòÀÒâôÂÔäöÄÖãẽõÃẼÕ])", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEOáéóàèòâêôõÕ])([hH]?[aoAOáóÁÓàòÀÒâôÂÔäöÄÖãõÃÕ])", "%1"..divsil.."%2") -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada -- p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([íÍúÚ])([hH]?"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..SEPSIL.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..SEPSIL.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..SEPSIL..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..SEPSIL.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h?[iuIUíúÍÚ]h?"..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) local sust x, sust = gsub(x, "^("..CONS.."*)(i)(u?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) if sust > 0 then return x end x = gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) return x end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iíìĩIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iíìĩIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iíìĩIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iíìĩIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eéèêoôóòEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aáàâA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioAEIOãẽĩõáéíóàèìòâêîô])", function (p, q) return "w"..q end) -- ia, ie, io text = gsub(text, "(i)([aeoAEOãẽõáéóàèòâêô])", function (p, q) return "j"..q end) -- iu text = gsub(text, "([iIyĩíî])([uũûúù])", function (p, q) return p.."w" end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export frvqj23tcjvpmr1wfdteadv3xl0gu5e 6076607 6076606 2026-04-04T22:38:46Z Tmagc 158167 6076607 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuyāēōạẹọàèìòùäëïöüAⱯEƐAEIƗOƆYẠẸỌÀÈÌÒÙĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüyAⱯEƐAEIƗOƆYÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxzçBCDFGHJKLMNPQRSTVWXZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["á"] = "â", ["é"] = "ê", ["ó"] = "ô", ["à"] = "â", ["è"] = "ê", ["ò"] = "ô", ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["ã"] = "â", ["ẽ"] = "ê", ["õ"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", ["y"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ì"] = "i", ["ù"] = "u", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", ["y"] = "i", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["ã"] = "ã", ["ẽ"] = "ẽ", ["ĩ"] = "ĩ", ["õ"] = "õ", ["ũ"] = "ũ", ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "([aeoAEOáéóàèòâêô])([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal ABIERTA no nasal + [aeo] (excluyo ão, ãe, õe) p = gsubrep(p, "([aeoAEOáéóàèòâêôẽẼ])([hH]?[aoAOáóÁÓàòÀÒâôÂÔäöÄÖãẽõÃẼÕ])", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEOáéóàèòâêôõÕ])([hH]?[aoAOáóÁÓàòÀÒâôÂÔäöÄÖãõÃÕ])", "%1"..divsil.."%2") -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada -- p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([íÍúÚ])([hH]?"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..SEPSIL.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..SEPSIL.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..SEPSIL..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..SEPSIL.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h[iuIUíúÍÚ]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)("..VOCAL..")", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) local sust x, sust = gsub(x, "^("..CONS.."*)(i)(u?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) if sust > 0 then return x end x = gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) return x end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iíìĩIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iíìĩIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iíìĩIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iíìĩIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eéèêoôóòEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aáàâA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioAEIOãẽĩõáéíóàèìòâêîô])", function (p, q) return "w"..q end) -- ia, ie, io text = gsub(text, "(i)([aeoAEOãẽõáéóàèòâêô])", function (p, q) return "j"..q end) -- iu text = gsub(text, "([iIyĩíî])([uũûúù])", function (p, q) return p.."w" end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export j1pqcwjqxzfvxqau5g2hw21yaex3t5o 6076608 6076607 2026-04-04T22:41:53Z Tmagc 158167 6076608 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuyāēōạẹọàèìòùäëïöüAⱯEƐAEIƗOƆYẠẸỌÀÈÌÒÙĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüyAⱯEƐAEIƗOƆYÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxzçBCDFGHJKLMNPQRSTVWXZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["á"] = "â", ["é"] = "ê", ["ó"] = "ô", ["à"] = "â", ["è"] = "ê", ["ò"] = "ô", ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["ã"] = "â", ["ẽ"] = "ê", ["õ"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", ["y"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ì"] = "i", ["ù"] = "u", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", ["y"] = "i", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["ã"] = "ã", ["ẽ"] = "ẽ", ["ĩ"] = "ĩ", ["õ"] = "õ", ["ũ"] = "ũ", ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "([aeoAEOáéóàèòâêô])([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal ABIERTA no nasal + [aeo] (excluyo ão, ãe, õe) p = gsubrep(p, "([aeoAEOáéóàèòâêôẽẼ])([hH]?[aoAOáóÁÓàòÀÒâôÂÔäöÄÖãẽõÃẼÕ])", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEOáéóàèòâêôõÕ])([hH]?[aoAOáóÁÓàòÀÒâôÂÔäöÄÖãõÃÕ])", "%1"..divsil.."%2") -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada -- p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([íÍúÚ])([hH]?"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..SEPSIL.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..SEPSIL.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..SEPSIL..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..SEPSIL.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "([iuIUíúÍÚ]?"..VOCAL.."[iuIUíúÍÚ]?)(h[iuIUíúÍÚ]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIUíúÍÚ]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ][iuIUíúÍÚ]?)([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) local sust x, sust = gsub(x, "^("..CONS.."*)(i)(u?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) if sust > 0 then return x end x = gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) return x end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iíìĩIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iíìĩIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iíìĩIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iíìĩIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eéèêoôóòEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aáàâA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioAEIOãẽĩõáéíóàèìòâêîô])", function (p, q) return "w"..q end) -- ia, ie, io text = gsub(text, "(i)([aeoAEOãẽõáéóàèòâêô])", function (p, q) return "j"..q end) -- iu text = gsub(text, "([iIyĩíî])([uũûúù])", function (p, q) return p.."w" end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export tp2zf1w68cypq9599n4wjv0r4xu6zgo 6076609 6076608 2026-04-04T22:43:58Z Tmagc 158167 6076609 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuyāēōạẹọàèìòùäëïöüAⱯEƐAEIƗOƆYẠẸỌÀÈÌÒÙĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüyAⱯEƐAEIƗOƆYÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxzçBCDFGHJKLMNPQRSTVWXZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["á"] = "â", ["é"] = "ê", ["ó"] = "ô", ["à"] = "â", ["è"] = "ê", ["ò"] = "ô", ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["ã"] = "â", ["ẽ"] = "ê", ["õ"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", ["y"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ì"] = "i", ["ù"] = "u", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", ["y"] = "i", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["ã"] = "ã", ["ẽ"] = "ẽ", ["ĩ"] = "ĩ", ["õ"] = "õ", ["ũ"] = "ũ", ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "([aeoAEOáéóàèòâêô])([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal ABIERTA no nasal + [aeo] (excluyo ão, ãe, õe) p = gsubrep(p, "([aeoAEOáéóàèòâêôẽẼ])([hH]?[aoAOáóÁÓàòÀÒâôÂÔäöÄÖãẽõÃẼÕ])", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEOáéóàèòâêôõÕ])([hH]?[aoAOáóÁÓàòÀÒâôÂÔäöÄÖãõÃÕ])", "%1"..divsil.."%2") -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada -- p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([íÍúÚ])([hH]?"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..SEPSIL.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..SEPSIL.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..SEPSIL..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..SEPSIL.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "("..VOCAL.."[iuIUíúÍÚ])(h?[iuIUíúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ][iuIUíúÍÚ]?)(h?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) local sust x, sust = gsub(x, "^("..CONS.."*)(i)(u?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) if sust > 0 then return x end x = gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) return x end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iíìĩIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iíìĩIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iíìĩIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iíìĩIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eéèêoôóòEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aáàâA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioAEIOãẽĩõáéíóàèìòâêîô])", function (p, q) return "w"..q end) -- ia, ie, io text = gsub(text, "(i)([aeoAEOãẽõáéóàèòâêô])", function (p, q) return "j"..q end) -- iu text = gsub(text, "([iIyĩíî])([uũûúù])", function (p, q) return p.."w" end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export ozrfp4j8cetwtbqwwfppxy5lnxdx6vh 6076610 6076609 2026-04-04T22:45:09Z Tmagc 158167 6076610 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuyāēōạẹọàèìòùäëïöüAⱯEƐAEIƗOƆYẠẸỌÀÈÌÒÙĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüyAⱯEƐAEIƗOƆYÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxzçBCDFGHJKLMNPQRSTVWXZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["á"] = "â", ["é"] = "ê", ["ó"] = "ô", ["à"] = "â", ["è"] = "ê", ["ò"] = "ô", ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["ã"] = "â", ["ẽ"] = "ê", ["õ"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", ["y"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ì"] = "i", ["ù"] = "u", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", ["y"] = "i", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["ã"] = "ã", ["ẽ"] = "ẽ", ["ĩ"] = "ĩ", ["õ"] = "õ", ["ũ"] = "ũ", ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "([aeoAEOáéóàèòâêô])([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal ABIERTA no nasal + [aeo] (excluyo ão, ãe, õe) p = gsubrep(p, "([aeoAEOáéóàèòâêôẽẼ])([hH]?[aoAOáóÁÓàòÀÒâôÂÔäöÄÖãẽõÃẼÕ])", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEOáéóàèòâêôõÕ])([hH]?[aoAOáóÁÓàòÀÒâôÂÔäöÄÖãõÃÕ])", "%1"..divsil.."%2") -- p = gsubrep(p, "("..VOCAL..")([hH]?"..VOCAL_TILDADA..")", "%1"..divsil.."%2") -- vocal + vocal tildada -- p = gsubrep(p, "("..VOCAL_TILDADA..")([hH]?"..VOCAL..")", "%1"..divsil.."%2") -- vocal tildada + vocal p = gsubrep(p, "([íÍúÚ])([hH]?"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..SEPSIL.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..SEPSIL.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..SEPSIL..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..SEPSIL.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "("..VOCAL..")(h?[iuIUíúÍÚ][iuIUíúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ][iuIUíúÍÚ]?)(h?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) local sust x, sust = gsub(x, "^("..CONS.."*)(i)(u?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) if sust > 0 then return x end x = gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) return x end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iíìĩIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iíìĩIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iíìĩIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iíìĩIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eéèêoôóòEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aáàâA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioAEIOãẽĩõáéíóàèìòâêîô])", function (p, q) return "w"..q end) -- ia, ie, io text = gsub(text, "(i)([aeoAEOãẽõáéóàèòâêô])", function (p, q) return "j"..q end) -- iu text = gsub(text, "([iIyĩíî])([uũûúù])", function (p, q) return p.."w" end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export dofm9kpyj6bfe6os2hh3pojlg93i9bv 6076611 6076610 2026-04-04T22:49:36Z Tmagc 158167 6076611 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuyāēōạẹọàèìòùäëïöüAⱯEƐAEIƗOƆYẠẸỌÀÈÌÒÙĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüyAⱯEƐAEIƗOƆYÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxzçBCDFGHJKLMNPQRSTVWXZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["á"] = "â", ["é"] = "ê", ["ó"] = "ô", ["à"] = "â", ["è"] = "ê", ["ò"] = "ô", ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["ã"] = "â", ["ẽ"] = "ê", ["õ"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", ["y"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ì"] = "i", ["ù"] = "u", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", ["y"] = "i", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["ã"] = "ã", ["ẽ"] = "ẽ", ["ĩ"] = "ĩ", ["õ"] = "õ", ["ũ"] = "ũ", ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "([aeoAEOáéóàèòâêô])([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal ABIERTA no nasal + [aeo] (excluyo ão, ãe, õe) p = gsubrep(p, "([aeoAEOáéóàèòâêôẽẼ])([hH]?[aoAOáóÁÓàòÀÒâôÂÔäöÄÖãẽõÃẼÕ])", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEOáéóàèòâêôõÕ])([hH]?[aoAOáóÁÓàòÀÒâôÂÔäöÄÖãõÃÕ])", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[íúÍÚ])", "%1"..divsil.."%2") -- vocal abierta + vocal cerrada tildada p = gsubrep(p, "([íÍúÚ])([hH]?"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..SEPSIL.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..SEPSIL.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..SEPSIL..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..SEPSIL.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "("..VOCAL..")(h?[iuIUíúÍÚ][iuIUíúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ][iuIUíúÍÚ]?)(h?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) local sust x, sust = gsub(x, "^("..CONS.."*)(i)(u?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) if sust > 0 then return x end x = gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) return x end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iíìĩIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iíìĩIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iíìĩIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iíìĩIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eéèêoôóòEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aáàâA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioAEIOãẽĩõáéíóàèìòâêîô])", function (p, q) return "w"..q end) -- ia, ie, io text = gsub(text, "(i)([aeoAEOãẽõáéóàèòâêô])", function (p, q) return "j"..q end) -- iu text = gsub(text, "([iIyĩíî])([uũûúù])", function (p, q) return p.."w" end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export cq63nz00akgk8ai6gw7y5szc5xphryi 6076612 6076611 2026-04-04T22:51:51Z Tmagc 158167 6076612 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuyāēōạẹọàèìòùäëïöüAⱯEƐAEIƗOƆYẠẸỌÀÈÌÒÙĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüyAⱯEƐAEIƗOƆYÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxzçBCDFGHJKLMNPQRSTVWXZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["á"] = "â", ["é"] = "ê", ["ó"] = "ô", ["à"] = "â", ["è"] = "ê", ["ò"] = "ô", ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["ã"] = "â", ["ẽ"] = "ê", ["õ"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", ["y"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ì"] = "i", ["ù"] = "u", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", ["y"] = "i", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["ã"] = "ã", ["ẽ"] = "ẽ", ["ĩ"] = "ĩ", ["õ"] = "õ", ["ũ"] = "ũ", ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "([aeoAEOáéóàèòâêô])([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal ABIERTA no nasal + [aeo] (excluyo ão, ãe, õe) p = gsubrep(p, "([aeoAEOáéóàèòâêôẽẼ])([hH]?[aoAOáóÁÓàòÀÒâôÂÔäöÄÖãẽõÃẼÕ])", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEOáéóàèòâêôõÕ])([hH]?[aoAOáóÁÓàòÀÒâôÂÔäöÄÖãõÃÕ])", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[íúÍÚ])", "%1"..divsil.."%2") -- vocal abierta + vocal cerrada tildada p = gsubrep(p, "([íÍúÚ])([hH]?"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..SEPSIL.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..SEPSIL.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..SEPSIL..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..SEPSIL.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "("..VOCAL..")(h?[iuIUíúÍÚ][iuIUíúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ][iuIUíúÍÚ]?)(h?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) local sust x, sust = gsub(x, "^("..CONS.."*)(i)(u?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) if sust > 0 then return x end x = gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) return x end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh, dj text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") text = gsub(text, "dj", "ʤ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iíìĩIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iíìĩIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iíìĩIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iíìĩIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jɛ") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eéèêoôóòEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aáàâA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioAEIOãẽĩõáéíóàèìòâêîô])", function (p, q) return "w"..q end) -- ia, ie, io text = gsub(text, "(i)([aeoAEOãẽõáéóàèòâêô])", function (p, q) return "j"..q end) -- iu text = gsub(text, "([iIyĩíî])([uũûúù])", function (p, q) return p.."w" end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export mgsuq0ovwpkufw6j8e7z4pzqwaaiufa 6076614 6076612 2026-04-04T23:03:15Z Tmagc 158167 6076614 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuyāēōạẹọàèìòùäëïöüAⱯEƐAEIƗOƆYẠẸỌÀÈÌÒÙĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüyAⱯEƐAEIƗOƆYÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxzçBCDFGHJKLMNPQRSTVWXZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["á"] = "â", ["é"] = "ê", ["ó"] = "ô", ["à"] = "â", ["è"] = "ê", ["ò"] = "ô", ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["ã"] = "â", ["ẽ"] = "ê", ["õ"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", ["y"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ì"] = "i", ["ù"] = "u", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", ["y"] = "i", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["ã"] = "ã", ["ẽ"] = "ẽ", ["ĩ"] = "ĩ", ["õ"] = "õ", ["ũ"] = "ũ", ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "([aeoAEOáéóàèòâêô])([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal ABIERTA no nasal + [aeo] (excluyo ão, ãe, õe) p = gsubrep(p, "([aeoAEOáéóàèòâêôẽẼ])([hH]?[aoAOáóÁÓàòÀÒâôÂÔäöÄÖãẽõÃẼÕ])", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEOáéóàèòâêôõÕ])([hH]?[aoAOáóÁÓàòÀÒâôÂÔäöÄÖãõÃÕ])", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[íúÍÚ])", "%1"..divsil.."%2") -- vocal abierta + vocal cerrada tildada p = gsubrep(p, "([íÍúÚ])([hH]?"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..SEPSIL.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..SEPSIL.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..SEPSIL..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..SEPSIL.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "("..VOCAL..")(h?[iuIUíúÍÚ][iuIUíúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ][iuIUíúÍÚ]?)(h?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) local sust x, sust = gsub(x, "^("..CONS.."*)(i)(u?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) if sust > 0 then return x end x = gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) return x end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh, dj text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") text = gsub(text, "dj", "ʤ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."x", "ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iíìĩIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iíìĩIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iíìĩIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iíìĩIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jé") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eéèêoôóòEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aáàâA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioAEIOãẽĩõáéíóàèìòâêîô])", function (p, q) return "w"..q end) -- ia, ie, io text = gsub(text, "(i)([aeoAEOãẽõáéóàèòâêô])", function (p, q) return "j"..q end) -- iu text = gsub(text, "([iIyĩíî])([uũûúù])", function (p, q) return p.."w" end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export 9m4s4yo6wxhge65ngc7mah00eikac7u 6076615 6076614 2026-04-04T23:12:33Z Tmagc 158167 6076615 Scribunto text/plain -- PRONUNCIACION PARA EL PORTUGUES -- Reimplementado desde cero por Tmagc local export = {} local insert = table.insert local concat = table.concat local m_table = require("Módulo:tabla") local list_to_set = m_table.listToSet local keys_to_list = m_table.keysToList local m_str = require("Módulo:string") local u = m_str.char local find = m_str.find local gmatch = m_str.gmatch local gsub = m_str.gsub local gsubb = m_str.gsubb local gsubrep = m_str.gsubrep local upper = m_str.upper local split = m_str.split local encodehtml = m_str.encodehtml local m_pron = require("Módulo:generar-pron") local normalizar = m_pron.normalizar local longitud_silabica = m_pron.longitud_silabica local acentuacion = m_pron.acentuacion local rima = m_pron.rima local sombra = m_pron.sombra local ac_primario = u(0x02C8) local ac_secundario = u(0x02CC) local acentos_ipa = ac_primario..ac_secundario local divsil = "-" local sepsil = "%."..acentos_ipa.."%"..divsil local separador = "%s"..sepsil local TEMP_GU = u(0xFFFA) local TEMP_QU = u(0xFFFB) local TEMP_GUD = u(0xFFFC) local TEMP_QUD = u(0xFFFD) local ACENTOS_IPA = "[" .. acentos_ipa .. "]" local SEPSIL = "[" .. sepsil .. "]" local SEPARADOR = "[" .. separador .. "]" local FIN_PALABRA = "%f[%s%z]" local INICIO_PALABRA = "%f[^%s%z]" local FIN_SILABA = "%f[%s%z"..separador.."]" local INICIO_SILABA = "%f[^%s%z"..separador.."]" local vocal_no_tilde = "aɐeɛiɨoɔuyāēōạẹọàèìòùäëïöüAⱯEƐAEIƗOƆYẠẸỌÀÈÌÒÙĀĒŌÄËÏÖÜ" local vocal_tilde = "áéíóúýâêôÁÉÍÓÚÝÂÊÔ" local vocal_acentuada = vocal_tilde.."AEIOU" local vocal_nasal = "ãẽĩõũÃẼĨÕŨ" local vocal_no_nasal = "aɐeɛiɨoɔuüyAⱯEƐAEIƗOƆYÜáéíóúàèìòùýỳâêôÁÉÍÓÚÀÈÌÒÙÝỲÂÊÔ" local vocales = vocal_no_tilde..vocal_tilde..vocal_nasal local cons = "bcdfghjklmnpqrstvwxzçBCDFGHJKLMNPQRSTVWXZÇ" local VOCAL = "["..vocales.."]" local VOCAL_NASAL = "["..vocal_nasal.."]" local VOCAL_NO_NASAL = "["..vocal_no_nasal.."]" local VOCAL_TILDADA = "["..vocal_tilde.."]" local VOCAL_ACENTUADA = "["..vocal_acentuada.."]" local CONS = "[^" .. vocales .. separador .. "]" local CONS_SALVO_H = "[^" .. vocales .. separador .. "hH]" local CONS_SALVO_R = "[^" .. vocales .. separador .. "rR]" local CONS_SALVO_MN = "[^" .. vocales .. separador .. "mMnN]" local SONORA = "[bdglʎmnɲŋrɾʁvzjʒʤ]" local LETRA = "[^" .. separador .. "]" -- Unstressed words with vowel reduction in Brazil and Portugal. local unstressed_words = list_to_set({ "o", "os", -- definite articles "me", "te", "se", "lhe", "lhes", "nos", "vos", -- unstressed object pronouns -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "mo", "mos", "to", "tos", "lho", "lhos", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "lo", "los", "no", -- [[nos]] above as object pronoun -- Allomorphs of object pronouns before other pronouns "vo", -- [[no]] above as allomorph of article "que", -- subordinating conjunctions "e", -- coordinating conjunctions "de", "do", "dos", "por", -- basic prepositions + combinations with articles; [[no]], [[nos]] above already -- FIXME: Portugal pronun for pelos, pela, pelas given as if spelled pêlos, etc. with stress, but differently for pelo. -- I am assuming the Portugal pronuns with stress are wrong. "pelo", "pelos", "pela", "pelas" -- preposition + article combinations }) -- Unstressed words with vowel reduction in Portugal only. local unstressed_full_vowel_words_brazil = list_to_set({ "a", "as", -- definite articles -- See https://en.wikipedia.org/wiki/Personal_notaouns_in_Portuguese#Contractions_between_clitic_notaouns "ma", "mas", "ta", "tas", "lha", "lhas", -- object pronouns combined with articles -- Allomorphs of articles after certain consonants "la", "las", "na", "nas", "da", "das", -- basic prepositions + combinations with articles; [[na]], [[nas]] above already -- coordinating conjunctions; [[mas]] above already "para", "pra", -- preposition; for the verb form use "pára" instead }) -- Unstressed words without vowel reduction. local unstressed_full_vowel_words = list_to_set({ "um", "uns", -- single-syllable indefinite articles "meu", "teu", "seu", "meus", "teus", "seus", -- single-syllable possessives "ou", -- coordinating conjunctions -- Note that in order to match à and às we have to write them as below because at the point we are trying to -- match them, all text has been converted to canonical decomposed Unicode form. Writing "à" and "às" directly -- won't work even if you type in the text using decomposed Unicode characters because all page contents are -- automatically converted to canonical composed form when saved. "ao", "aos", "à", "às", -- basic prepositions + combinations with articles "em", "com", -- other prepositions }) local abrir_vocal = { ["á"] = "á", ["é"] = "é", ["ó"] = "ó", ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["a"] = "á", ["e"] = "é", ["o"] = "ó", ["ã"] = "á", ["ẽ"] = "é", ["õ"] = "ó", ["A"] = "á", ["E"] = "é", ["O"] = "ó" } local cerrar_vocal = { ["á"] = "â", ["é"] = "ê", ["ó"] = "ô", ["à"] = "â", ["è"] = "ê", ["ò"] = "ô", ["â"] = "â", ["ê"] = "ê", ["ô"] = "ô", ["a"] = "â", ["e"] = "ê", ["o"] = "ô", ["ã"] = "â", ["ẽ"] = "ê", ["õ"] = "ô", ["A"] = "â", ["E"] = "ê", ["O"] = "ô" } local semivocal = { ["i"] = "j", ["u"] = "w", ["j"] = "j", ["w"] = "w", ["o"] = "w", ["e"] = "j", ["y"] = "j", } local convertir_vocales_br = { ["à"] = "a", ["è"] = "e", ["ò"] = "o", ["ì"] = "i", ["ù"] = "u", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "a", ["ē"] = "e", ["ō"] = "o", } local convertir_vocales_pt = { ["à"] = "á", ["è"] = "é", ["ò"] = "ó", ["ì"] = "í", ["ù"] = "ú", ["ä"] = "á", ["ë"] = "é", ["ö"] = "ó", ["ạ"] = "á", ["ẹ"] = "é", ["ọ"] = "ó", ["ā"] = "â", ["ē"] = "ê", ["ō"] = "ô", } local convertir_vocales_final = { ["á"] = "a", ["é"] = "ɛ", ["ó"] = "ɔ", ["í"] = "i", ["ú"] = "u", ["â"] = "ɐ", ["ê"] = "e", ["ô"] = "o", ["y"] = "i", } local sibilante = {["s"] = "ʃ", ["z"] = "j"} local nasalizar = { ["ã"] = "ã", ["ẽ"] = "ẽ", ["ĩ"] = "ĩ", ["õ"] = "õ", ["ũ"] = "ũ", ["a"] = "ã", ["e"] = "ẽ", ["i"] = "ĩ", ["o"] = "õ", ["u"] = "ũ", ["A"] = "ã", ["E"] = "ẽ", ["I"] = "ĩ", ["O"] = "õ", ["U"] = "ũ", ["á"] = "ã", ["é"] = "ẽ", ["í"] = "ĩ", ["ó"] = "õ", ["ú"] = "ũ", ["à"] = "ã", ["è"] = "ẽ", ["ì"] = "ĩ", ["ò"] = "õ", ["ù"] = "ũ", ["ä"] = "ã", ["ë"] = "ẽ", ["ö"] = "õ", ["ạ"] = "ã", ["ẹ"] = "ẽ", ["ọ"] = "õ", ["ā"] = "ã", ["ē"] = "ẽ", ["ō"] = "õ", ["â"] = "ã", ["ê"] = "ẽ", ["ô"] = "õ", ["ɐ"] = "ɐ̃", ["j"] = "j̃", ["w"] = "w̃" } -- el alfabeto local pron_abc = {{"a"},{"bê"},{"cê"},{"dê"},{"e"},{"efe"},{"gê"},{"agá"},{"i"}, {"jota"},{"cá"},{"ele"},{"eme"},{"ene"},{"o"},{"pê"},{"quê"},{"erre"},{"esse"},{"tê"},{"u"}, {"vê"},{"dáblio"},{"chis"},{"ípsilon"},{"zê"}} local function silabear(p) -- separo grupos dobles y triples, salvo diptongos -- Juntar consonantes fricativas y oclusivas con l y con r. A ecepción de dl. p = gsubrep(p, "("..LETRA..")([pbfvkctgPBFVKCTG][hH]?[lrLR]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([d][hH]?[rR]"..VOCAL..")", "%1"..divsil.."%2") -- swing, switch, etc. p = gsubrep(p, "("..LETRA..")([sS][wW]"..VOCAL..")", "%1"..divsil.."%2") -- separo desh (des-hielo, des-huesar, des-honra), y por si acaso tras (tras-humar), pos p = gsub(p, "(d[ei]s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(tran?s)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(post?)([hH]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "(plus)([hH]"..VOCAL..")", "%1"..divsil.."%2") -- separo prefijos con r p = gsub(p, "(hiper)([rR])", "%1"..divsil.."%2") p = gsub(p, "(ciber)([rR])", "%1"..divsil.."%2") p = gsub(p, "(inte)([rR][rR]og)", "%1"..divsil.."%2") -- interrogar y derivados p = gsub(p, "(inte)([rR][rR][ou]m?p)", "%1"..divsil.."%2") -- interrumpir y derivados p = gsub(p, "(inter)([rR])", "%1"..divsil.."%2") p = gsub(p, "(super)([rR])", "%1"..divsil.."%2") p = gsub(p, "(alter)([rR])", "%1"..divsil.."%2") -- más prefijos con h (para evitar que se unan en diptongo con la vocal anterior) p = gsub(p, "(" .. VOCAL .. ")(hidr)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hisp)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hex)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(he[cp]t)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hetero)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hemi)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(homo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hipo)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hiper)", "%1"..divsil.."%2") p = gsub(p, "(" .. VOCAL .. ")(hecto)", "%1"..divsil.."%2") -- Juntar ch, sh, zh, ph, th, dh, fh, kh or gh. NO Juntar bh (subhumano, subhúmedo) p = gsubrep(p, "("..LETRA..")([cszptdfkgCSZPTDFKG][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar las ll (lh) y rr p = gsubrep(p, "("..LETRA..")([lL][lLhH]"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "("..LETRA..")([rR][rR]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar nh, mh p = gsubrep(p, "("..LETRA..")([mMnN][hH]"..VOCAL..")", "%1"..divsil.."%2") -- Juntar gue, gui, que, qui p = gsubrep(p, "("..LETRA..")([gGqQ][uUüÜ][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto ck (no junto kc) p = gsubrep(p, "("..LETRA..")([cC][kK]"..VOCAL..")", "%1"..divsil.."%2") -- cc, como en [[occitano]], [[acceso]] p = gsubrep(p, "("..LETRA.."[cC])([cC][eEiIéÉíÍèÈìÌêÊîÎ])", "%1"..divsil.."%2") -- Junto consonantes dobles, salvo nn, bb, mm y ss p = gsubrep(p, "("..LETRA..")("..CONS..")%2("..VOCAL..")", function (x, c, v) return (c == "n" or c == "b" or c == "m" or c == "s") and x..c..divsil..c..v or x..divsil..c..c..v end) -- juntar pt, ct, cn, ps, mn, gn, ft, pn, cz, tz, ts cuando están precedidos por otra consonante -- empiezo con la y, puesto que fue definida como vocal pero no lo es en estos casos particulares p = gsubrep(p, "(" .. VOCAL .. "y*)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(y" .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPcCfF][tT]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCmMgGpP][nN]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([pPtT][sS]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([cCtT][zZ]"..VOCAL..")", "%1"..divsil.."%2") p = gsub(p, "("..CONS..")([mMnN]"..CONS..VOCAL..")", "%1"..divsil.."%2") -- separo V-CV, VC-CV p = gsubrep(p, "(" .. VOCAL .. ")(" .. CONS_SALVO_H .. VOCAL .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEO])(" .. CONS .. VOCAL_TILDADA .. ")", "%1"..divsil.."%2") p = gsubrep(p, "([iuIU])(" .. CONS .. "[íúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "(" .. VOCAL .. CONS .. "+)(" .. CONS .. VOCAL .. ")", "%1"..divsil.."%2") p = gsub(p, "[gG][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GU.."%1") p = gsub(p, "[qQ][uU]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QU.."%1") p = gsub(p, "[gG][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_GUD.."%1") p = gsub(p, "[qQ][üÜ]([eEiIéÉíÍèÈìÌêÊîÎëËïÏ])", TEMP_QUD.."%1") -- separo hiatos, salvo en los siguientes casos: -- 1. [aeo] + i/u no acentuada seguida de consonantes distintas de nh o de m/n/r/l+C, o cuando no está a final de palabra -- ([[saiba]], [[peixe]], [[noite]], [[Paulo]], [[deusa]], [[ouro]], PERO Bom.ba.im, ra.i.nha, Co.im.bra, sa.ir, but Jai.me, -- a.mai.nar, bai.le, ai.ro.so, quei.mar, bei.ra -- 2. iu o ui, cuando está en la última sílaba: fui, Rui, a.zuis, pa.riu, viu, sa.iu; -- 3. i + vocal a comienzo de palabra [[Iasmin]] -- 4. ão, ãe, õe p = gsubrep(p, "([aeoAEOáéóàèòâêô])([hH]?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- vocal ABIERTA no nasal + [aeo] (excluyo ão, ãe, õe) p = gsubrep(p, "([aeoAEOáéóàèòâêôẽẼ])([hH]?[aoAOáóÁÓàòÀÒâôÂÔäöÄÖãẽõÃẼÕ])", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEOáéóàèòâêôõÕ])([hH]?[aoAOáóÁÓàòÀÒâôÂÔäöÄÖãõÃÕ])", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[íúÍÚ])", "%1"..divsil.."%2") -- vocal abierta + vocal cerrada tildada p = gsubrep(p, "([íÍúÚ])([hH]?"..VOCAL..")", "%1"..divsil.."%2") p = gsubrep(p, "([iI])([hH]?[iI])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos íes consecutivas p = gsubrep(p, "([uU])([hH]?[uU])"..FIN_PALABRA, "%1"..divsil.."%2") -- dos úes consecutivas p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU]"..SEPSIL.."?[nN][hH])", "%1"..divsil.."%2") -- abierta + cerrada seguida de nh (ra-i-nha) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL]"..SEPSIL.."?"..CONS..")", "%1"..divsil.."%2") -- A + C segunda de [mnrl] + C (co-im-bra, pero bai-le, Jai-me) p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])([hH]?[iuIU][mMnNrRlL])"..FIN_PALABRA, "%1"..divsil.."%2") -- A + C seguida de [mnrl] a final de palabra (sa-ir, Bom-ba-im) p = gsubrep(p, "([iuIU])([hH]?[iuIU]"..CONS.."*"..SEPSIL..")", "%1"..divsil.."%2") -- iu/ui cuando NO está en la última sílaba (excluyo: fui, a-zuis, pa-riu, sa-iu) p = gsub(p, INICIO_PALABRA.."([iI])"..SEPSIL.."("..VOCAL..")", "%1%2") -- separo diptongos o triptongos consecutivos (en los raros casos en donde haya) p = gsubrep(p, "("..VOCAL..")(h?[iuIUíúÍÚ][iuIUíúÍÚ])", "%1"..divsil.."%2") p = gsubrep(p, "([aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ][iuIUíúÍÚ]?)(h?[aeoAEOáéóÁÉÓàèòÀÈÒâêôÂÊÔäëöÄËÖ])", "%1"..divsil.."%2") -- junto sílabas con consonantes solamente p = gsubrep(p, INICIO_PALABRA.."("..CONS.."+)"..SEPSIL.."("..LETRA..")", "%1%2") p = gsubrep(p, "("..LETRA..")"..SEPSIL.."("..CONS.."+)"..FIN_PALABRA, "%1%2") p = gsub(p, TEMP_GU, "gu") p = gsub(p, TEMP_QU, "qu") p = gsub(p, TEMP_GUD, "gü") p = gsub(p, TEMP_QUD, "qü") return p end local function acentuar(s1) local function agregar_acentuacion_tilde(silabas, secundario) local sustituido = false local sust = false for j = 1, #silabas do silabas[j], sust = gsubb(silabas[j], "^(.*)(" .. VOCAL_TILDADA .. ")(.*)$", function(pre, diacr, post) return (secundario and ac_secundario or ac_primario) .. pre .. diacr .. post end) sustituido = sustituido or sust end return sustituido end local function mayus(x) local sust x, sust = gsub(x, "^("..CONS.."*)(i)(u?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) if sust > 0 then return x end x = gsub(x, "^("..CONS.."*[iu]?)([aeiou])([iu]?"..CONS.."*)$", function (a, b, c) return a..b:upper()..c end) return x end local function agregar_acentuacion_sin_tilde(silabas, secundario) local L = #silabas if L > 1 then if find(silabas[L], "^[aeo]s?$") or find(silabas[L], "^[ae][mn]s?$") or find(silabas[L], CONS.."[aeo]s?$") or find(silabas[L], CONS.."[ae][mn]s?$") then silabas[L - 1] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L - 1]) -- llana return true else silabas[L] = (secundario and ac_secundario or ac_primario) .. mayus(silabas[L]) -- aguda return true end else --Si L==1, entonces el monosilabo será tónico si no está en la lista de monosílabos átonos if not unstressed_words[silabas[1]] and not unstressed_full_vowel_words[silabas[1]] and not unstressed_full_vowel_words_brazil[silabas[1]] then silabas[1] = (secundario and ac_secundario or ac_primario) .. silabas[1] end return true end return false end local palabras = {} for p in gmatch(s1, "%S+") do local silabas = split(p, SEPSIL) local L = #silabas if p ~= "|" then -- es un delimitador de fragmento, lo ignoro if L >= 4 and ((silabas[L-1] == "men" and silabas[L] == "te") or (silabas[L-1] == "zi" and silabas[L] == "nho")) then local y = silabas[L-1] local z = silabas[L] silabas[L-1] = nil silabas[L] = nil local sustituido = agregar_acentuacion_tilde(silabas, true) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas, true) end assert(sustituido) p = concat(silabas, ".")..ac_primario..y.."."..z else local sustituido = agregar_acentuacion_tilde(silabas) if not sustituido then sustituido = agregar_acentuacion_sin_tilde(silabas) end assert(sustituido) p = concat(silabas, ".") end end p = gsub(p, "%."..ac_primario, ac_primario) p = gsub(p, "%."..ac_secundario, ac_secundario) insert(palabras, p) end return concat(palabras, " ") end local function generar_fono(text) -- convierto extranjerismos text = gsub(text, "tch", "ch") text = gsub(text, "t[iI]?[sc]k", "k͡ǀ") text = gsub(text, "ll"..FIN_SILABA, "l") -- krill text = gsub(text, INICIO_SILABA.."p([stn])", "%1") -- Saco la p inicial de psicología o pterodáctilo text = gsub(text, INICIO_SILABA.."[cmg](n)", "%1") -- Saco la g inicial de gnoseología y la m de mnemónico text = gsub(text, INICIO_SILABA.."[ctd]([sz])", "%1") text = gsub(text, INICIO_SILABA.."[cf](t)", "%1") text = gsub(text, INICIO_SILABA.."[mn]("..CONS_SALVO_H..")", "%1") text = gsub(text, "ph", "f") text = gsub(text, "kh", "χ") -- será convertida en /x/ text = gsub(text, "ck", "k") text = gsub(text, "tl"..FIN_SILABA, "t") -- y con valor de vocal (y fuera de un diptongo) text = gsub(text, "("..CONS..")y", "%1i") -- préstamos como [[slinky]] text = gsub(text, INICIO_SILABA.."y("..SEPSIL.."?"..CONS..")", "i%1") -- [[Yrigoyen]], pero no puede ir [[Mayra]]. text = gsub(text, INICIO_PALABRA.."y"..FIN_PALABRA, "i") -- conjunción -- ch, sh, zh, lh, nh, dj text = gsub(text, "ch", "ĉ") text = gsub(text, "sh", "ʃ") text = gsub(text, "zh", "ʒ") text = gsub(text, "lh", "ʎ") text = gsub(text, "[mn]h", "ɲ") text = gsub(text, "dj", "ʤ") -- r, rr text = gsubrep(text, "("..VOCAL..SEPSIL.."?)r("..SEPSIL.."?"..VOCAL..")", "%1ɾ%2") -- [[oro]] text = gsub(text, "("..CONS_SALVO_R..")r", "%1ɾ") -- [[dragón]] text = gsub(text, "r("..CONS_SALVO_R..")", "ɾ%1") -- [[lord]] text = gsub(text, "r"..FIN_SILABA, "ɾ") -- [[amor]], [[arco]] text = gsub(text, "r+", "ʁ") -- elimino consonantes dobles text = gsub(text, "("..CONS..")%1", "%1") -- x (parcial) text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA.."?)x", "%1ʃ") -- [[xérox]], [[xilofone]], [[xadrez]], etc. text = gsub(text, "([aeo])x"..FIN_PALABRA, function (x) return abrir_vocal[x].."x" end) -- [[clímax]], [[xérox]], [[córtex]], [[hélix]], [[durex]], [[lux]] text = gsub(text, "([aeoAEO]i"..SEPSIL..")x", "%1ʃ") -- [[baixo]], [[peixe]], [[troixa]] text = gsub(text, "([oO]u"..SEPSIL..")x", "%1ʃ") -- [[frouxo]] text = gsub(text, "([eE]n"..SEPSIL..")x", "%1ʃ") -- [[enxame]], [[enxada]] -- falta exC, [[exceçao]] --> se procesa más adelante text = gsub(text, "au("..SEPSIL..")x", "aus%1s") -- [[auxiliar]] text = gsub(text, "("..VOCAL..SEPSIL..")x("..VOCAL..")", "%1z%2") -- [[exilio]] text = gsub(text, "x("..SEPSIL.."[pt])", "s%1") -- [[experiencia]] text = gsub(text, "x("..SEPSIL..")("..VOCAL..")", "k%1s%2") text = gsub(text, "("..SEPSIL..")x("..VOCAL..")", "k%1s%2") -- j text = gsub(text, "j", "ʒ") -- REVISAR : ʤ o ʒ -- c, g, q text = gsub(text, "c([iíìĩIeéèẹēêëEy])", "s%1") text = gsub(text, "g([iíìĩIeéèẹēêëEy])", "ʒ%1") text = gsub(text, "gu([iíìĩIeéèẹēêëE])", "g%1") text = gsub(text, "qu([iíìĩIeéèẹēêëE])", "k%1") text = gsub(text, "ü", "u") -- [[Düsseldorf]], [[hübnerita]], obsolete [[freqüentemente]], etc. text = gsub(text, "[cq]", "k") -- [[quark]], [[Qatar]], [[burqa]], [[Iraq]], etc. -- h (necesito procesarla recién acá para que detecte la secuencia gh-) text = gsub(text, "h", "") -- s, z -- text = gsub(text, INICIO_PALABRA.."tran%.s", "tran.z") -- text = gsub(text, "z"..FIN_PALABRA, "s") -- text = gsub(text, "(" .. VOCAL_NO_NASAL .. "*j?"..SEPARADOR.."?)s(h?"..VOCAL_NO_NASAL..")", "%1z%2") -- text = gsub(text, "(" .. VOCAL .. "*j?"..SEPARADOR.."?)s(h?"..SONORA..")", "%1z%2") -- text = gsub(text, "z("..SEPARADOR.."?[çfkpsʃt])", "s%1") text = gsub(text, "z", "s") -- s + s, ks.s, s.ce, s.ci, ej [[excepción]], [[fascinante]] text = gsub(text, "([szʃʒ])("..SEPSIL..")%1", "%2%1") -- y, cedilla text = gsub(text, "y", "j") text = gsub(text, "ç", "s") -- diptongos text = gsub(text, "ãe", "ãj̃") text = gsub(text, "ão", "ãw") text = gsub(text, "õe", "õj̃") text = gsub(text, "ũi", "ãj̃") text = gsub(text, "i[eE]", "jé") -- Final -em and -ens (stressed or not) pronounced /ẽj̃(s)/. (Later converted to /ɐ̃j̃(s)/ in Portugal.) text = gsub(text, "[eéèẹēêëE]([mn]s?)"..FIN_PALABRA, "ẽj̃%1") -- ei, eu, oi, ou -> êi, êu, ôi, ôu text = gsub(text, "([eéèêoôóòEO])([iuyw])", function (p, q) return cerrar_vocal[p]..semivocal[q] end) -- ai, au -> ái, áu text = gsub(text, "([aáàâA])([iuyw])", function (p, q) return abrir_vocal[p]..semivocal[q] end) -- ua, ue, ui, uo text = gsub(text, "(u)([aeioAEIOãẽĩõáéíóàèìòâêîô])", function (p, q) return "w"..q end) -- ia, ie, io text = gsub(text, "(i)([aeoAEOãẽõáéóàèòâêô])", function (p, q) return "j"..q end) -- iu text = gsub(text, "([iIyĩíî])([uũûúù])", function (p, q) return p.."w" end) -- Convert A/E/O as appropriate when followed by a secondary or tertiary stress marker. If a quality is given, -- it takes precedence; otherwise, act as if an acute accent were given. text = gsub(text, "([aeo])" .. ac_secundario, function (p) return abrir_vocal[p]..ac_secundario end) -- Stressed o in -dor, -dor, -sor ([[ganhador]], [[autor]], [[invasor]], [[agressor]], etc.) and feminines and plurals -- is closed /o/. text = gsub(text, "("..ACENTOS_IPA.."[dts]s?)o(r"..SEPSIL.."?[ea]?s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "([dts])Or"..FIN_PALABRA, "%1ôr") text = gsub(text,"([dts])O(%.r[ae]s?)"..FIN_PALABRA, "%1ô%2") text = gsub(text, "o%.so"..FIN_PALABRA, "ô.so") text = gsub(text, "o(%.s[ao]s?)"..FIN_PALABRA, "ó%1") text = gsub(text, "am"..FIN_PALABRA, "ão") text = gsub(text, INICIO_PALABRA.."("..ACENTOS_IPA..")m[uU]("..SEPSIL..")[iI]t", "%1mũj̃%2it") text = gsub(text, "é([mn]s?)"..FIN_PALABRA, "ê%1") text = gsub(text, "[aA](%.[mnɲ])", "â%1") text = gsub(text, "("..VOCAL..")([mnɲ])", function (p, q) return nasalizar[p]..q end) -- hiatos text = gsub(text, "[iI]%.o"..FIN_PALABRA, "i.u") -- [[río]] local br = text local pt = text pt = gsub(pt, "[eê]("..SEPSIL..")i", "ɐ%1i") pt = gsub(pt, "[eê]j", "ɐj") pt = gsub(pt, "ẽj̃", "ɐ̃j̃") br = gsub(br, ".", convertir_vocales_br) pt = gsub(pt, ".", convertir_vocales_pt) -- exC br = gsub(br, "([eE]"..SEPSIL.."*)x", "%1s") pt = gsub(pt, "([eE])("..SEPSIL.."*)x", "%1i%2s") br = gsub(br, "x", "ks") pt = gsub(pt, "x", "ks") pt = gsub(pt, INICIO_PALABRA.."e(" .. SEPSIL .. "[iI])", "a%1") pt = gsub(pt, "([^ʁ])e(" .. SEPSIL .. "[iI])", "%1a%2") pt = gsub(pt, "([aeoãẽõ])n"..FIN_PALABRA, function (x) return abrir_vocal[x].."n" end) pt = gsub(pt, "([aeo])([lɾ])"..FIN_PALABRA, function (x, y) return abrir_vocal[x]..y end) pt = gsub(pt, "("..CONS..")([eiou])%.(" .. VOCAL .. ")", function(x, y, z) return x .. semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."([eiou])%.(" .. VOCAL .. ")", function(y, z) return semivocal[y] .. z end) pt = gsub(pt, INICIO_PALABRA.."o("..VOCAL..")", "ó%1") br = gsub(br, "õj̃m"..FIN_PALABRA, "õj̃") pt = gsub(pt, "õj̃m"..FIN_PALABRA, "õj̃.ɐ̃m") pt = gsub(pt, "êm"..FIN_PALABRA, "ɐ̃j̃.ɐ̃j̃") pt = gsub(pt, INICIO_PALABRA.."o([^%s" .. vocal_tilde .. "]*"..VOCAL.."[^%s" .. vocal_tilde .. "]*)"..FIN_PALABRA, "ó%1") pt = gsub(pt, "("..VOCAL_NASAL..")[mn]g?", "%1") br = gsub(br, "("..VOCAL_NASAL..")[mn]g?", "%1") pt = gsub(pt, "([j̃w̃])[mn]g?", "%1") br = gsub(br, "([j̃w̃])[mn]g?", "%1") pt = gsub(pt, "([aeo])l", function(x) local conv = {["a"] = "á", ["e"] = "ê", ["o"] = "ô"}; return conv[x].."l" end) pt = gsub(pt, "[aeo]", {["a"] = "ɐ", ["e"] = "ɨ", ["o"] = "u"}) pt = gsub(pt, "[AEIOU]", {["A"] = "a", ["E"] = "e", ["O"] = "o", ["I"] = "i", ["U"] = "u"}) pt = gsub(pt, "[kg]?([sz])"..FIN_PALABRA, sibilante) pt = gsub(pt, "([sz])("..SEPARADOR..CONS..")", function (x, y) return sibilante[x]..y end) br = gsub(br, "([aeo])("..SEPSIL.."ɲ)", function (x, y) return cerrar_vocal[x]..y end) br = gsub(br, "("..VOCAL_ACENTUADA..")([sz])"..FIN_SILABA, "%1j%2") br = gsub(br, "([iI])j", "%1") br = gsub(br, INICIO_PALABRA.."e([mn])", "i%1") br = gsub(br, "ɾ"..FIN_SILABA, "ʁ") br = gsub(br, "e(s?)"..FIN_PALABRA, "i%1") br = gsub(br, "o(s?)"..FIN_PALABRA, "u%1") br = gsub(br, "a([sɾ]?)"..FIN_PALABRA, "ɐ%1") br = gsub(br, INICIO_PALABRA.."es("..SEPSIL..CONS..")", "is%1") -- [[de]] local palatalize_td = {["t"] = "ʧ", ["d"] = "ʤ"} br = gsub(br, INICIO_SILABA.."([td])[iI]", function(x) return palatalize_td[x].."i" end) br = gsub(br, "("..VOCAL..")("..SEPSIL.."[mnɲ])", function(x, y) return nasalizar[x]..y end) br = gsub(br, "[aeo]", {["a"] = "á", ["e"] = "e", ["o"] = "o"}) br = gsub(br, "[AEIOU]", {["A"] = "á", ["E"] = "é", ["O"] = "ó", ["I"] = "i", ["U"] = "u"}) -- l en coda br = gsub(br, "l"..FIN_SILABA, "w") br = gsub(br, ".", convertir_vocales_final) pt = gsub(pt, ".", convertir_vocales_final) pt = gsub(pt, "ĉ", "ʃ") pt = gsub(pt, "ʧ", "t͡ʃ") pt = gsub(pt, "ʤ", "d͡ʒ") br = gsub(br, "ĉ", "ʃ") br = gsub(br, "ʧ", "t͡ʃ") br = gsub(br, "ʤ", "d͡ʒ") local pron, fono = {{"brasilero"}}, {{encodehtml(br)}} insert(pron, {"europeo"}) insert(fono, {encodehtml(pt)}) return pron, fono end function export.procesar_pron_args(titulo, args) local vino_ayuda = true if #args["ayuda"] < 1 then args["ayuda"][1] = titulo vino_ayuda = false end if #args["fone"][1] >= 1 or #args["fono"][1] >= 1 then return end if #titulo == 1 then if titulo >= "a" and titulo <= "z" then args["ayuda"] = pron_abc[string.byte(titulo) - 96] args["tl"] = args["ayuda"] elseif titulo >= "A" and titulo <= "Z" then args["ayuda"] = pron_abc[string.byte(titulo) - 64] args["tl"] = args["ayuda"] end end local tiene_espacios = find(titulo, "%s") local ss, ls, ac, rimas = {}, {}, {}, {} local A = #args["ayuda"] local j = 1 -- indice de la ayuda local k = 1 -- cantidad de pronunciaciones insertadas (máximo 9) while k <= 9 and j <= A do local norm = normalizar(titulo, args["ayuda"][j], true, true) local s1 = silabear(norm) local s1b = acentuar(s1) local pron, fono = generar_fono(s1b) for i,p in ipairs(pron) do local f = fono[i] args["pron"][k] = p args["fono"][k] = f if not tiene_espacios then local lsib = longitud_silabica(s1) ls[lsib] = true ac[acentuacion(s1b, lsib)] = true if not vino_ayuda then ss[s1] = true else ss[sombra(titulo, s1, {{"k%-s", ".-x"}, {"ks%-.", "x-."}})] = true end end rimas[rima(f[1])] = true if args["ayudanota"][j] then args["fnota"][k] = {args["ayudanota"][j]} end k = k + 1 if k > 9 then break end end j = j + 1 end args["d"] = keys_to_list(ss) args["ls"] = keys_to_list(ls) args["ac"] = keys_to_list(ac) args["rima"] = keys_to_list(rimas) return end return export 4cnrawxiebiwxynrjrgx87gbhf7sa71 obrigada 0 1039755 6076686 5828283 2026-04-05T02:45:17Z TMCbot 164594 . 6076686 wikitext text/x-wiki == {{lengua|pt}} == {{pron-graf|leng=pt|2audio1=LL-Q5146 (por)-Santamarcanda-obrigada.wav}} === Etimología 1 === {{etimología}}. ==== {{interjección|pt}} ==== ;1: ¡{{plm|gracias}}! (dicho por una mujer) {{relacionado|obrigado|nota1=dicho por una hombre}} === Forma flexiva === ==== Forma adjetiva ==== ;1: {{forma adjetivo|leng=pt|obrigado|femenino}}. == Referencias y notas == <references /> flgjk8p1zy7kncf18qud6rsvx2px2p2 Módulo:flex/estilo.css 828 1046240 6076625 5922981 2026-04-05T00:52:16Z Tmagc 158167 6076625 sanitized-css text/css .fakelinks { color: var(--color-progressive, #0645ad); } .flex .new { color: var(--background-color-interactive, black); } .flex.mw-collapsible-toggle { padding: 2px; background-clip: content-box; background-color: var(--background-color-interactive, #e0e0e0); border-style: solid; border-color: black; border-width: thin; text-align: center; cursor: pointer; } .flex.mw-collapsible-toggle:hover { text-decoration: underline; background-color: var(--background-color-interactive--hover, #f0f0f0); } .flex .mw-collapsible-toggle .up, .flex.mw-collapsed .mw-collapsible-toggle .down { display: none; } .flex .mw-collapsible-toggle .down, .flex.mw-collapsed .mw-collapsible-toggle .up { display: inline; } .flex.wikitable { margin: 0; border-style: none solid solid solid; border-color: black; border-width: thin; } .movil { display: none; color: DimGrey; } @media screen and (max-width: 800px) { .flex.wikitable { display: grid; width: inherit; } .flex.wikitable tr { display: grid; } .movil { display: inline; } .pc { display: none; } } a3xrurwgbcy4s402er4totjdhw7ozw7 6076626 6076625 2026-04-05T00:53:07Z Tmagc 158167 6076626 sanitized-css text/css .fakelinks { color: var(--color-progressive, #0645ad); } .flex .new { color: var(--color-progressive, black); } .flex.mw-collapsible-toggle { padding: 2px; background-clip: content-box; background-color: var(--background-color-interactive, #e0e0e0); border-style: solid; border-color: black; border-width: thin; text-align: center; cursor: pointer; } .flex.mw-collapsible-toggle:hover { text-decoration: underline; background-color: var(--background-color-interactive--hover, #f0f0f0); } .flex .mw-collapsible-toggle .up, .flex.mw-collapsed .mw-collapsible-toggle .down { display: none; } .flex .mw-collapsible-toggle .down, .flex.mw-collapsed .mw-collapsible-toggle .up { display: inline; } .flex.wikitable { margin: 0; border-style: none solid solid solid; border-color: black; border-width: thin; } .movil { display: none; color: DimGrey; } @media screen and (max-width: 800px) { .flex.wikitable { display: grid; width: inherit; } .flex.wikitable tr { display: grid; } .movil { display: inline; } .pc { display: none; } } 5z6liunj18xqjxt36oll021ixd8qzn4 ללמד 0 1046513 6076622 6032097 2026-04-05T00:11:52Z JPDAMAY 176835 6076622 wikitext text/x-wiki == {{lengua|he}} == {{pron-graf |leng=he |ayuda=לִלְמֹד |fnota=forma 1 |ayuda2=לְלַמֵּד |2fnota=forma 2 }} === Forma flexiva === ==== Forma verbal ==== ;1: {{forma verbo|leng=he|למד|infinitivo|glosa=aprender}}. ;2: {{forma verbo|leng=he|למד|infinitivo|glosa=enseñar}}. == Referencias y notas == <references /> f1pw1x1wseyl02pen83fh5dw72wevpt crucial 0 1051714 6076586 6066974 2026-04-04T20:24:23Z Tmagc 158167 6076586 wikitext text/x-wiki == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología|en|crucial}}, este {{etim|fr|crucial}}, y este {{etim|la|crux}}, {{l+|la|crux|crucis}} ('[[cruz]]'). === {{adjetivo|es}} === {{es.adj|ng}} ;1: {{plm|determinante}}, [[crítico]], [[esencial]] para la [[realización]] o el [[cumplimiento]] de algo. {{ejemplo|«En solo [[quince]] [[minuto]]s fui [[impuesto]] de la [[situación]] de la [[región]] que [[tener|tenía]] que [[dominar]]. Flores Magón estaba en Durango, [[hacia]] el [[sur]], [[tratar|tratando]] de [[concentrar]] [[suficiente]]s [[hombre]]s y [[munición|municiones]] para [[atacar]] el Torreón, punto '''''crucial''''' en todas las [[operación|operaciones]] [[militar]]es mexicanas, [[debido]] al [[hecho]] de que [[allí]] [[encontrarse|se encuentra]] el [[empalme]] del [[ferrocarril]] con el [[centro]] del rico [[distrito]]».|a={{versalita|Nogales Méndez, Rafael}}|c=libro|f=1936|t=Memorias}} {{ejemplo|«{{plm|pero}} su [[pueblo]] estaba [[dormido]], [[anestesiado]], [[insensible]] al [[drama]] que [[vivir|vivía]] en [[aquel]]los [[instante]]s '''''cruciales''''' de su [[historia]]. {{plm|ante}} la [[grave]] [[desventura]], Hostos [[hacer|hizo]] un [[diagnóstico]] [[valedero]] para [[entonces]] y para [[ahora]]: “Lo [[muerto]] en [[Puerto Rico]] no es la [[dignidad]] del [[pueblo]], [[sino]] la [[voluntad]] [[capaz]] de [[despertar]][[la]] y de [[encaminar]][[la]]”».|a={{versalita|Géigel Polanco, Vicente}}|c=libro|f=1939|t=«Hostos, realidad actuante en nuestro mundo moral»}} {{ejemplo|«Esa [[lucha]] patética [[entre]] el [[prejuicio]] [[adquirido]] y el [[juicio]] [[propio]]; ese [[afán]] de [[cohonestar]] los [[hecho]]s [[observado]]s con la [[autoridad]] de los [[antiguo]]s, [[compromiso]] que [[traducir|se traduce]] en una [[ciencia]] [[trabado|trabada]] e [[imperfecto|imperfecta]], es el [[símbolo]] del [[espíritu]] [[atormentado]] de los más [[selecto]]s [[hombre]]s en [[aquel]] [[momento]] '''''crucial''''' de la {{plm|historia}}».|a={{versalita|Rey Pastor, Julio}}|c=libro|f=1924|t=La ciencia y la técnica en el descubrimiento de América}} {{sinónimo|decisivo|trascendental|trascendente}}. ;2: En forma de [[cruz]].<ref>{{referencia|autor=Rodríguez Navas y Carrasco, Manuel|título=Diccionario general y técnico hispano-americano|fecha=1918|editorial=Madrid, Cultura Hispanoamericana|página=495|c=libro}}</ref> {{sinónimo|cruciforme}}. === Véase también === {{w}} === Traducciones === {{trad-arriba}} {{trad-abajo}} ==== Información adicional ==== {{derivad|crucialmente}}. == {{lengua|ca}} == {{pron-graf|leng=ca}} === Etimología === {{etimología|leng=ca|la|crux}}, {{l+|la|crux|crucis}} ('[[cruz]]'). === {{adjetivo|ca}} === {{ca.adj}} ;1: {{plm}}.{{subíndice|1}}. == {{lengua|fr}} == {{pron-graf|leng=fr}} === Etimología === {{datación|leng=fr|XVI}}. {{etimología|leng=fr|la|crux}}, {{l+|la|crux|crucis}} ('[[cruz]]'). === {{adjetivo|fr}} === {{fr.adj}} ;1: {{plm}}, [[determinante]]. {{ejemplo|«Un [[point]] '''''crucial''''' est l’[[éclatement]] du revenu mixte d’[[exploitation]] des [[indépendant]]s entre une [[part]] salariale et une part allant au [[capital]].»|a={{versalita|INSEE}}|c=libro|f=2009|t=Partage de la valeur ajoutée, partage des profits et écarts de rémunérations en France|trada=INSEE|tradc=libro|tradf=2009|tradt=Distribución del valor añadido, distribución de beneficios y diferencias salariales en Francia|traducción=«Un [[punto]] '''''crucial''''' es la [[separación]] del [[ingreso]] [[mixto]] de [[explotación]] de los [[independiente]]s entre una [[parte]] [[salarial]] y una [[parte]] que va al [[capital]]».}} ;2: {{plm}} ([[en]] [[forma]] [[de]] [[cruz]]). === Descendientes === {{trad-arriba|Descendientes de «crucial»}} {{d|en|d1=crucial|niv=1}} {{trad-abajo}} == {{lengua|gl}} == {{pron-graf|leng=gl}} === Etimología === {{etimología|leng=gl|la|crux}}, {{l+|la|crux|crucis}} ('[[cruz]]'). === {{adjetivo|gl}} === {{gl.adj}} ;1: {{plm}}{{subíndice|1}}. == {{lengua|en}} == {{pron-graf|leng=en |2fono1=ˈkɹu.ʃəl |2pron1=General American, Standard Canadian|3audio2=En-au-crucial.ogg|3aunota2=Queensland |3fone2=ˈkɹʉː.ʃɫ̩|3fono1=ˈkɹʉː.ʃəl|3pron1=Australia, Nueva Zelanda|1fono1=ˈkɹuː.ʃəl |ls=2 |1pron1=Received Pronunciation|rima=uː.ʃəl }} === Etimología === {{año de documentación|leng=en|1706}}. {{etimología|leng=en|fr|crucial}} ("un término médico para los ligamentos de la rodilla (que se cruzan entre sí)", {{etim|leng=en|la|crux}}, {{l+|la|crux|crucis|glosa=cruz}}. === {{adjetivo|en}} === {{en.adj|l}} ;1: {{plm}}, [[determinante]]. {{ejemplo|“{{plm|vocabulary}} provides a [[foundation]] from which [[grammar]], [[phonology]], and [[morphology]] emerge, and in a [[subject]] [[area]] it provides [[access]] to [[conceptual]] knowledge. {{plm|vocabulary}} selection for pedagogical [[purpose]]s is [[therefore]] '''''crucial'''''.”|a={{versalita|Clarence Green; James Lambert}}|c=libro|f=2018|p=16|t=“Advancing disciplinary literacy through English for academic purposes: Discipline-specific wordlists, collocations and word families for eight secondary subjects.”|trada={{versalita|Clarence Green; James Lambert}}|tradc=libro|tradf=2018|tradp=16|tradt=«Fomentar la alfabetización disciplinaria a través del inglés para fines académicos: listas de palabras específicas de cada disciplina, colocaciones y familias de palabras para ocho materias de secundaria»|traducción=«El [[vocabulario]] proporciona una [[base]] [[desde]] la cual [[emerger|emergen]] la [[gramática]], la [[fonología]]] y la [[morfología]], y en un [[área]] de [[asignatura]] proporciona [[acceso]] al [[conocimiento]] conceptual. Por lo tanto, la [[selección]] de [[vocabulario]] para [[fin]]es [[pedagógico]]s es '''''crucial'''''».}} ;2: {{plm|excelente}}, [[buenísimo]]. {{uso|coloquial}}. {{ejemplo|The [[party]] was crucial.|traducción=La fiesta estuvo [[buenísimo|buenísima]].}} == {{lengua|pt}} == {{pron-graf|leng=pt}} === Etimología === {{etimología|leng=pt|la|crux}}, {{l+|la|crux|crucis}} ('[[cruz]]'). === {{adjetivo|pt}} === {{pt.adj}} ;1: {{plm}}{{subíndice|1}}, [[determinante]]. {{ejemplo|«É [[necessário]] ter ''know-how'' para [[penetrar]] no [[caos]] [[organizado]] que [[existir|existe]] na maior [[parte]] das [[empresa]]s e concentrar-se no [[conjunto]] de [[elemento]]s '''''cruciais'''''».|a={{versalita|Ram Charan}}|c=libro|editorial=Elsevier Brasil|f=2007|p=74|t=Know-how: as 8 competências que separam os que fazem dos que não fazem|trada={{versalita|Ram Charan}}|tradc=libro|tradeditorial=Elsevier Brasil|tradf=2007|tradp=74|tradt=Know-how: las 8 habilidades que diferencian a quienes hacen de quienes no hacen|traducción=«Es [[necesario]] tener [[conocimiento]]s [[especializado]]s para [[adentrarse]] en el [[caos]] [[organizado]] que [[existir|existe]] en la [[mayoría]] de las [[empresa]]s y [[centrarse]] en el [[conjunto]] de [[elemento]]s '''''cruciales'''''».}} === Información adicional === {{derivad|título=Derivados|crucialmente}}. == Referencias y notas == <references /> jz1sl680irc2laq26fhji0v42krcnfh transespecie 0 1054085 6076639 6018582 2026-04-05T02:20:36Z Tmagc 158167 6076639 wikitext text/x-wiki {{desambiguación|}} == {{lengua|es}} == {{pron-graf|ayuda=trans-especie}} === Etimología === {{etimología|prefijo|trans|especie}}. ==== {{adjetivo|es}} ==== {{es.adj|inv}} ;1 {{csem|LGBT}}: Dicho de una persona: que se autopercibe como un individuo de una especie distinta del ser humano. {{uso|utcs}} ==== Traducciones ==== {{trad-arriba}} {{trad-abajo}} == Referencias y notas == <references /> 63h70daogmrgk7c4d90gm8vroft4mgr seamlessly 0 1062458 6076530 2026-04-04T13:17:37Z Cvmontuy 1123 Página creada con «{{desambiguación|}} == {{lengua|en}} == {{pron-graf|leng=en |fono=ˈsiːmləsli|audio=|pron=Estados Unidos |2fono=ˈsiːmləsli|2audio=|2pron=Reino Unido| }} === Etimología === {{etimología|leng=en|sufijo|seamless|ly}}. ==={{adverbio|en}}=== {{en.adv|l}} ;1: {{plm|sin}} problemas, sin interrupciones. ;2: {{plm|perfectamente}}. ;3: {{plm|sin}} fisuras. === Véase también === {{w|leng=en}} == Referencias y notas == <references />» 6076530 wikitext text/x-wiki {{desambiguación|}} == {{lengua|en}} == {{pron-graf|leng=en |fono=ˈsiːmləsli|audio=|pron=Estados Unidos |2fono=ˈsiːmləsli|2audio=|2pron=Reino Unido| }} === Etimología === {{etimología|leng=en|sufijo|seamless|ly}}. ==={{adverbio|en}}=== {{en.adv|l}} ;1: {{plm|sin}} problemas, sin interrupciones. ;2: {{plm|perfectamente}}. ;3: {{plm|sin}} fisuras. === Véase también === {{w|leng=en}} == Referencias y notas == <references /> luojwacx39wxjvkrrrlpozvygw13vyk dolma 0 1062459 6076534 2026-04-04T14:53:28Z Tmagc 158167 Página creada con «{{desambiguación|}} == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología|el|ντολμάς}}, {{etim|tr|dolma}}, {{etim|ota|طولمه}}, de {{l+|ota|طولمق|glosa=llenarse}}. ==== {{sustantivo masculino|es}} ==== {{es.sust}} ;1 {{csem|gastronomía}}: Plato de origen árabe basado en una serie de vegetales rellenos, generalmente con arroz, carne picada, granos, cebolla, hierbas y especias. ==== Véase también ==== {{w}} ==== Traducciones ====…» 6076534 wikitext text/x-wiki {{desambiguación|}} == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología|el|ντολμάς}}, {{etim|tr|dolma}}, {{etim|ota|طولمه}}, de {{l+|ota|طولمق|glosa=llenarse}}. ==== {{sustantivo masculino|es}} ==== {{es.sust}} ;1 {{csem|gastronomía}}: Plato de origen árabe basado en una serie de vegetales rellenos, generalmente con arroz, carne picada, granos, cebolla, hierbas y especias. ==== Véase también ==== {{w}} ==== Traducciones ==== {{trad-arriba}} {{trad-abajo}} == Referencias y notas == <references /> 2xw6n91x8g4sw21vpybh08j7wu63ysg 6076535 6076534 2026-04-04T14:53:57Z Tmagc 158167 6076535 wikitext text/x-wiki {{desambiguación|}} == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología|el|ντολμάς}}, {{etim|tr|dolma}}, {{etim|ota|طولمه}}, de {{l+|ota|طولمق|glosa=llenarse}}. [[File:Armeniadoma.jpg|thumb|(1)]] ==== {{sustantivo ambiguo|es}} ==== {{es.sust}} ;1 {{csem|gastronomía}}: Plato de origen árabe basado en una serie de vegetales rellenos, generalmente con arroz, carne picada, granos, cebolla, hierbas y especias. ==== Véase también ==== {{w}} ==== Traducciones ==== {{trad-arriba}} {{trad-abajo}} == Referencias y notas == <references /> la6j9mujbqfcrtgt459yd5sayyml4nf Usuario:Mdelop721/subsidiariedad 2 1062461 6076537 2026-04-04T15:13:21Z Mdelop721 181726 Página creada con «== Español == === Etimología === De ''subsidiario'' y el sufijo ''-dad''. === Sustantivo femenino === # Principio según el cual una instancia superior solo interviene cuando una inferior no puede cumplir adecuadamente una función. # Condición de lo que es subsidiario, que sirve de apoyo o complemento a algo principal. ==== Sinónimos ==== * complementariedad * apoyo * asistencia ==== Ejemplos ==== * El principio de subsidiariedad es fundamental en la organiz…» 6076537 wikitext text/x-wiki == Español == === Etimología === De ''subsidiario'' y el sufijo ''-dad''. === Sustantivo femenino === # Principio según el cual una instancia superior solo interviene cuando una inferior no puede cumplir adecuadamente una función. # Condición de lo que es subsidiario, que sirve de apoyo o complemento a algo principal. ==== Sinónimos ==== * complementariedad * apoyo * asistencia ==== Ejemplos ==== * El principio de subsidiariedad es fundamental en la organización de la Unión Europea. * La subsidiariedad permite que las decisiones se tomen en el nivel más cercano posible al ciudadano. * Este programa actúa bajo un criterio de subsidiariedad respecto a las iniciativas locales. lxokioutxwzyfshuok7r4i50vt3zwft 6076734 6076537 2026-04-05T08:54:15Z Peter Bowman 34685 Peter Bowman trasladó la página [[subsidiariedad]] a [[Usuario:Mdelop721/subsidiariedad]] sin dejar una redirección: sin formato, ver [[WN:ES]] 6076537 wikitext text/x-wiki == Español == === Etimología === De ''subsidiario'' y el sufijo ''-dad''. === Sustantivo femenino === # Principio según el cual una instancia superior solo interviene cuando una inferior no puede cumplir adecuadamente una función. # Condición de lo que es subsidiario, que sirve de apoyo o complemento a algo principal. ==== Sinónimos ==== * complementariedad * apoyo * asistencia ==== Ejemplos ==== * El principio de subsidiariedad es fundamental en la organización de la Unión Europea. * La subsidiariedad permite que las decisiones se tomen en el nivel más cercano posible al ciudadano. * Este programa actúa bajo un criterio de subsidiariedad respecto a las iniciativas locales. lxokioutxwzyfshuok7r4i50vt3zwft Usuario:Mdelop721/parangonable 2 1062462 6076538 2026-04-04T15:15:29Z Mdelop721 181726 Definición léxico gráfica de parangonable 6076538 wikitext text/x-wiki == Español == === Etimología === De ''parangón'' y el sufijo ''-able''. === Adjetivo === # Que puede compararse con algo por presentar semejanzas o características equivalentes. # Que es susceptible de ser puesto en relación con otro para establecer similitudes o diferencias. ==== Sinónimos ==== * comparable * equiparable * semejante ==== Ejemplos ==== * Su talento es parangonable al de los grandes maestros. * No existe otra obra parangonable en su estilo. * La calidad del producto es parangonable a la de las mejores marcas. a1we5h6jvqa8fdrzeu1zs42xwhuiu8n 6076735 6076538 2026-04-05T08:54:22Z Peter Bowman 34685 Peter Bowman trasladó la página [[parangonable]] a [[Usuario:Mdelop721/parangonable]] sin dejar una redirección: sin formato, ver [[WN:ES]] 6076538 wikitext text/x-wiki == Español == === Etimología === De ''parangón'' y el sufijo ''-able''. === Adjetivo === # Que puede compararse con algo por presentar semejanzas o características equivalentes. # Que es susceptible de ser puesto en relación con otro para establecer similitudes o diferencias. ==== Sinónimos ==== * comparable * equiparable * semejante ==== Ejemplos ==== * Su talento es parangonable al de los grandes maestros. * No existe otra obra parangonable en su estilo. * La calidad del producto es parangonable a la de las mejores marcas. a1we5h6jvqa8fdrzeu1zs42xwhuiu8n Usuario:Mdelop721/alostático 2 1062463 6076541 2026-04-04T15:23:40Z Mdelop721 181726 Se creo la página, añadiendo definición léxico gráfica 6076541 wikitext text/x-wiki == Español == === Etimología === De ''alostasis'' y el sufijo ''-ico''. === Adjetivo === # Relativo a la alostasis, proceso mediante el cual un organismo mantiene su estabilidad interna a través del cambio ante situaciones de estrés o demanda. # Que implica mecanismos de regulación fisiológica adaptativa para conservar el equilibrio del organismo. ==== Sinónimos ==== * adaptativo * regulador (en contextos fisiológicos) ==== Ejemplos ==== * La respuesta alostática permite al cuerpo adaptarse a condiciones cambiantes. * El estrés crónico puede alterar los mecanismos alostáticos del organismo. * El sistema nervioso regula procesos alostáticos para mantener la homeostasis. kgrguhsdkbd133sd76799xforthxef7 6076736 6076541 2026-04-05T08:54:30Z Peter Bowman 34685 Peter Bowman trasladó la página [[alostático]] a [[Usuario:Mdelop721/alostático]] sin dejar una redirección: sin formato, ver [[WN:ES]] 6076541 wikitext text/x-wiki == Español == === Etimología === De ''alostasis'' y el sufijo ''-ico''. === Adjetivo === # Relativo a la alostasis, proceso mediante el cual un organismo mantiene su estabilidad interna a través del cambio ante situaciones de estrés o demanda. # Que implica mecanismos de regulación fisiológica adaptativa para conservar el equilibrio del organismo. ==== Sinónimos ==== * adaptativo * regulador (en contextos fisiológicos) ==== Ejemplos ==== * La respuesta alostática permite al cuerpo adaptarse a condiciones cambiantes. * El estrés crónico puede alterar los mecanismos alostáticos del organismo. * El sistema nervioso regula procesos alostáticos para mantener la homeostasis. kgrguhsdkbd133sd76799xforthxef7 Usuario discusión:Mdelop721 3 1062464 6076545 2026-04-04T15:41:16Z Tmagc 158167 Página creada con «{{subst:Bienvenido usuario}}» 6076545 wikitext text/x-wiki <div style="padding:10px; font-size:101%; background-color:#F5FFFF; border: 1px dotted teal;" > Hola, Mdelop721. Te damos la [[Wikcionario:Bienvenido, nuevo visitante|bienvenida a ''Wikcionario'']]. <small style="padding-left:150px">[[Wikcionario:Embajada|If you don't speak Spanish, please visit our Embassy]]</small> Gracias por participar en el proyecto. Puedes encontrar algunas guías útiles aquí: :<small>&#x25B6;</small> El '''[[Ayuda:Tutorial|tutorial del Wikcionario]]''' te ofrece una introducción básica sobre la manera de editar con el lenguaje "wiki"; si ya has editado en ''Wikipedia'', mira '''[[Wikcionario:Para editores de Wikipedia|para editores de Wikipedia]]''' en cambio. :<small>&#x25B6;</small> La '''[[Wikcionario:Ayuda|página de ayuda]]''' explica la filosofía básica del proyecto, cómo explorarlo y cómo colaborar; hay muchos otros recursos en el '''[[Ayuda:Mapa de ayuda|Mapa de ayuda]]'''. :<small>&#x25B6;</small> Las '''[[Wikcionario:Cómo se edita una página|instrucciones para editar una página]]''' explican cómo hacer ediciones; :<small>&#x25B6;</small> La '''[[Wikcionario:Guía de estilo|guía de estilo]]''' es esencial para orientar la redacción; :<small>&#x25B6;</small> Recuerda también que casi siempre las entradas se crean con [[minúscula]]s. Mira '''[[Wikcionario:Convenciones para nombrar entradas|cómo nombrar entradas]]''' para más detalles. Si quieres saber algo más, puedes dirigirte a la comunidad en el '''[[Wikcionario:Café|Café]]'''. No temas preguntar, estamos aquí para ayudarte. Puedes también conectarte con otros editores en el '''{{IRC|wiktionary-es|canal IRC}}''' o en el {{IRC|wikimedia-ayuda|canal de ayuda}}. {| | Esta es tu página de discusión, donde otros wikcionaristas pueden contactarte. Debes responder a un mensaje de otro usuario en '''su''' página de discusión, porque así le saldrá el aviso de «mensajes nuevos» y podrá enterarse de tu respuesta. No olvides '''[[Wikcionario:Cómo se edita una página#Firmar un comentario|firmar tu mensaje]]''' con cuatro tildes <nowiki>(&#126;&#126;&#126;&#126;)</nowiki>, con la combinación de teclas {{tecla|Alt Gr|4}}, o usando el botón correspondiente que hay en la parte superior de la caja de edición. || [[Archivo:Signature button.png|right|Para firmar usa el botón indicado|link=]] |} Esperamos que pases buenos momentos por aquí y que la colaboración te resulte agradable.<br /> Saludos muy cordiales, [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 15:41 4 abr 2026 (UTC).</div> 2bil756drz52gchlcqggzq6p7n4voya 6076546 6076545 2026-04-04T15:41:25Z Tmagc 158167 Sección nueva: /* Formato */ 6076546 wikitext text/x-wiki <div style="padding:10px; font-size:101%; background-color:#F5FFFF; border: 1px dotted teal;" > Hola, Mdelop721. Te damos la [[Wikcionario:Bienvenido, nuevo visitante|bienvenida a ''Wikcionario'']]. <small style="padding-left:150px">[[Wikcionario:Embajada|If you don't speak Spanish, please visit our Embassy]]</small> Gracias por participar en el proyecto. Puedes encontrar algunas guías útiles aquí: :<small>&#x25B6;</small> El '''[[Ayuda:Tutorial|tutorial del Wikcionario]]''' te ofrece una introducción básica sobre la manera de editar con el lenguaje "wiki"; si ya has editado en ''Wikipedia'', mira '''[[Wikcionario:Para editores de Wikipedia|para editores de Wikipedia]]''' en cambio. :<small>&#x25B6;</small> La '''[[Wikcionario:Ayuda|página de ayuda]]''' explica la filosofía básica del proyecto, cómo explorarlo y cómo colaborar; hay muchos otros recursos en el '''[[Ayuda:Mapa de ayuda|Mapa de ayuda]]'''. :<small>&#x25B6;</small> Las '''[[Wikcionario:Cómo se edita una página|instrucciones para editar una página]]''' explican cómo hacer ediciones; :<small>&#x25B6;</small> La '''[[Wikcionario:Guía de estilo|guía de estilo]]''' es esencial para orientar la redacción; :<small>&#x25B6;</small> Recuerda también que casi siempre las entradas se crean con [[minúscula]]s. Mira '''[[Wikcionario:Convenciones para nombrar entradas|cómo nombrar entradas]]''' para más detalles. Si quieres saber algo más, puedes dirigirte a la comunidad en el '''[[Wikcionario:Café|Café]]'''. No temas preguntar, estamos aquí para ayudarte. Puedes también conectarte con otros editores en el '''{{IRC|wiktionary-es|canal IRC}}''' o en el {{IRC|wikimedia-ayuda|canal de ayuda}}. {| | Esta es tu página de discusión, donde otros wikcionaristas pueden contactarte. Debes responder a un mensaje de otro usuario en '''su''' página de discusión, porque así le saldrá el aviso de «mensajes nuevos» y podrá enterarse de tu respuesta. No olvides '''[[Wikcionario:Cómo se edita una página#Firmar un comentario|firmar tu mensaje]]''' con cuatro tildes <nowiki>(&#126;&#126;&#126;&#126;)</nowiki>, con la combinación de teclas {{tecla|Alt Gr|4}}, o usando el botón correspondiente que hay en la parte superior de la caja de edición. || [[Archivo:Signature button.png|right|Para firmar usa el botón indicado|link=]] |} Esperamos que pases buenos momentos por aquí y que la colaboración te resulte agradable.<br /> Saludos muy cordiales, [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 15:41 4 abr 2026 (UTC).</div> == Formato == [[WN:ES]] [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 15:41 4 abr 2026 (UTC) jggq7wayiq7hojfg3ee0p0mxg2kxjae 6076737 6076546 2026-04-05T08:55:19Z Peter Bowman 34685 /* Formato */ Respuesta 6076737 wikitext text/x-wiki <div style="padding:10px; font-size:101%; background-color:#F5FFFF; border: 1px dotted teal;" > Hola, Mdelop721. Te damos la [[Wikcionario:Bienvenido, nuevo visitante|bienvenida a ''Wikcionario'']]. <small style="padding-left:150px">[[Wikcionario:Embajada|If you don't speak Spanish, please visit our Embassy]]</small> Gracias por participar en el proyecto. Puedes encontrar algunas guías útiles aquí: :<small>&#x25B6;</small> El '''[[Ayuda:Tutorial|tutorial del Wikcionario]]''' te ofrece una introducción básica sobre la manera de editar con el lenguaje "wiki"; si ya has editado en ''Wikipedia'', mira '''[[Wikcionario:Para editores de Wikipedia|para editores de Wikipedia]]''' en cambio. :<small>&#x25B6;</small> La '''[[Wikcionario:Ayuda|página de ayuda]]''' explica la filosofía básica del proyecto, cómo explorarlo y cómo colaborar; hay muchos otros recursos en el '''[[Ayuda:Mapa de ayuda|Mapa de ayuda]]'''. :<small>&#x25B6;</small> Las '''[[Wikcionario:Cómo se edita una página|instrucciones para editar una página]]''' explican cómo hacer ediciones; :<small>&#x25B6;</small> La '''[[Wikcionario:Guía de estilo|guía de estilo]]''' es esencial para orientar la redacción; :<small>&#x25B6;</small> Recuerda también que casi siempre las entradas se crean con [[minúscula]]s. Mira '''[[Wikcionario:Convenciones para nombrar entradas|cómo nombrar entradas]]''' para más detalles. Si quieres saber algo más, puedes dirigirte a la comunidad en el '''[[Wikcionario:Café|Café]]'''. No temas preguntar, estamos aquí para ayudarte. Puedes también conectarte con otros editores en el '''{{IRC|wiktionary-es|canal IRC}}''' o en el {{IRC|wikimedia-ayuda|canal de ayuda}}. {| | Esta es tu página de discusión, donde otros wikcionaristas pueden contactarte. Debes responder a un mensaje de otro usuario en '''su''' página de discusión, porque así le saldrá el aviso de «mensajes nuevos» y podrá enterarse de tu respuesta. No olvides '''[[Wikcionario:Cómo se edita una página#Firmar un comentario|firmar tu mensaje]]''' con cuatro tildes <nowiki>(&#126;&#126;&#126;&#126;)</nowiki>, con la combinación de teclas {{tecla|Alt Gr|4}}, o usando el botón correspondiente que hay en la parte superior de la caja de edición. || [[Archivo:Signature button.png|right|Para firmar usa el botón indicado|link=]] |} Esperamos que pases buenos momentos por aquí y que la colaboración te resulte agradable.<br /> Saludos muy cordiales, [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 15:41 4 abr 2026 (UTC).</div> == Formato == [[WN:ES]] [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 15:41 4 abr 2026 (UTC) :Hola, @[[Usuario:Mdelop721|Mdelop721]]. He trasladado las páginas a tu espacio de nombres para que puedas mejorarlas antes de su publicación en el espacio principal: [[Usuario:Mdelop721/alostático]], [[Usuario:Mdelop721/parangonable]], [[Usuario:Mdelop721/subsidiariedad]]. Un saludo, [[Usuario:Peter Bowman|Peter Bowman]] ([[Usuario discusión:Peter Bowman|discusión]]) 08:55 5 abr 2026 (UTC) c32p06v5v0165vrxpbfmp9hf1uqm6ai alszik 0 1062465 6076559 2026-04-04T16:45:25Z PFSV-UY 128755 Página creada con «== {{lengua|hu}} == {{pron-graf|leng=hu|}} === Etimología === {{etimología|leng=hu}}. === {{verbo|hu}} === ;1: {{plm|dormir}}. == Referencias y notas == <references />» 6076559 wikitext text/x-wiki == {{lengua|hu}} == {{pron-graf|leng=hu|}} === Etimología === {{etimología|leng=hu}}. === {{verbo|hu}} === ;1: {{plm|dormir}}. == Referencias y notas == <references /> r9huxtnq11hngiqyfp41ddqy2du29j7 Categoría:FR:Adjetivos plurales 14 1062466 6076590 2026-04-04T21:00:58Z Adelpine 34679 Crea categoría 6076590 wikitext text/x-wiki {{auto cat}} eomzlm5v4j7ond1phrju7cnue91g5qx vieira 0 1062467 6076613 2026-04-04T22:58:49Z Tmagc 158167 Página creada con «{{desambiguación|}} == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología|gl|vieira}}. ==== {{sustantivo femenino|es}} ==== {{es.sust}} ;1 {{csem|moluscos}}: (''Pectinidae'') Familia de moluscos bivalvos, emparentados de cerca con las almejas y las ostras. {{sinónimo|pectínido}} ==== Traducciones ==== {{trad-arriba}} {{trad-abajo}} == Referencias y notas == <references />» 6076613 wikitext text/x-wiki {{desambiguación|}} == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología|gl|vieira}}. ==== {{sustantivo femenino|es}} ==== {{es.sust}} ;1 {{csem|moluscos}}: (''Pectinidae'') Familia de moluscos bivalvos, emparentados de cerca con las almejas y las ostras. {{sinónimo|pectínido}} ==== Traducciones ==== {{trad-arriba}} {{trad-abajo}} == Referencias y notas == <references /> oopwoz14in1fuktz8w9vacgkw9321cx Wikcionario:Café/2026 03 4 1062468 6076617 2026-04-04T23:32:16Z MABot 70592 Bot: archivo de 2 hilos procedentes de [[Wikcionario:Café]] 6076617 wikitext text/x-wiki {{Archivo}} == Noticias técnicas: 2026-10 == <section begin="technews-2026-W10"/><div class="plainlinks"> Las últimas '''[[m:Special:MyLanguage/Tech/News|noticias técnicas]]''' desde la comunidad técnica de Wikimedia. Por favor, comenta estos cambios con otros usuarios. No todos los cambios te afectarán. [[m:Special:MyLanguage/Tech/News/2026/10|Traducciones en varios idiomas]] están disponibles. '''Lo más destacado de la semana''' * <span lang="en" dir="ltr" class="mw-content-ltr">Wikipedia 25 [[m:Special:MyLanguage/Wikipedia 25/Easter egg experiments|Birthday mode]] is now live on Betawi, Breton, Chinese, Czech, Dutch, English, French, Gorontalo, Indonesian, Italian, Luxembourgish, Madurese, Sicilian, Spanish, Thai, and Vietnamese Wikipedias! This limited-time campaign feature celebrates 25 years of Wikipedia with a birthday mascot, Baby Globe. When turned on, Baby Globe is shown on [[m:Special:MyLanguage/Wikipedia 25/Easter egg experiments/article configuration|~2,500 articles]], waiting to be discovered by readers. Communities can choose to turn Birthday mode on by getting consensus from their community and asking an admin to enable the feature and customize it via [[m:Special:MyLanguage/Wikipedia 25/Easter egg experiments#Community Configuration Demo|community configuration]] on the local wiki.</span> '''Actualizaciones para editores''' * <span lang="en" dir="ltr" class="mw-content-ltr">[[:m:Special:MyLanguage/WMDE Technical Wishes/Sub-referencing|Sub-referencing]], a new feature to re-use references with different details has been released to Swedish Wikipedia, Polish Wikipedia and [[:phab:T418209|a couple of other wikis]]. You can [[:m:Special:MyLanguage/WMDE Technical Wishes/Sub-referencing#test|try the feature]] on these projects or on testwiki and [https://en.wikipedia.beta.wmcloud.org/wiki/Sub-referencing betawiki]. Learnings from the first pilot wiki German Wikipedia have been [[:m:Special:MyLanguage/WMDE Technical Wishes/Sub-referencing/Learnings|published in a report]]. Reach out to the Wikimedia Deutschland team if you are [[:m:Talk:WMDE Technical Wishes/Sub-referencing#Pilot wikis|interested in becoming a pilot wiki]].</span> * <span lang="en" dir="ltr" class="mw-content-ltr">[[mw:Special:MyLanguage/Help:Edit check#Paste check|Paste Check]] will become available at all Wikipedias this week. The feature prompts newcomers who are pasting text they are not likely to have written into VisualEditor to consider whether doing so risks a copyright violation. Paste Check [[mw:Special:MyLanguage/Edit check/Tags|tags]] all edits where it is shown for potential review. Local administrators can configure various aspects of the feature via [[{{#special:EditChecks}}]]. [[mw:Special:MyLanguage/Edit check/Paste Check#A/B Experiment|Research]] across 22 wikis found that Paste Check resulted in an 18% decrease in relative reverted-edits compared to the control group. Translators can [https://translatewiki.net/w/i.php?title=Special%3ATranslate&group=ext-visualeditor-ve-mw-editcheck&filter=&optional=1&action=translate help to localize] this and related features.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The [[mw:Special:MyLanguage/Readers/Reader Experience|Reader Experience team]] will be standardizing the user menu in the top right for all mobile users so that it is closer to the desktop experience. Currently this user menu is only visible to users with Advanced Mobile Controls (AMC) turned on. The only change is that a couple buttons previously in the left-side menu will move to the top right for users who do not have AMC turned on. This change is expected to go out March 9 and seeks to improve the user interface.</span> [https://phabricator.wikimedia.org/T413912] * <span lang="en" dir="ltr" class="mw-content-ltr">Starting in the week of March 2, the emails sent out when an email address was added, removed, or changed for an account will switch to a substantially nicer and clearer HTML email from the prior plaintext one.</span> [https://phabricator.wikimedia.org/T410807] * <span lang="en" dir="ltr" class="mw-content-ltr">Notifications are currently limited to 2,000 historic entries per user, and extend back to 2013 when the feature was released. This is going to be changed to only store Notifications from the last 5 years, but up to 10,000 of them. This will help with long-term infrastructure health and help to prevent more recent notifications from disappearing too soon.</span> [https://phabricator.wikimedia.org/T383948] * <span lang="en" dir="ltr" class="mw-content-ltr">The [[m:Special:GlobalWatchlist|Global Watchlist]] which lets you view your watchlists from multiple wikis on a single page continues to see improvements. The latest update improves label usage experience. The [[mw:Special:MyLanguage/Extension:GlobalWatchlist|extension]] now allows activating the [[mw:Special:MyLanguage/Manual:Language#Fallback languages|language fallback system]] for Wikidata items without labels in the viewed language, and showing those labels in the user’s preferred Wikidata language if no <code dir=ltr>uselang=</code> URL parameter is provided.</span> [https://phabricator.wikimedia.org/T373686][https://phabricator.wikimedia.org/T416111] * <span lang="en" dir="ltr" class="mw-content-ltr">The Wikipedia Android team has started a beta test of [[mw:Special:MyLanguage/Readers/Information Retrieval/Phase 1|hybrid search]] on Greek Wikipedia. Hybrid search capabilities can handle both semantic and keyword queries enabling readers to find what they’re looking for directly on Wikipedia more easily.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">For security reasons, members of certain user groups are [[m:Special:MyLanguage/Mandatory two-factor authentication for users with some extended rights|required to have two-factor authentication]] (2FA) enabled. Currently, 2FA is required to use the group, but not to be a member of it. Given that this model still has some vulnerabilities, the situation will [[phab:T418580|gradually change in March]]. Members of these groups will be unable to disable last 2FA method on their account, and it will be impossible to add users without 2FA to these groups. Users will still be able to add new authentication methods or remove them, as long as at least one method is continuously enabled. In the second half of March, users without 2FA will be removed from these groups. This applies to: CentralNotice administrators, checkusers, interface administrators, suppressors, Wikidata staff, Wikifunctions staff, WMF Office IT and WMF Trust & Safety. Nothing will change for other users. See the linked task for deployment schedule.</span> [https://phabricator.wikimedia.org/T418580] * [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Elemento recurrente]] Revisa las {{formatnum:27}} {{PLURAL:27|tarea enviada|tareas enviadas}} por la comunidad que fueron [[m:Special:MyLanguage/Tech/News/Recently resolved community tasks|resueltas la semana pasada]]. <span lang="en" dir="ltr" class="mw-content-ltr">For example, the issue preventing users from creating an instance in [https://www.wikibase.cloud/ Wikibase.cloud] has now been fixed.</span> [https://phabricator.wikimedia.org/T416807] '''Actualizaciones para los colaboradores técnicos''' * <span lang="en" dir="ltr" class="mw-content-ltr">To help ensure [[mw:Special:MyLanguage/MediaWiki Product Insights/Responsible Reuse|fair use of infrastructure]], over the next month the Wikimedia Foundation will implement global API rate limits across our APIs. In early March, stricter limits will be applied to unidentified requests from outside Toolforge/WMCS and API requests that are made from web browsers. In April, higher limits will be applied to identified traffic. These limits are intentionally set as high as possible to minimise impact on the community. Bots running in Toolforge/WMCS or with the bot user right on any wiki should not be affected for now. However, all developers are advised to follow updated best practices. For more information, see [[mw:Special:MyLanguage/Wikimedia APIs/Rate limits|Wikimedia APIs/Rate limits]].</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The Wikidata Query Service Linked Data Fragment (LDF) endpoint will be decommissioned in February. This endpoint served limited traffic, which was successfully migrated to other data access methods that were better suited to support existing use cases. The hardware used to support the LDF endpoint will be reallocated to support the ongoing backend migration efforts.</span> [https://phabricator.wikimedia.org/T415696] * <span lang="en" dir="ltr" class="mw-content-ltr">The new Parsoid parser [[mw:Special:MyLanguage/Parsoid/Parser Unification/Updates|continues to be deployed to additional wikis]], improving platform sustainability and making it easier to introduce new reading and editing features. Parsoid is now the default parser on 488 WMF wikis (268 Wikipedias), now covering more than 10% of all Wikipedia page views.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">The process and criteria for [[Special:MyLanguage/Wikimedia Enterprise#Access|requesting exceptional access]] to the high volume feed of the ''Wikimedia Enterprise'' APIs (at no cost for mission-aligned usecases), [[m:Talk:Wikimedia Enterprise#Exceptional access criteria|have now been published]]. This is to provide more thorough and clearer documentation for users.</span> * <span lang="en" dir="ltr" class="mw-content-ltr">[https://techblog.wikimedia.org/ Tech Blog], the blog dedicated to the Wikimedia technical community [https://techblog.wikimedia.org/2026/02/24/a-tech-blog-diff/ will be migrating] to [[diffblog:|Diff]], the community news and event blog. The migration should be complete in April 2026, after which new posts will be accepted for publishing. Readers will be able to access posts – old and new – on the landing page at https://diff.wikimedia.org/techblog.</span> * [[File:Reload icon with two arrows.svg|12px|link=|class=skin-invert|Elemento recurrente]] Actualizaciones detalladas de código de esta semana: [[mw:MediaWiki 1.46/wmf.18|MediaWiki]] ''Las '''[[m:Special:MyLanguage/Tech/News|Noticias Técnicas]]''' son preparadas por [[m:Special:MyLanguage/Tech/News/Writers|los escritores de Noticias Técnicas]] y publicadas con un [[m:Special:MyLanguage/User:MediaWiki message delivery|bot]]&nbsp;• [[m:Special:MyLanguage/Tech/News#contribute|Colabore]]&nbsp;• [[m:Special:MyLanguage/Tech/News/2026/10|traduzca]]&nbsp;• [[m:Tech|obtenga ayuda]]&nbsp;• [[m:Talk:Tech/News|denos su opinión]]&nbsp;• [[m:Global message delivery/Targets/Tech ambassadors|suscríbase o cancele su suscripción]].'' </div><section end="technews-2026-W10"/> <bdi lang="en" dir="ltr">[[User:MediaWiki message delivery|MediaWiki message delivery]]</bdi> 17:51 2 mar 2026 (UTC) <!-- Mensaje enviado por Usuario:STei (WMF)@metawiki mediante la lista en https://meta.wikimedia.org/w/index.php?title=Global_message_delivery/Targets/Tech_ambassadors&oldid=30137798 --> == Noruego == Siguiendo las recomendaciones de @[[Usuario:Teodor605|Teodor605]], migré el código <code>no</code> a <code>nb</code>. Por lo que veo, en este proyecto desde siempre se trataron a ambos dialectos como idiomas separados, que fue lo que me llevó después de un año a rechazar la opción de unificar este código con <code>nn</code> (nynorsk). Además, viendo que en en.wikt está la mayor comunidad y contenido de noruego, nos resultará más fácil importar entradas. Este nuevo código estaba prácticamente sin uso previo a la migración, por lo que no requiere ninguna reestructuración masiva como se hizo en su momento con el serbocroata. Les pido que de ahora en adelante usen <code>nb</code> para el noruego bokmål. El código <code>no</code> se da de baja y no debe volver a utilizarse. Si existe la intención de añadir contenido de más dialectos, se agregarán tantos códigos nuevos como sean necesarios. [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 21:47 2 mar 2026 (UTC) :After you have made the change, if you want, I can go through the entries and separate between nb and nn. This might turn out to be a quite daunting task though, so I cannot promise miracles. The lemma forms of an article are more often identical than the inflections. it would help to use some sort of template to annotate the changes. E.g. "This article has been changed from no to nb. If you speak Norwegian please verify if it's correct" and make a category or something that would make it easier for people to find the articles. Btw, I have noticed that at en.wikt they have left the translations that were made from English to "no" as they were. It takes good knowledge of Norwegian to know if they really are only nb, only nn or both. So leaving them as "no" is preferable to changing all of them into "nb". My two cents worth of thinking. [[Usuario:Teodor605|Teodor]] ([[Usuario_Discusión:Teodor605|d]] &bull; [[Especial:Contribuciones/Teodor605|c]]) 07:42 3 mar 2026 (UTC) ::@[[Usuario:Teodor605|Teodor605]] Thanks for your suggestions. However, I don't see any significant change since "no" always standed for bokmål on this project. As I said, in practice the community always used "no" (bokmål) and "nn" (nynorsk), with "nb" unused. Now, I just switched "no" for "nb" (previously empty) and forbid "no". It's true that might someone confused "no" with norweigan, but I reviewed a few entries and I don't see any mistake, so I don't think further changes are needed. If you wan't to exhaustively check all the 2k affected pages, [https://es.wiktionary.org/w/index.php?title=Especial:Contribuciones&end=2026-03-03&namespace=all&start=2026-03-02&tagfilter=&target=TMCbot&offset=20260303042500&limit=500 here are the contributions you have to review] (from 2025-03-02 01:24 to 2025-03-03 18:18). [[Usuario:Tmagc|Tmagc]] ([[Usuario discusión:Tmagc|discusión]]) 21:39 4 mar 2026 (UTC) :::I will scan of your changes. Took a brief look now and it looks very good. What I am most interested in are the articles previously labeled as "no" but in reality are "nn" only. Those are the words which are of course Norwegian but not permitted in Bokmål. SO if any of these have now been assigned "nb" they need to be corrected. [[Usuario:Teodor605|Teodor]] ([[Usuario_Discusión:Teodor605|d]] &bull; [[Especial:Contribuciones/Teodor605|c]]) 07:18 5 mar 2026 (UTC) okrg0g7p98dentrqkrf63a7za717zyi למד 0 1062469 6076621 2026-04-05T00:08:25Z JPDAMAY 176835 Página creada con «== {{lengua|he}} == {{pron-graf |leng=he |ayuda=לָמַד |fnota=etimología 1 |ayuda2=לִמֵּד |2fnota=etimología 2 }} === Etimología 1 === {{etimología|leng=he|bíblico}}. [[Archivo:Lectura a la abuela.jpg|thumb|150px|[1] יַלְדָּה אַחַת '''לוֹמֶדֶת''' לִקְרֹא]] ==== {{verbo transitivo|he}} ==== ;1: {{plm|aprender}}, [[estudiar]]. {{ejemplo|„.'''לָמַדְתִּי''' עִבְרִית בְּגִיל 13”|traducción=«'''Apre…» 6076621 wikitext text/x-wiki == {{lengua|he}} == {{pron-graf |leng=he |ayuda=לָמַד |fnota=etimología 1 |ayuda2=לִמֵּד |2fnota=etimología 2 }} === Etimología 1 === {{etimología|leng=he|bíblico}}. [[Archivo:Lectura a la abuela.jpg|thumb|150px|[1] יַלְדָּה אַחַת '''לוֹמֶדֶת''' לִקְרֹא]] ==== {{verbo transitivo|he}} ==== ;1: {{plm|aprender}}, [[estudiar]]. {{ejemplo|„.'''לָמַדְתִּי''' עִבְרִית בְּגִיל 13”|traducción=«'''Aprendí''' [[hebreo]] [[a]] [[los]] 13 [[año]]s».}} ==== Información adicional ==== :* '''Categoría:''' ''Kal'' ({{l|he|קל|קַל}}) :* '''Infinitivo:''' {{l|he|ללמד|לִלְמֹד}} :* '''Raíz:''' {{l|he|ל־מ־ד}}. === Etimología 2 === {{etimología|leng=he|akk}}. ==== {{verbo transitivo|he}} ==== ;1: {{plm|enseñar}}, [[educar]], [[instruir]]. {{ejemplo|„?לִסָה, הַאִם אַתְּ '''מְלַמֶּדֶת''' אוׂתִי יַפָּנִית”|traducción=«{{plm|Lisa}}, ¿[[me]] '''enseñas''' [[japonés]]?».}} ==== Información adicional ==== :* '''Categoría:''' ''Pi’el'' ({{l|he|פעל| פִּעֵל}}) :* '''Infinitivo:''' {{l|he|ללמד|לְלַמֵּד}} :* '''Raíz:''' {{l|he|ל־מ־ד}}. == Referencias y notas == <references /> lduqsu6tmcumhuuzj84een1a9bfldg1 transedad 0 1062470 6076638 2026-04-05T02:20:07Z Tmagc 158167 Página creada con «{{desambiguación|}} == {{lengua|es}} == {{pron-graf|ayuda=trans-edad}} === Etimología === {{etimología|prefijo|trans|edad}}. ==== {{adjetivo|es}} ==== {{es.adj|inv}} ;1: Que se autopercibe con una edad diferente a la que dicta su naturaleza. {{uso|utcs}} ==== Traducciones ==== {{trad-arriba}} {{trad-abajo}} == Referencias y notas == <references />» 6076638 wikitext text/x-wiki {{desambiguación|}} == {{lengua|es}} == {{pron-graf|ayuda=trans-edad}} === Etimología === {{etimología|prefijo|trans|edad}}. ==== {{adjetivo|es}} ==== {{es.adj|inv}} ;1: Que se autopercibe con una edad diferente a la que dicta su naturaleza. {{uso|utcs}} ==== Traducciones ==== {{trad-arriba}} {{trad-abajo}} == Referencias y notas == <references /> 9ewr0htwmcucyu275xnt6bvrx4ma5zu reginal 0 1062471 6076710 2026-04-05T02:54:12Z Tmagc 158167 Página creada con «{{desambiguación|}} == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología|la-med|reginalis|alt=rēgīnālis}}. ==== {{adjetivo|es}} ==== {{es.adj}} ;1: {{adjetivo de sustantivo|la [[reina]]}}. ==== Traducciones ==== {{trad-arriba}} {{trad-abajo}} == Referencias y notas == <references />» 6076710 wikitext text/x-wiki {{desambiguación|}} == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología|la-med|reginalis|alt=rēgīnālis}}. ==== {{adjetivo|es}} ==== {{es.adj}} ;1: {{adjetivo de sustantivo|la [[reina]]}}. ==== Traducciones ==== {{trad-arriba}} {{trad-abajo}} == Referencias y notas == <references /> a6whgl4i7zeoqyfhypcfvu142b7pupc 6076714 6076710 2026-04-05T03:30:48Z Tmagc 158167 6076714 wikitext text/x-wiki {{desambiguación|}} == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología|la-med|reginalis|alt=rēgīnālis}}. ==== {{adjetivo|es}} ==== {{es.adj}} ;1: {{adjetivo de sustantivo|la [[reina]]}}. ==== Información adicional ==== {{masculino|real}} ==== Traducciones ==== {{trad-arriba}} {{trad-abajo}} == Referencias y notas == <references /> lylan3lu6p8kz3uqcga4iantb468aoa reginalidad 0 1062472 6076711 2026-04-05T02:55:55Z Tmagc 158167 Página creada con «{{desambiguación|}} == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología|sufijo|reginal|idad}}. ==== {{sustantivo femenino|es}} ==== {{es.sust|s}} ;1: {{sustantivo de adjetivo|reina}}.<ref>{{referencia|c=libro|t=Urraca|p=26|u=https://www.google.com.ar/books/edition/Urraca/fsfAEQAAQBAJ?hl=es-419&gbpv=1&dq=reginalidad&pg=PT26&printsec=frontcover|a=Sonia Vital Fernández|f=2026|isbn=9791399149838}}</ref> ==== Traducciones ==== {{trad-arriba}} {{trad-a…» 6076711 wikitext text/x-wiki {{desambiguación|}} == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología|sufijo|reginal|idad}}. ==== {{sustantivo femenino|es}} ==== {{es.sust|s}} ;1: {{sustantivo de adjetivo|reina}}.<ref>{{referencia|c=libro|t=Urraca|p=26|u=https://www.google.com.ar/books/edition/Urraca/fsfAEQAAQBAJ?hl=es-419&gbpv=1&dq=reginalidad&pg=PT26&printsec=frontcover|a=Sonia Vital Fernández|f=2026|isbn=9791399149838}}</ref> ==== Traducciones ==== {{trad-arriba}} {{trad-abajo}} == Referencias y notas == <references /> b7vg6orzj3o9filck853m4sayk3fzeb salaz 0 1062473 6076715 2026-04-05T03:36:11Z Tmagc 158167 Página creada con «{{desambiguación|Salaz}} == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología|la|salax|alt=salācis}}. ==== {{adjetivo|es}} ==== {{es.adj}} ;1: {{plm|lujurioso}}. {{sinónimo|lujurioso|lascivo|concupiscente}} ==== Traducciones ==== {{trad-arriba}} {{trad-abajo}} == Referencias y notas == <references />» 6076715 wikitext text/x-wiki {{desambiguación|Salaz}} == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología|la|salax|alt=salācis}}. ==== {{adjetivo|es}} ==== {{es.adj}} ;1: {{plm|lujurioso}}. {{sinónimo|lujurioso|lascivo|concupiscente}} ==== Traducciones ==== {{trad-arriba}} {{trad-abajo}} == Referencias y notas == <references /> drz9usp1ma4vy5iw0qqck2s3j6sfslx veintitantos 0 1062474 6076722 2026-04-05T04:05:30Z Tmagc 158167 Página creada con «{{desambiguación|}} == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología}}. ==== {{adjetivo cardinal|es}} ==== {{es.adj|p}} ;1: Entre venite y treinta (años). {{ejemplo|Lo ayuda una de sus hijas, Lore, la mayor, que ya tiene '''veintitantos'''; la menor, Gini, me dice, se fue a vivir con Goa.|c=libro|t=Sinfín|a=Martín Caparrós|f=2020|isbn=9789877691030|editorial=Penguin Random House|p=314|parte=4|cap=6}} ==== Traducciones ==== {{trad-arriba}} {…» 6076722 wikitext text/x-wiki {{desambiguación|}} == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología}}. ==== {{adjetivo cardinal|es}} ==== {{es.adj|p}} ;1: Entre venite y treinta (años). {{ejemplo|Lo ayuda una de sus hijas, Lore, la mayor, que ya tiene '''veintitantos'''; la menor, Gini, me dice, se fue a vivir con Goa.|c=libro|t=Sinfín|a=Martín Caparrós|f=2020|isbn=9789877691030|editorial=Penguin Random House|p=314|parte=4|cap=6}} ==== Traducciones ==== {{trad-arriba}} {{trad-abajo}} == Referencias y notas == <references /> j98n4wulnfsuw45dde44f27md18hyrh 6076723 6076722 2026-04-05T04:05:53Z Tmagc 158167 /* Etimología */ 6076723 wikitext text/x-wiki {{desambiguación|}} == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología|compuesto|veinte|tanto}}. ==== {{adjetivo cardinal|es}} ==== {{es.adj|p}} ;1: Entre venite y treinta (años). {{ejemplo|Lo ayuda una de sus hijas, Lore, la mayor, que ya tiene '''veintitantos'''; la menor, Gini, me dice, se fue a vivir con Goa.|c=libro|t=Sinfín|a=Martín Caparrós|f=2020|isbn=9789877691030|editorial=Penguin Random House|p=314|parte=4|cap=6}} ==== Traducciones ==== {{trad-arriba}} {{trad-abajo}} == Referencias y notas == <references /> ff53uzryzmiz5ppv8zzwsmx9lmluwgb interpretador 0 1062475 6076726 2026-04-05T04:18:34Z Tmagc 158167 Página creada con «{{desambiguación|}} == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología|sufijo|interpretar|dor}}. ==== {{adjetivo|es}} ==== {{es.adj}} ;1: {{variante rara|intérprete}}.<ref>{{DLE1925}}</ref> ;2: {{plm|traductor}}. {{uso|anticuado}} == Referencias y notas == <references />» 6076726 wikitext text/x-wiki {{desambiguación|}} == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología|sufijo|interpretar|dor}}. ==== {{adjetivo|es}} ==== {{es.adj}} ;1: {{variante rara|intérprete}}.<ref>{{DLE1925}}</ref> ;2: {{plm|traductor}}. {{uso|anticuado}} == Referencias y notas == <references /> ephhkh4zixg54qke1zq10rdkt3aw5x5 ortognático 0 1062476 6076727 2026-04-05T04:25:32Z JPDAMAY 176835 Página creada con «{{desambiguación|ortognatico}} == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología|grc|ὀρθός|glosa=recto||grc|γνάθος|glosa2=mandíbula}}. ==== {{adjetivo|es}} ==== {{es.adj}} ;1: {{plm|perteneciente}} o [[relativo]] a la [[ortognática|cirugía ortognática]]. ==== Locuciones ==== * [[cirugía ortognática]] ==== Traducciones ==== {{trad-arriba}} {{t|ca|a1=1|t1=ortognàstic}} {{t|gl|a1=1|t1=ortognático}} {{t|el|a1=1|t1=ορθογνα…» 6076727 wikitext text/x-wiki {{desambiguación|ortognatico}} == {{lengua|es}} == {{pron-graf}} === Etimología === {{etimología|grc|ὀρθός|glosa=recto||grc|γνάθος|glosa2=mandíbula}}. ==== {{adjetivo|es}} ==== {{es.adj}} ;1: {{plm|perteneciente}} o [[relativo]] a la [[ortognática|cirugía ortognática]]. ==== Locuciones ==== * [[cirugía ortognática]] ==== Traducciones ==== {{trad-arriba}} {{t|ca|a1=1|t1=ortognàstic}} {{t|gl|a1=1|t1=ortognático}} {{t|el|a1=1|t1=ορθογναθικός}} {{t|en|a1=1|t1=orthognatic}} {{t|it|a1=1|t1=ortognatico}} {{t|pt|a1=1|t1=ortognático}} {{trad-abajo}} == {{lengua|gl}} == {{pron-graf|leng=gl}} === Etimología === {{etimología|leng=gl|grc|ὀρθός|glosa=recto||grc|γνάθος|glosa2=mandíbula}}. ==== {{adjetivo|gl}} ==== {{gl.adj}} ;1: {{plm}}. ==== Locuciones ==== * {{l|gl|cirurxía ortognática}} == {{lengua|pt}} == {{pron-graf|leng=pt}} === Etimología === {{etimología|leng=pt|grc|ὀρθός|glosa=recto||grc|γνάθος|glosa2=mandíbula}}. ==== {{adjetivo|pt}} ==== {{pt.adj}} ;1: {{plm}}. ==== Locuciones ==== * {{l|pt|cirurgia ortognática}} == Referencias y notas == <references /> owcs64wkxw2ipmqrogsebiwrauudvg2 ludibrium 0 1062477 6076730 2026-04-05T06:01:19Z JPDAMAY 176835 Página creada con «== {{lengua|la}} == {{pron-graf|leng=la|ayuda=lūdibrium|alt=lūdibrium}} === Etimología === {{etimología|leng=la|endo|ludus}}. ==== {{sustantivo neutro|la}} ==== ;1: {{plm|burla}}, [[mofa]], [[ludibrio]], [[escarnio]]. ;2: {{plm|desenfreno}}, [[intemperancia]]. ;3: {{plm|hazmerreír}}. ;4: {{plm|juguete}}, [[trebejo]]. ==== Declinación ==== {{la.sust|lūdibrium.2|g1=n}} ==== Descendientes ==== {{trad-arriba|Descendientes de «lūdibrium»}} {{d|es|niv=1|d1=…» 6076730 wikitext text/x-wiki == {{lengua|la}} == {{pron-graf|leng=la|ayuda=lūdibrium|alt=lūdibrium}} === Etimología === {{etimología|leng=la|endo|ludus}}. ==== {{sustantivo neutro|la}} ==== ;1: {{plm|burla}}, [[mofa]], [[ludibrio]], [[escarnio]]. ;2: {{plm|desenfreno}}, [[intemperancia]]. ;3: {{plm|hazmerreír}}. ;4: {{plm|juguete}}, [[trebejo]]. ==== Declinación ==== {{la.sust|lūdibrium.2|g1=n}} ==== Descendientes ==== {{trad-arriba|Descendientes de «lūdibrium»}} {{d|es|niv=1|d1=ludibrio}}. {{d|gl|niv=1|d1=ludibrio}}. {{d|it|niv=1|d1=ludibrio}}. {{d|pt|niv=1|d1=ludíbrio}}. {{trad-abajo}} ==== Véase también ==== {{w|idioma=la}} == Referencias y notas == <references /> r2yl85a4y9hs4bqo34880dwy4fa7z6i laughing stock 0 1062478 6076731 2026-04-05T06:16:23Z JPDAMAY 176835 Página creada con «== {{lengua|en}} == {{pron-graf |leng=en |fono=ˈlʌfɪŋ ˌstɑːk |2fono=ˈlʌfɪŋ ˌstɒk |pron=General American |2pron=Received Pronunciation |alt={{l|en|laugh|laughing}} {{l|en|stock}} }} === Etimología === {{etimología|leng=en}}. ==== {{locución|en}} ==== {{en.sust|1|cop=s}} ;1: {{plm|hazmerreír}}. {{ejemplo|“{{l|en|pray|Pray}} {{l|en|you}} {{l|en|let}} {{l|en|us}} {{l|en|not}} {{l|en|be}} <br> '''laughing-stocks''' {{l|en|to}} {{l|en|other}} {{l|en|man…» 6076731 wikitext text/x-wiki == {{lengua|en}} == {{pron-graf |leng=en |fono=ˈlʌfɪŋ ˌstɑːk |2fono=ˈlʌfɪŋ ˌstɒk |pron=General American |2pron=Received Pronunciation |alt={{l|en|laugh|laughing}} {{l|en|stock}} }} === Etimología === {{etimología|leng=en}}. ==== {{locución|en}} ==== {{en.sust|1|cop=s}} ;1: {{plm|hazmerreír}}. {{ejemplo|“{{l|en|pray|Pray}} {{l|en|you}} {{l|en|let}} {{l|en|us}} {{l|en|not}} {{l|en|be}} <br> '''laughing-stocks''' {{l|en|to}} {{l|en|other}} {{l|en|man|men’s}} {{l|en|humour|humours}}.”|traducción=«{{plm|os}} [[implorar|imploramos]] [[que]] [[no]] [[nos]] [[dejar|dejéis]] [[ser]] <br>[[el]] '''hazmerreír''' [[de]] [[aquellos]] [[de]] [[agrio]] [[humor]]».|a={{versalita|[[w:William Shakespeare|William Shakespeare]]}}|t=Mr. William Shakespeares Comedies, Histories, & Tragedies|cap=The Merry Wiues of Windsor|p=|f=1597|c=libro}} ==== Véase también ==== {{w|idioma=en}} == Referencias y notas == <references /> h2294fn05jcnmpwsr88fxudcf2sm12b plüm 0 1062479 6076733 2026-04-05T06:58:19Z Apisite 115465 Página creada con «== {{lengua|vo}} == {{pron-graf|leng=vo}} === Etimología === {{etimología|leng=vo}}. === {{sustantivo|vo}} === ;1: {{plm|pluma}}. ==== Declinación ==== {{vo.sust}} == Referencias y notas == <references />» 6076733 wikitext text/x-wiki == {{lengua|vo}} == {{pron-graf|leng=vo}} === Etimología === {{etimología|leng=vo}}. === {{sustantivo|vo}} === ;1: {{plm|pluma}}. ==== Declinación ==== {{vo.sust}} == Referencias y notas == <references /> nv3vshpukvn9ovgnq608xupiphv4t75 Categoría:FR:Adverbios invariables 14 1062480 6076738 2026-04-05T11:57:14Z Adelpine 34679 Crea categoría 6076738 wikitext text/x-wiki {{auto cat}} eomzlm5v4j7ond1phrju7cnue91g5qx