Spaces:
Sleeping
Sleeping
GuillermoPuma
commited on
Commit
·
9b458b6
1
Parent(s):
004c1ec
add files
Browse files- app.py +183 -18
- models/__pycache__/variables_globales.cpython-37.pyc +0 -0
- models/app2.py +21 -0
- models/model.py +78 -0
- models/plantillas_codigo.py +628 -0
- models/variables_globales.py +150 -0
- requirements.txt +2 -1
- wav/andreabravo.wav +0 -0
- wav/asignar_a_c.wav +0 -0
- wav/asignar_c_b.wav +0 -0
- wav/bravoigual.wav +0 -0
- wav/comentario.wav +0 -0
- wav/comentario2.wav +0 -0
- wav/definir_var_andrea.wav +0 -0
- wav/definira.wav +0 -0
- wav/definirandrea.wav +0 -0
- wav/definirb.wav +0 -0
- wav/funcion.wav +0 -0
- wav/iteracion.wav +0 -0
- wav/llamada.wav +0 -0
- wav/regresa.wav +0 -0
- wav/regresarandrea.wav +0 -0
- wav/terminar_bloque.wav +0 -0
app.py
CHANGED
|
@@ -1,21 +1,186 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from transformers import pipeline
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# cargamos el modelo de huggingsound
|
| 2 |
+
import re
|
| 3 |
+
import unidecode
|
| 4 |
+
#from huggingsound import SpeechRecognitionModel
|
| 5 |
+
from models.model import *
|
| 6 |
+
from models.plantillas_codigo import *
|
| 7 |
+
from models.variables_globales import *
|
| 8 |
+
|
| 9 |
from transformers import pipeline
|
| 10 |
import gradio as gr
|
| 11 |
|
| 12 |
+
# creación del modelo
|
| 13 |
+
# model = SpeechRecognitionModel("patrickvonplaten/wav2vec2-large-xlsr-53-spanish-with-lm")
|
| 14 |
+
p = pipeline("automatic-speech-recognition", "patrickvonplaten/wav2vec2-large-xlsr-53-spanish-with-lm")
|
| 15 |
+
|
| 16 |
+
tabla='''
|
| 17 |
+
<style type="text/css">
|
| 18 |
+
.tg {border-collapse:collapse;border-spacing:0;}
|
| 19 |
+
.tg td{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
|
| 20 |
+
overflow:hidden;padding:10px 5px;word-break:normal;}
|
| 21 |
+
.tg th{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
|
| 22 |
+
font-weight:normal;overflow:hidden;padding:10px 5px;word-break:normal;}
|
| 23 |
+
.tg .tg-r31x{color:#ffffff;text-align:center;vertical-align:top}
|
| 24 |
+
.tg .tg-urxo{border-color:#ffffff;color:#ffffff;text-align:center;vertical-align:top}
|
| 25 |
+
.tg .tg-iejp{border-color:#ffffff;color:#ffffff;font-weight:bold;text-align:center;vertical-align:top}
|
| 26 |
+
</style>
|
| 27 |
+
<table class="tg">
|
| 28 |
+
<thead>
|
| 29 |
+
<tr>
|
| 30 |
+
<th class="tg-iejp">Fonético</th>
|
| 31 |
+
<th class="tg-r31x">andrea</th>
|
| 32 |
+
<th class="tg-r31x">bravo</th>
|
| 33 |
+
<th class="tg-r31x">carlos</th>
|
| 34 |
+
<th class="tg-r31x">delta</th>
|
| 35 |
+
<th class="tg-r31x">eduardo</th>
|
| 36 |
+
<th class="tg-r31x">fernando</th>
|
| 37 |
+
<th class="tg-r31x">garcia</th>
|
| 38 |
+
<th class="tg-r31x">hotel</th>
|
| 39 |
+
<th class="tg-r31x">india</th>
|
| 40 |
+
<th class="tg-r31x">julieta</th>
|
| 41 |
+
<th class="tg-r31x">kilo</th>
|
| 42 |
+
<th class="tg-r31x">lima</th>
|
| 43 |
+
<th class="tg-r31x">miguel</th>
|
| 44 |
+
<th class="tg-r31x">noviembre</th>
|
| 45 |
+
</tr>
|
| 46 |
+
</thead>
|
| 47 |
+
<tbody>
|
| 48 |
+
<tr>
|
| 49 |
+
<td class="tg-iejp">Letra</td>
|
| 50 |
+
<td class="tg-r31x">a</td>
|
| 51 |
+
<td class="tg-r31x">b</td>
|
| 52 |
+
<td class="tg-r31x">c</td>
|
| 53 |
+
<td class="tg-r31x">d</td>
|
| 54 |
+
<td class="tg-r31x">e</td>
|
| 55 |
+
<td class="tg-r31x">f</td>
|
| 56 |
+
<td class="tg-r31x">g</td>
|
| 57 |
+
<td class="tg-r31x">h</td>
|
| 58 |
+
<td class="tg-r31x">i</td>
|
| 59 |
+
<td class="tg-r31x">j</td>
|
| 60 |
+
<td class="tg-r31x">k</td>
|
| 61 |
+
<td class="tg-r31x">l</td>
|
| 62 |
+
<td class="tg-r31x">m</td>
|
| 63 |
+
<td class="tg-r31x">n</td>
|
| 64 |
+
</tr>
|
| 65 |
+
<tr>
|
| 66 |
+
<td class="tg-urxo"></td>
|
| 67 |
+
<td class="tg-r31x"></td>
|
| 68 |
+
<td class="tg-r31x"></td>
|
| 69 |
+
<td class="tg-r31x"></td>
|
| 70 |
+
<td class="tg-r31x"></td>
|
| 71 |
+
<td class="tg-r31x"></td>
|
| 72 |
+
<td class="tg-r31x"></td>
|
| 73 |
+
<td class="tg-r31x"></td>
|
| 74 |
+
<td class="tg-r31x"></td>
|
| 75 |
+
<td class="tg-r31x"></td>
|
| 76 |
+
<td class="tg-r31x"></td>
|
| 77 |
+
<td class="tg-r31x"></td>
|
| 78 |
+
<td class="tg-r31x"></td>
|
| 79 |
+
<td class="tg-r31x"></td>
|
| 80 |
+
<td class="tg-r31x"></td>
|
| 81 |
+
</tr>
|
| 82 |
+
<tr>
|
| 83 |
+
<td class="tg-iejp">Fonético</td>
|
| 84 |
+
<td class="tg-r31x">oscar</td>
|
| 85 |
+
<td class="tg-r31x">papa</td>
|
| 86 |
+
<td class="tg-r31x">queretaro</td>
|
| 87 |
+
<td class="tg-r31x">romero</td>
|
| 88 |
+
<td class="tg-r31x">sierra</td>
|
| 89 |
+
<td class="tg-r31x">tango</td>
|
| 90 |
+
<td class="tg-r31x">uniforme</td>
|
| 91 |
+
<td class="tg-r31x">victor</td>
|
| 92 |
+
<td class="tg-r31x">waffle</td>
|
| 93 |
+
<td class="tg-r31x">equis</td>
|
| 94 |
+
<td class="tg-r31x">yarda</td>
|
| 95 |
+
<td class="tg-r31x">zapato</td>
|
| 96 |
+
<td class="tg-r31x"></td>
|
| 97 |
+
<td class="tg-r31x"></td>
|
| 98 |
+
</tr>
|
| 99 |
+
<tr>
|
| 100 |
+
<td class="tg-iejp">Letra</td>
|
| 101 |
+
<td class="tg-r31x">o</td>
|
| 102 |
+
<td class="tg-r31x">p</td>
|
| 103 |
+
<td class="tg-r31x">q</td>
|
| 104 |
+
<td class="tg-r31x">r</td>
|
| 105 |
+
<td class="tg-r31x">s</td>
|
| 106 |
+
<td class="tg-r31x">t</td>
|
| 107 |
+
<td class="tg-r31x">u</td>
|
| 108 |
+
<td class="tg-r31x">v</td>
|
| 109 |
+
<td class="tg-r31x">w</td>
|
| 110 |
+
<td class="tg-r31x">x</td>
|
| 111 |
+
<td class="tg-r31x">y</td>
|
| 112 |
+
<td class="tg-r31x">z</td>
|
| 113 |
+
<td class="tg-r31x"></td>
|
| 114 |
+
<td class="tg-r31x"></td>
|
| 115 |
+
</tr>
|
| 116 |
+
</tbody>
|
| 117 |
+
</table>
|
| 118 |
+
'''
|
| 119 |
+
|
| 120 |
+
|
| 121 |
+
# Variables globales
|
| 122 |
+
bloque = '' # Define el contexto (si es función, condicional, ciclo, etc.)
|
| 123 |
+
codigo = None # Guarda el código hasta el momento
|
| 124 |
+
indentacion = 0 # Nivel de indentación
|
| 125 |
+
linea_codigo = 0 # Esto para dar seguimiento al eliminado de una linea
|
| 126 |
+
recomendacion = ""
|
| 127 |
+
# fin_de_bloque=False
|
| 128 |
+
|
| 129 |
+
import gradio as gr
|
| 130 |
+
|
| 131 |
+
def transcribe(audio, Español, Codigo_Python):
|
| 132 |
+
global bloque
|
| 133 |
+
global codigo
|
| 134 |
+
global indentacion
|
| 135 |
+
|
| 136 |
+
#transcriptions_es = model.transcribe([audio])[0]
|
| 137 |
+
transcriptions_es = p([audio])['text']
|
| 138 |
+
|
| 139 |
+
# quitamos el acento de la transcripcion
|
| 140 |
+
frase = unidecode.unidecode(transcriptions_es).lower()
|
| 141 |
+
|
| 142 |
+
# print(frase)
|
| 143 |
+
if not bloque:
|
| 144 |
+
# Significa que es la primera vez
|
| 145 |
+
codigo = main(frase)
|
| 146 |
+
else:
|
| 147 |
+
codigo = agregar_adentro(codigo, frase)
|
| 148 |
+
|
| 149 |
+
return codigo, frase
|
| 150 |
+
|
| 151 |
+
inputs = gr.inputs.Audio(label="Dar click para grabar tu voz", type="filepath", source="microphone")
|
| 152 |
+
output1 = gr.outputs.Textbox(label="Asi se ve tu código")
|
| 153 |
+
output2 = gr.outputs.Textbox(label="Lo que entendió la caracola fue:")
|
| 154 |
+
|
| 155 |
+
title = "Caracola App"
|
| 156 |
+
description = '<p style="color:white">Aplicación que ayuda a programar a traves de tu voz.\nSe usa el siguiente diccionario fonético para capturar las variables de una letra.</p>'+tabla+'<br> <h3 style="color:white"> Instrucciones </h3> <p style="color:white"> Selecciona uno de los ejemplos y da click en enviar para convertir comandos de voz en código! </p>'
|
| 157 |
+
# ,'mientras variable alpha es menor igual a numero dos'
|
| 158 |
+
# ,'Definir variable con nombre india igual a numero uno'
|
| 159 |
+
input2 = gr.inputs.Textbox(lines=0, placeholder="Aqui aparece el texto en español de los ejemplos")
|
| 160 |
+
input3 = gr.inputs.Textbox(lines=0, placeholder="Aqui aparece el codigo en python de los ejemplos")
|
| 161 |
+
|
| 162 |
+
output_html = gr.outputs.HTML(label='Asi se ve tu código:')
|
| 163 |
+
|
| 164 |
+
examples = [
|
| 165 |
+
['./wav/comentario.wav','agregar comentario mi primer función', '# mi primer funcion'],
|
| 166 |
+
['./wav/funcion.wav','definir función con nombre mágica y parámetros noviembre', 'def magica(n):'],
|
| 167 |
+
['./wav/definira.wav','definir variable con nombre andrea igual a natural cero', 'a=0'],
|
| 168 |
+
['./wav/definirb.wav','definir variable con nombre bravo igual a natural uno', 'b = 1'],
|
| 169 |
+
['./wav/iteracion.wav','ejecuta iteracion para india en un rango noviembre', 'for i in range(n)'],
|
| 170 |
+
['./wav/asignar_c_b.wav','asignar variable carlos con bravo', 'c=b'],
|
| 171 |
+
['./wav/andreabravo.wav','asignar variable bravo con andrea mas bravo', 'b = a + b'],
|
| 172 |
+
['./wav/asignar_a_c.wav','asignar variable andrea con carlos', 'a=c'],
|
| 173 |
+
['./wav/terminar_bloque.wav','terminar bloque',''],
|
| 174 |
+
['./wav/comentario2.wav','agregar comentario fin de ciclo', '# fin de ciclo'],
|
| 175 |
+
['./wav/regresa.wav','regresa variable andrea', 'return a'],
|
| 176 |
+
['./wav/llamada.wav', 'ejecuta mágica con argumentos diez', 'magica(10)']
|
| 177 |
+
]
|
| 178 |
+
|
| 179 |
+
article = "<a style='color:#eb9f59;' href = 'https://github.com/gandres-dev/Hackaton-Common-Voice'> Repositorio de la app"
|
| 180 |
+
demo = gr.Interface(fn=transcribe, inputs=[inputs, input2, input3], outputs=[output_html,output2],
|
| 181 |
+
examples=examples,
|
| 182 |
+
title=title, description=description, article=article,
|
| 183 |
+
allow_flagging="never", theme="darkpeach",
|
| 184 |
+
)
|
| 185 |
+
|
| 186 |
+
demo.launch()
|
models/__pycache__/variables_globales.cpython-37.pyc
ADDED
|
Binary file (2.75 kB). View file
|
|
|
models/app2.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import pipeline
|
| 2 |
+
import gradio as gr
|
| 3 |
+
|
| 4 |
+
p = pipeline("automatic-speech-recognition")
|
| 5 |
+
|
| 6 |
+
def transcribe(audio, state=""):
|
| 7 |
+
text = p(audio)["text"]
|
| 8 |
+
state += text + " "
|
| 9 |
+
return state, state
|
| 10 |
+
|
| 11 |
+
gr.Interface(
|
| 12 |
+
fn=transcribe,
|
| 13 |
+
inputs=[
|
| 14 |
+
gr.inputs.Audio(source="microphone", type="filepath"),
|
| 15 |
+
"state"
|
| 16 |
+
],
|
| 17 |
+
outputs=[
|
| 18 |
+
"textbox",
|
| 19 |
+
"state"
|
| 20 |
+
],
|
| 21 |
+
live=True).launch()
|
models/model.py
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def sim_jac(s1, s2):
|
| 2 |
+
|
| 3 |
+
bigrams_s1 = []
|
| 4 |
+
bigrams_s2 = []
|
| 5 |
+
|
| 6 |
+
for i in range(len(s1) - 1):
|
| 7 |
+
bigrams_s1.append(s1[i:i+2])
|
| 8 |
+
|
| 9 |
+
for i in range(len(s2) - 1):
|
| 10 |
+
bigrams_s2.append(s2[i:i+2])
|
| 11 |
+
|
| 12 |
+
c_common = 0
|
| 13 |
+
|
| 14 |
+
for i in bigrams_s1:
|
| 15 |
+
if bigrams_s2.count(i) > 0:
|
| 16 |
+
c_common += 1
|
| 17 |
+
|
| 18 |
+
return c_common / ((len(s1) - 1) + (len(s2) - 1) - c_common)
|
| 19 |
+
|
| 20 |
+
def encontrar_palabras(transcript,cjto_palabras):
|
| 21 |
+
'''
|
| 22 |
+
Toma un string (en minúsculas) y un conjunto de palabras. Busca el primer match
|
| 23 |
+
de cjto_palabras en transcript y particiona el string en:
|
| 24 |
+
1. El slice de la cadena antes del primer match (antes_palabra)
|
| 25 |
+
2. La cadena del primer match (coincidencia de cjto_palabras)
|
| 26 |
+
3. El slice de la cadena después del match (despues_palabra)
|
| 27 |
+
'''
|
| 28 |
+
inicio,final=list(re.finditer(r'|'.join(cjto_palabras),transcript))[0].span()
|
| 29 |
+
antes_palabra=transcript[:inicio].strip()
|
| 30 |
+
despues_palabra=transcript[final:].strip()
|
| 31 |
+
palabra=transcript[inicio:final]
|
| 32 |
+
return antes_palabra,palabra,despues_palabra
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
def agregar_adentro(codigo, transcipcion):
|
| 36 |
+
codigo2 = main(transcipcion)
|
| 37 |
+
|
| 38 |
+
return codigo[:-1] + codigo2
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
import numpy as np
|
| 42 |
+
|
| 43 |
+
def main(instruccion):
|
| 44 |
+
global bloque
|
| 45 |
+
|
| 46 |
+
plantillas = [
|
| 47 |
+
crear_funcion,
|
| 48 |
+
crear_condicional,
|
| 49 |
+
crear_condicional,
|
| 50 |
+
asignar_variable,
|
| 51 |
+
crear_variable,
|
| 52 |
+
crear_llamada,
|
| 53 |
+
crear_for,
|
| 54 |
+
fin_de_bloque,
|
| 55 |
+
crear_comentario,
|
| 56 |
+
crear_regresa
|
| 57 |
+
]
|
| 58 |
+
|
| 59 |
+
comandos = [set(['definir', 'funcion', 'parametros']),
|
| 60 |
+
set(['mientras']),
|
| 61 |
+
set(['si']), # si se cumple / mientras se cumpla
|
| 62 |
+
set(['asignar', 'con']),
|
| 63 |
+
set(['definir', 'variable']),
|
| 64 |
+
set(['ejecuta', 'argumentos']),
|
| 65 |
+
set(['para', 'rango']),
|
| 66 |
+
set(['terminar','bloque']),
|
| 67 |
+
set(['comentario']),
|
| 68 |
+
set(['regresa'])
|
| 69 |
+
|
| 70 |
+
]
|
| 71 |
+
|
| 72 |
+
J = []
|
| 73 |
+
for comando in comandos:
|
| 74 |
+
J.append(len(set(instruccion.strip().split(' ')).intersection(comando)) / len(set(instruccion.strip().split(' ')).union(comando)))
|
| 75 |
+
# print(J,np.argmax(J))
|
| 76 |
+
pos_func=np.argmax(J)
|
| 77 |
+
# print(pos_func)
|
| 78 |
+
return plantillas[pos_func](instruccion)
|
models/plantillas_codigo.py
ADDED
|
@@ -0,0 +1,628 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import re
|
| 2 |
+
|
| 3 |
+
def crear_funcion(instruccion):
|
| 4 |
+
"""
|
| 5 |
+
Crea el template de la estructura de una función
|
| 6 |
+
|
| 7 |
+
Parametros
|
| 8 |
+
----------
|
| 9 |
+
instrucion: str
|
| 10 |
+
La intruccion de voz en texto.
|
| 11 |
+
|
| 12 |
+
Regresa
|
| 13 |
+
---------
|
| 14 |
+
output: str
|
| 15 |
+
Codigo generado
|
| 16 |
+
recomendacion: str
|
| 17 |
+
Una sugerencia o fallo
|
| 18 |
+
"""
|
| 19 |
+
|
| 20 |
+
global indentacion
|
| 21 |
+
global recomendacion
|
| 22 |
+
global bloque
|
| 23 |
+
|
| 24 |
+
bloque='funcion'
|
| 25 |
+
|
| 26 |
+
# guarda los avisos o recomendaciones que el programa te hace
|
| 27 |
+
recomendacion = ''
|
| 28 |
+
|
| 29 |
+
# guarda la línea de código
|
| 30 |
+
output = ''
|
| 31 |
+
|
| 32 |
+
# pivote que ayuda a definir el nombre de una función
|
| 33 |
+
before_keyword, keyword, after_keyword = instruccion.partition('nombre')
|
| 34 |
+
|
| 35 |
+
# verifica que haya o esté escrita la frase "nombre"
|
| 36 |
+
if len(after_keyword) == 0:
|
| 37 |
+
recomendacion = f'¡No me dijiste el nombre de la función!'
|
| 38 |
+
|
| 39 |
+
# de otro modo, si tiene nombre la función
|
| 40 |
+
else:
|
| 41 |
+
|
| 42 |
+
# obtenemos el nombre de la función por el usuario
|
| 43 |
+
name_func = after_keyword.split(' ')[1]
|
| 44 |
+
|
| 45 |
+
# verificamos si no desea poner parametros
|
| 46 |
+
if instruccion.strip().split(' ')[-1] == name_func:
|
| 47 |
+
parametros = ''
|
| 48 |
+
|
| 49 |
+
# de otro modo, si desea una función con parámetros
|
| 50 |
+
else:
|
| 51 |
+
before_keyword, keyword, after_keyword = instruccion.partition('parametros')
|
| 52 |
+
|
| 53 |
+
# verifica que si exista el nombre de los parámetros
|
| 54 |
+
if len(after_keyword) == 0:
|
| 55 |
+
parametros = ''
|
| 56 |
+
recomendacion = f'¡No me dijiste el nombre de los parámetros!'
|
| 57 |
+
|
| 58 |
+
# escribe como parámetros todo lo que está después de "parámetros"
|
| 59 |
+
else:
|
| 60 |
+
candidatos = []
|
| 61 |
+
cadena_separada = after_keyword.strip().split(' ')
|
| 62 |
+
|
| 63 |
+
for palabra in cadena_separada:
|
| 64 |
+
try:
|
| 65 |
+
candidatos.append(diccionario_fonetico[palabra])
|
| 66 |
+
except:
|
| 67 |
+
continue
|
| 68 |
+
|
| 69 |
+
if len(candidatos) == 0:
|
| 70 |
+
parametros = after_keyword.split(' ')[1:]
|
| 71 |
+
parametros = ', '.join(parametros)
|
| 72 |
+
|
| 73 |
+
else:
|
| 74 |
+
parametros = ', '.join(candidatos)
|
| 75 |
+
|
| 76 |
+
# indenta aunque marque que detecte que no le dije parámetros
|
| 77 |
+
if not recomendacion or recomendacion == '¡No me dijiste el nombre de los parámetros!':
|
| 78 |
+
indentacion += 1
|
| 79 |
+
|
| 80 |
+
# concatenación del nombre y parámetros de la función
|
| 81 |
+
output = f'<span style="color: #008000; font-weight: bold">def</span> <span style="color: #0066bb; font-weight: bold">{name_func}</span>({parametros}):<br>' + ' ' * indentacion + '|'
|
| 82 |
+
return output
|
| 83 |
+
|
| 84 |
+
import re
|
| 85 |
+
def encontrar_palabras(transcript,cjto_palabras):
|
| 86 |
+
|
| 87 |
+
"""
|
| 88 |
+
Toma un string (en minúsculos) y un conjunto de palabras. Busca el primer match
|
| 89 |
+
de cjto_palabras en transcript y particiona el string
|
| 90 |
+
|
| 91 |
+
Parametros
|
| 92 |
+
----------
|
| 93 |
+
transcript: str
|
| 94 |
+
La intruccion de voz en texto ya en minúsculas.
|
| 95 |
+
cjto_palabras: list(str)
|
| 96 |
+
Lista de strings donde se comienza a dividir el transcript original
|
| 97 |
+
|
| 98 |
+
Regresa
|
| 99 |
+
---------
|
| 100 |
+
output: list(str)
|
| 101 |
+
[antes_palabra,palabra,despues_palabra]
|
| 102 |
+
|
| 103 |
+
antes_palabra: string que está antes de la palabra de interés (de cjto_palabras)
|
| 104 |
+
palabra: string que da la palabra clave donde dividimos
|
| 105 |
+
despues_palabra: string que está después de la palabra
|
| 106 |
+
|
| 107 |
+
Ejemplo
|
| 108 |
+
--------
|
| 109 |
+
encontrar_palabras('variable india producto variable alfa',['producto','suma','menos','entre'])
|
| 110 |
+
>> ['variable india','producto',' variable alfa]
|
| 111 |
+
"""
|
| 112 |
+
inicio,final=list(re.finditer(r'|'.join(cjto_palabras),transcript))[0].span()
|
| 113 |
+
antes_palabra=transcript[:inicio].strip()
|
| 114 |
+
despues_palabra=transcript[final:].strip()
|
| 115 |
+
palabra=transcript[inicio:final]
|
| 116 |
+
return antes_palabra,palabra,despues_palabra
|
| 117 |
+
|
| 118 |
+
def crear_condicional(transcript):
|
| 119 |
+
'''
|
| 120 |
+
Toma el transcript de un enunciado condicional y regresa su traducción a código en Python
|
| 121 |
+
|
| 122 |
+
Parametros
|
| 123 |
+
----------
|
| 124 |
+
transcript: str
|
| 125 |
+
La intruccion de voz en texto ya en minúsculas.
|
| 126 |
+
|
| 127 |
+
|
| 128 |
+
Regresa
|
| 129 |
+
---------
|
| 130 |
+
output: str
|
| 131 |
+
Cadena con el código en python, tiene una línea al final y un pipe
|
| 132 |
+
que representa el prompt donde se seguirá escribiendo
|
| 133 |
+
|
| 134 |
+
Ejemplo
|
| 135 |
+
--------
|
| 136 |
+
crear_condicional('mientras variable india sea menor igual a numero seis')
|
| 137 |
+
>> while (i<=6):
|
| 138 |
+
>> |
|
| 139 |
+
'''
|
| 140 |
+
global indentacion
|
| 141 |
+
global bloque
|
| 142 |
+
|
| 143 |
+
keyword_mapeo={'mientras':'while','si':'if','contrario':'else'}
|
| 144 |
+
antes_keyword,keyword,desp_keyword=encontrar_palabras(transcript,keyword_mapeo.keys())
|
| 145 |
+
cadena=keyword_mapeo[keyword]
|
| 146 |
+
bloque = keyword
|
| 147 |
+
|
| 148 |
+
if cadena=='else':
|
| 149 |
+
indentacion=indentacion+1
|
| 150 |
+
return 'else:'+'\n' +'\t'* indentacion+'|'
|
| 151 |
+
|
| 152 |
+
# Primera división
|
| 153 |
+
condicional_mapeo={'menor estricto':'<','menor o igual':'<=','igual':'==','diferente':'!='
|
| 154 |
+
,'mayor estricto':'>','mayor o igual':'>='}
|
| 155 |
+
cjto_condicional=condicional_mapeo.keys()
|
| 156 |
+
antes_condicional,palabra_condicional,despues_condicional=encontrar_palabras(transcript,cjto_condicional)
|
| 157 |
+
|
| 158 |
+
|
| 159 |
+
# Buscar antes en la lista de variables
|
| 160 |
+
a_var,var,d_var=encontrar_palabras(antes_condicional,['variable'])
|
| 161 |
+
nombre_var=d_var.split(' ')[0]
|
| 162 |
+
|
| 163 |
+
if diccionario_fonetico.get(nombre_var,False):
|
| 164 |
+
nombre_var=diccionario_fonetico[nombre_var]
|
| 165 |
+
|
| 166 |
+
|
| 167 |
+
cadena+=' '+nombre_var+' ' +condicional_mapeo[palabra_condicional]
|
| 168 |
+
|
| 169 |
+
# Buscar en despues_condicional el número
|
| 170 |
+
|
| 171 |
+
valor=despues_condicional.split(' ')[-1]
|
| 172 |
+
|
| 173 |
+
if dict_numeros.get(valor,False):
|
| 174 |
+
valor=str(dict_numeros[valor])
|
| 175 |
+
|
| 176 |
+
indentacion+=1
|
| 177 |
+
#t = f'<span style="text-indent:{20 * indentacion}px";> <span>'
|
| 178 |
+
return f'<span style="color: #008000; font-weight: bold">{keyword_mapeo[keyword]} </span> {nombre_var} {condicional_mapeo[palabra_condicional]} {valor}:'+'<br>' +' '* indentacion+'|'
|
| 179 |
+
|
| 180 |
+
|
| 181 |
+
|
| 182 |
+
def crear_cadena(transcript):
|
| 183 |
+
"""
|
| 184 |
+
Toma el transcript de un enunciado que contiene una cadena y regresa el código en Python.
|
| 185 |
+
Para usarse cuando ya se sabe que transcript sólo es los límites de la cadena
|
| 186 |
+
|
| 187 |
+
Parametros
|
| 188 |
+
----------
|
| 189 |
+
transcript: str
|
| 190 |
+
La intruccion de voz en texto ya en minúsculas.
|
| 191 |
+
|
| 192 |
+
|
| 193 |
+
Regresa
|
| 194 |
+
---------
|
| 195 |
+
output: list(str)
|
| 196 |
+
antes_palabra:parte del transcript que va antes de las comillas
|
| 197 |
+
palabra: Cadena con el código en python de las comillas y lo que está adentro
|
| 198 |
+
despues_palabra:parte del transcript que va antes de las comillas
|
| 199 |
+
|
| 200 |
+
Ejemplo
|
| 201 |
+
--------
|
| 202 |
+
crear_cadena('ejecuta print con argumentos variable India producto cadena guion cadena')[1]
|
| 203 |
+
>> ['ejecuta print con argumentos variable India producto','"guion"','']
|
| 204 |
+
"""
|
| 205 |
+
try:
|
| 206 |
+
inicio,final=list(re.finditer(r"cadena (.+) cadena",transcript))[0].span()
|
| 207 |
+
except:
|
| 208 |
+
return ''
|
| 209 |
+
antes_palabra=transcript[:inicio].strip()
|
| 210 |
+
despues_palabra=transcript[final:].strip()
|
| 211 |
+
palabra=list(re.finditer(r"cadena (.+) cadena",transcript))[0].group(1)
|
| 212 |
+
return antes_palabra,f'"{palabra}"',despues_palabra
|
| 213 |
+
|
| 214 |
+
def crear_var_existente(transcript):
|
| 215 |
+
"""
|
| 216 |
+
Toma el transcript de un enunciado que contiene la mención de una variable
|
| 217 |
+
y devuelve dicha variable
|
| 218 |
+
|
| 219 |
+
Parametros
|
| 220 |
+
----------
|
| 221 |
+
transcript: str
|
| 222 |
+
La intruccion de voz en texto ya en minúsculas.
|
| 223 |
+
|
| 224 |
+
|
| 225 |
+
Regresa
|
| 226 |
+
---------
|
| 227 |
+
output: str
|
| 228 |
+
palabra: Cadena con el código en python del nombre de la variable
|
| 229 |
+
|
| 230 |
+
Ejemplo
|
| 231 |
+
--------
|
| 232 |
+
crear_var_existente('ejecuta print con argumentos variable india producto cadena guión cadena')
|
| 233 |
+
>> i
|
| 234 |
+
"""
|
| 235 |
+
try:
|
| 236 |
+
antes_var,var,desp_var=encontrar_palabras(transcript,['variable'])
|
| 237 |
+
except:
|
| 238 |
+
return ''
|
| 239 |
+
|
| 240 |
+
nombre_var=desp_var.split(' ')[0]
|
| 241 |
+
if diccionario_fonetico.get(nombre_var,False):
|
| 242 |
+
nombre_var=diccionario_fonetico[nombre_var]
|
| 243 |
+
|
| 244 |
+
return nombre_var
|
| 245 |
+
|
| 246 |
+
|
| 247 |
+
# TODO: Hay que ver:
|
| 248 |
+
# Si es otra operación hay que llamar la función recursivamente en cada pedazo
|
| 249 |
+
# 1. si es cadena
|
| 250 |
+
# 2. si es otra operación. Para esto, hay que regresar error o algo así cuando no se encuentre
|
| 251 |
+
def crear_operacion(transcript):
|
| 252 |
+
'''
|
| 253 |
+
|
| 254 |
+
Toma el transcript de una operación binaria y la traduce a código de Python.
|
| 255 |
+
Para traducir las variables que se usan en la operación binaria busca
|
| 256 |
+
si son cadenas o sólo menciones de variables usando las funciones
|
| 257 |
+
crear_cadena y crear_var_existente
|
| 258 |
+
|
| 259 |
+
Parametros
|
| 260 |
+
----------
|
| 261 |
+
transcript: str
|
| 262 |
+
La intruccion de voz en texto ya en minúsculas.
|
| 263 |
+
|
| 264 |
+
|
| 265 |
+
Regresa
|
| 266 |
+
---------
|
| 267 |
+
output: str
|
| 268 |
+
Cadena con el código en python
|
| 269 |
+
|
| 270 |
+
Ejemplo
|
| 271 |
+
--------
|
| 272 |
+
crear_operacion('variable India producto cadena guión cadena')
|
| 273 |
+
>> i*'-'
|
| 274 |
+
'''
|
| 275 |
+
global dict_operaciones
|
| 276 |
+
|
| 277 |
+
|
| 278 |
+
try:
|
| 279 |
+
antes_op,op,desp_op=encontrar_palabras(transcript,dict_operaciones.keys())
|
| 280 |
+
except:
|
| 281 |
+
return ''
|
| 282 |
+
|
| 283 |
+
# Buscamos la información en la cadena detrás del operador
|
| 284 |
+
cadena_izq=crear_var_existente(antes_op)
|
| 285 |
+
try:
|
| 286 |
+
cadena_izq+=f'{crear_cadena(antes_op)[1]}'
|
| 287 |
+
except:
|
| 288 |
+
cadena_izq+=''
|
| 289 |
+
|
| 290 |
+
if len(cadena_izq)==0:
|
| 291 |
+
nombre_var=antes_op.split(' ')[-1]
|
| 292 |
+
if dict_numeros.get(nombre_var,False):
|
| 293 |
+
nombre_var=dict_numeros[nombre_var]
|
| 294 |
+
cadena_izq+=str(nombre_var)
|
| 295 |
+
|
| 296 |
+
# Buscamos la información en la cadena después del operador
|
| 297 |
+
cadena_der=crear_var_existente(desp_op)
|
| 298 |
+
try:
|
| 299 |
+
cadena_der+=f'{crear_cadena(desp_op)[1]}'
|
| 300 |
+
except:
|
| 301 |
+
cadena_der+=''
|
| 302 |
+
|
| 303 |
+
if len(cadena_der)==0:
|
| 304 |
+
nombre_var=desp_op.split(' ')[0]
|
| 305 |
+
if dict_numeros.get(nombre_var,False):
|
| 306 |
+
nombre_var=dict_numeros[nombre_var]
|
| 307 |
+
if diccionario_fonetico.get(nombre_var,False):
|
| 308 |
+
nombre_var=diccionario_fonetico[nombre_var]
|
| 309 |
+
cadena_der+=str(nombre_var)
|
| 310 |
+
|
| 311 |
+
|
| 312 |
+
return f'{cadena_izq} {dict_operaciones[op]} {cadena_der}'
|
| 313 |
+
|
| 314 |
+
|
| 315 |
+
def crear_llamada(transcript):
|
| 316 |
+
"""
|
| 317 |
+
Toma el transcript de la llamada de una función y la convierte en código de Python
|
| 318 |
+
Hace uso de las funciones que detectan operaciones, variables y comillas
|
| 319 |
+
,para cada argumento de la función
|
| 320 |
+
|
| 321 |
+
Parametros
|
| 322 |
+
----------
|
| 323 |
+
transcript: str
|
| 324 |
+
La intruccion de voz en texto ya en minúsculas.
|
| 325 |
+
|
| 326 |
+
|
| 327 |
+
Regresa
|
| 328 |
+
---------
|
| 329 |
+
output: str
|
| 330 |
+
Cadena con el código en python
|
| 331 |
+
|
| 332 |
+
Ejemplo
|
| 333 |
+
--------
|
| 334 |
+
crear_llamada(ejecuta print con argumentos variable India producto cadena guión cadena
|
| 335 |
+
coma cadena hola cadena')
|
| 336 |
+
>> print(i*'-','hola')
|
| 337 |
+
|
| 338 |
+
"""
|
| 339 |
+
global bloque
|
| 340 |
+
global indentacion
|
| 341 |
+
|
| 342 |
+
bloque='llamada'
|
| 343 |
+
try:
|
| 344 |
+
antes_ej,ej,desp_ej=encontrar_palabras(transcript,['ejecuta'])
|
| 345 |
+
except:
|
| 346 |
+
return ''
|
| 347 |
+
funcion_nombre=desp_ej.split(' ')[0]
|
| 348 |
+
# Aquí tal vez valdría la pena tener un registro de las funciones previamente definidas para
|
| 349 |
+
# poder buscar en un directorio con Jaccard y no aproximar
|
| 350 |
+
|
| 351 |
+
antes_arg,keyword,desp_arg=encontrar_palabras(desp_ej,['argumentos','parametros'])
|
| 352 |
+
|
| 353 |
+
argumentos=desp_arg.split('coma')
|
| 354 |
+
lista_cadenas=[]
|
| 355 |
+
for arg in argumentos:
|
| 356 |
+
arg=arg.strip()
|
| 357 |
+
cadena_arg=''
|
| 358 |
+
# print('arg',arg)
|
| 359 |
+
# Caso cuando es operacion
|
| 360 |
+
cadena_op=crear_operacion(arg)
|
| 361 |
+
cadena_var=crear_var_existente(arg)
|
| 362 |
+
cadena_cadena=crear_cadena(arg)
|
| 363 |
+
if len(cadena_op)!=0:
|
| 364 |
+
lista_cadenas.append(cadena_op)
|
| 365 |
+
elif len(cadena_var)!=0:
|
| 366 |
+
lista_cadenas.append(cadena_var)
|
| 367 |
+
elif len(cadena_cadena)!=0:
|
| 368 |
+
lista_cadenas.append(cadena_cadena[1])
|
| 369 |
+
else:
|
| 370 |
+
nombre_var=arg
|
| 371 |
+
if dict_numeros.get(nombre_var,False):
|
| 372 |
+
nombre_var=str(dict_numeros[nombre_var])
|
| 373 |
+
|
| 374 |
+
lista_cadenas.append(nombre_var)
|
| 375 |
+
|
| 376 |
+
# Caso cuando es variable
|
| 377 |
+
|
| 378 |
+
cadena_final=','.join(lista_cadenas)
|
| 379 |
+
cadena=f'{funcion_nombre}({cadena_final})<br>'+' '*indentacion+'|'
|
| 380 |
+
|
| 381 |
+
return cadena
|
| 382 |
+
|
| 383 |
+
def crear_regresa(transcript):
|
| 384 |
+
antes_reg,reg,desp_reg=encontrar_palabras(transcript,['regresa'])
|
| 385 |
+
|
| 386 |
+
arg=desp_reg.strip()
|
| 387 |
+
cadena_arg=''
|
| 388 |
+
|
| 389 |
+
# Si es llamada
|
| 390 |
+
cadena_llamada=crear_llamada(arg)
|
| 391 |
+
# Caso cuando es operacion
|
| 392 |
+
cadena_op=crear_operacion(arg)
|
| 393 |
+
cadena_var=crear_var_existente(arg)
|
| 394 |
+
cadena_cadena=crear_cadena(arg)
|
| 395 |
+
|
| 396 |
+
cadena_final=''
|
| 397 |
+
if len(cadena_llamada)!=0:
|
| 398 |
+
cadena_final+=cadena_llamada[:-2]
|
| 399 |
+
elif len(cadena_op)!=0:
|
| 400 |
+
cadena_final+=cadena_op
|
| 401 |
+
elif len(cadena_var)!=0:
|
| 402 |
+
cadena_final+=cadena_var
|
| 403 |
+
elif len(cadena_cadena)!=0:
|
| 404 |
+
cadena_final+=cadena_cadena[1]
|
| 405 |
+
else:
|
| 406 |
+
nombre_var=arg
|
| 407 |
+
if dict_numeros.get(nombre_var,False):
|
| 408 |
+
nombre_var=str(dict_numeros[nombre_var])
|
| 409 |
+
|
| 410 |
+
cadena_final+=nombre_var
|
| 411 |
+
global indentacion
|
| 412 |
+
indentacion-=1
|
| 413 |
+
return f'<span style="color: #AA22FF; font-weight: bold">return</span> {cadena_final}<br>'+' '*indentacion+'|'
|
| 414 |
+
|
| 415 |
+
|
| 416 |
+
def crear_variable(instruccion):
|
| 417 |
+
"""
|
| 418 |
+
Estructura:
|
| 419 |
+
definir variable con nombre [nombre_variable] igual a /*objeto_basico* valor/
|
| 420 |
+
|
| 421 |
+
Parametros
|
| 422 |
+
----------
|
| 423 |
+
instrucion: str
|
| 424 |
+
La intruccion de voz en texto.
|
| 425 |
+
|
| 426 |
+
Regresa
|
| 427 |
+
---------
|
| 428 |
+
output: str
|
| 429 |
+
Codigo generado
|
| 430 |
+
recomendacion: str
|
| 431 |
+
Una sugerencia o fallo
|
| 432 |
+
|
| 433 |
+
Testing
|
| 434 |
+
-------
|
| 435 |
+
>>> definir variable con nombre india igual a numero uno
|
| 436 |
+
>>> definir variable con nombre i igual a numero 1 (int)
|
| 437 |
+
>>> definir variable con nombre i igual a flotante tres punto cinco (float)
|
| 438 |
+
>>> definir variable con nombre i igual a cadena hola (string)
|
| 439 |
+
>>> definir variable con nombre i igual a lista/dic (string)
|
| 440 |
+
"""
|
| 441 |
+
global indentacion
|
| 442 |
+
global bloque
|
| 443 |
+
|
| 444 |
+
bloque='variable'
|
| 445 |
+
|
| 446 |
+
# pivote que ayuda a definir el nombre de la variable
|
| 447 |
+
before_keyword, keyword, after_keyword = instruccion.partition('nombre')
|
| 448 |
+
after_keyword_list = after_keyword.strip().split(' ')
|
| 449 |
+
# [india igual a numero uno]
|
| 450 |
+
name_variable = after_keyword_list[0]
|
| 451 |
+
|
| 452 |
+
# Como sabemos que despues del nombre va seguido de "igual a"
|
| 453 |
+
tipo_dato = after_keyword_list[3]
|
| 454 |
+
#print(after_keyword_list[4:]) -> lista
|
| 455 |
+
valor = tipos_datos[tipo_dato](after_keyword_list[4:])
|
| 456 |
+
|
| 457 |
+
# Verificamos si es una palabra fonetica
|
| 458 |
+
if diccionario_fonetico.get(name_variable,False):
|
| 459 |
+
name_variable=diccionario_fonetico[name_variable]
|
| 460 |
+
|
| 461 |
+
codigo_generado = f'{name_variable} = {valor}<br>'+ ' ' * indentacion + '|'
|
| 462 |
+
return codigo_generado
|
| 463 |
+
|
| 464 |
+
|
| 465 |
+
def asignar_variable(instruccion):
|
| 466 |
+
"""
|
| 467 |
+
Asigna una variable (eg. indio = indio + 1)
|
| 468 |
+
|
| 469 |
+
Parametros
|
| 470 |
+
----------
|
| 471 |
+
instrucion: str
|
| 472 |
+
La intruccion de voz en texto.
|
| 473 |
+
|
| 474 |
+
Regresa
|
| 475 |
+
---------
|
| 476 |
+
output: str
|
| 477 |
+
Codigo generado (indio = indio + 1)
|
| 478 |
+
|
| 479 |
+
Testing
|
| 480 |
+
--------
|
| 481 |
+
>>>'asignar variable india con india suma uno',
|
| 482 |
+
>>>'asignar variable contador con contador menos uno',
|
| 483 |
+
>>>'asignar variable contador con alfa',
|
| 484 |
+
>>>'asignar variable india con india',
|
| 485 |
+
|
| 486 |
+
"""
|
| 487 |
+
global bloque
|
| 488 |
+
bloque = "asignar"
|
| 489 |
+
|
| 490 |
+
before_keyword, keyword, after_keyword = instruccion.partition('variable')
|
| 491 |
+
after_keyword_list = after_keyword.strip().split(' ')
|
| 492 |
+
name_variable = after_keyword_list[0]
|
| 493 |
+
start = after_keyword_list.index('con') + 1
|
| 494 |
+
operacion = after_keyword_list[start:]
|
| 495 |
+
if len(operacion) != 1:
|
| 496 |
+
operacion_str = crear_operacion(keyword + ' ' + ' '.join(operacion))
|
| 497 |
+
else:
|
| 498 |
+
operacion_str = operacion[0]
|
| 499 |
+
# Verificamos si es una palabra fonetica para lado derecho de la
|
| 500 |
+
# asignacion
|
| 501 |
+
if diccionario_fonetico.get(operacion_str,False):
|
| 502 |
+
operacion_str=diccionario_fonetico[operacion_str]
|
| 503 |
+
|
| 504 |
+
# Verificamos si es una palabra fonetica
|
| 505 |
+
if diccionario_fonetico.get(name_variable,False):
|
| 506 |
+
name_variable=diccionario_fonetico[name_variable]
|
| 507 |
+
|
| 508 |
+
codigo_generado = f'{name_variable} = {operacion_str}<br>'+ ' ' * indentacion + '|'
|
| 509 |
+
return codigo_generado
|
| 510 |
+
|
| 511 |
+
|
| 512 |
+
def crear_for(instruccion):
|
| 513 |
+
"""
|
| 514 |
+
Crea el template de la estructura de un ciclo for.
|
| 515 |
+
|
| 516 |
+
Parámetros
|
| 517 |
+
----------
|
| 518 |
+
instrucción: str
|
| 519 |
+
La intrucción de voz en texto.
|
| 520 |
+
|
| 521 |
+
Regresa
|
| 522 |
+
---------
|
| 523 |
+
output: str
|
| 524 |
+
Estructura del ciclo for
|
| 525 |
+
recomendacion: str
|
| 526 |
+
Una sugerencia o error
|
| 527 |
+
"""
|
| 528 |
+
global bloque
|
| 529 |
+
global indentacion
|
| 530 |
+
global recomendacion
|
| 531 |
+
|
| 532 |
+
bloque='for'
|
| 533 |
+
vocabulario_basico = ['iteracion', 'rango']
|
| 534 |
+
|
| 535 |
+
# verificamos si la frase cumple los requisitos
|
| 536 |
+
instruccion_tokens = instruccion.strip().split(' ')
|
| 537 |
+
|
| 538 |
+
for i in vocabulario_basico:
|
| 539 |
+
try:
|
| 540 |
+
instruccion_tokens.index(i)
|
| 541 |
+
except:
|
| 542 |
+
recomendacion = 'Parece que quieres una iteración pero no reconozco tus comandos, inténtalo de nuevo'
|
| 543 |
+
return f'', recomendacion
|
| 544 |
+
|
| 545 |
+
# guarda los avisos o recomendaciones que el programa te hace
|
| 546 |
+
recomendacion = ''
|
| 547 |
+
|
| 548 |
+
# guarda la línea de código
|
| 549 |
+
output = ''
|
| 550 |
+
|
| 551 |
+
# pivote que ayuda a definir el rango e iterador
|
| 552 |
+
before_keyword, keyword, after_keyword = instruccion.partition('iteracion')
|
| 553 |
+
|
| 554 |
+
if after_keyword.strip().split(' ')[1] in diccionario_fonetico:
|
| 555 |
+
iterador = diccionario_fonetico[after_keyword.strip().split(' ')[1]]
|
| 556 |
+
|
| 557 |
+
else:
|
| 558 |
+
iterador = after_keyword.strip().split(' ')[1]
|
| 559 |
+
|
| 560 |
+
before_keyword, keyword, after_keyword = instruccion.partition('rango')
|
| 561 |
+
|
| 562 |
+
limites = []
|
| 563 |
+
|
| 564 |
+
|
| 565 |
+
for i, item in enumerate(after_keyword.strip().split(' ')):
|
| 566 |
+
try:
|
| 567 |
+
limites.append(dict_numeros[item])
|
| 568 |
+
except:
|
| 569 |
+
continue
|
| 570 |
+
|
| 571 |
+
if len(limites) == 0:
|
| 572 |
+
for i, item in enumerate(after_keyword.strip().split(' ')):
|
| 573 |
+
try:
|
| 574 |
+
limites.append(diccionario_fonetico[item])
|
| 575 |
+
except:
|
| 576 |
+
continue
|
| 577 |
+
|
| 578 |
+
indentacion += 1
|
| 579 |
+
|
| 580 |
+
if len(limites) == 0:
|
| 581 |
+
return f''
|
| 582 |
+
|
| 583 |
+
elif len(limites) == 1:
|
| 584 |
+
return f'<span style="color: #008000; font-weight: bold">for</span> {iterador} in <span style="color: #0066bb; font-weight: bold">range</span>({limites[-1]}):<br>' + ' ' * indentacion + '|'
|
| 585 |
+
|
| 586 |
+
elif len(limites) == 2:
|
| 587 |
+
return f'<span style="color: #008000; font-weight: bold">for</span> {iterador} in <span style="color: #0066bb; font-weight: bold">range</span>({limites[0]}, {limites[1]}):<br>' + ' ' * indentacion + '|'
|
| 588 |
+
|
| 589 |
+
elif len(limites) >= 2:
|
| 590 |
+
recomendacion = 'Me dictaste más de un número en el rango pero tomé los dos primeros'
|
| 591 |
+
return f'<span style="color: #008000; font-weight: bold">for</span> {iterador} in <span style="color: #0066bb; font-weight: bold">range</span>({limites[0]}, {limites[1]}):<br>' + ' ' * indentacion + '|'
|
| 592 |
+
|
| 593 |
+
def crear_comentario(instruccion):
|
| 594 |
+
"""
|
| 595 |
+
Agrega el comentario de la intrucción en una línea de código
|
| 596 |
+
|
| 597 |
+
Parámetros
|
| 598 |
+
----------
|
| 599 |
+
instrucción: str
|
| 600 |
+
La intrucción de voz en texto.
|
| 601 |
+
|
| 602 |
+
Regresa
|
| 603 |
+
---------
|
| 604 |
+
output: str
|
| 605 |
+
Comentario
|
| 606 |
+
"""
|
| 607 |
+
|
| 608 |
+
global bloque
|
| 609 |
+
global indentacion
|
| 610 |
+
|
| 611 |
+
# guarda los avisos o recomendaciones que el programa te hace
|
| 612 |
+
recomendacion = ''
|
| 613 |
+
bloque = 'comentario'
|
| 614 |
+
# guarda la línea de código
|
| 615 |
+
output = ''
|
| 616 |
+
|
| 617 |
+
before_keyword, keyword, after_keyword = instruccion.partition('comentario')
|
| 618 |
+
|
| 619 |
+
return '<span style="color: #888888">' + '# ' + after_keyword + '</span>' + '<br>' + ' ' * indentacion + '|'
|
| 620 |
+
|
| 621 |
+
def fin_de_bloque(transcripcion):
|
| 622 |
+
global indentacion
|
| 623 |
+
global bloque
|
| 624 |
+
bloque='fin'
|
| 625 |
+
indentacion=indentacion-1
|
| 626 |
+
return '|'
|
| 627 |
+
|
| 628 |
+
|
models/variables_globales.py
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def numero(text):
|
| 2 |
+
"""Convierte un texto de numero en numero entero (int)
|
| 3 |
+
|
| 4 |
+
Parametros
|
| 5 |
+
----------
|
| 6 |
+
text: list
|
| 7 |
+
Serie de valores
|
| 8 |
+
|
| 9 |
+
Regresa
|
| 10 |
+
---------
|
| 11 |
+
dict_numeros: int
|
| 12 |
+
El número correspondiente
|
| 13 |
+
"""
|
| 14 |
+
global dict_numeros
|
| 15 |
+
# Como sabemos que siempre sera el primer elemento el valor despues
|
| 16 |
+
# de número (eg. cuatro or veintecinco)
|
| 17 |
+
numero_str = text[0]
|
| 18 |
+
return dict_numeros[numero_str]
|
| 19 |
+
|
| 20 |
+
def flotante(text):
|
| 21 |
+
"""Convierte un texto de numero en numero floatante (float)
|
| 22 |
+
|
| 23 |
+
Parametros
|
| 24 |
+
----------
|
| 25 |
+
text: list
|
| 26 |
+
Serie de valores
|
| 27 |
+
|
| 28 |
+
Regresa
|
| 29 |
+
---------
|
| 30 |
+
dict_numeros: float
|
| 31 |
+
El número correspondiente en floatante (eg 3.4)
|
| 32 |
+
"""
|
| 33 |
+
global dict_numeros
|
| 34 |
+
text = " ".join(text)
|
| 35 |
+
before_keyword, keyword, after_keyword = text.partition('punto')
|
| 36 |
+
print(before_keyword)
|
| 37 |
+
print(after_keyword)
|
| 38 |
+
|
| 39 |
+
# Obtenemos los dos numeros antes y despues del punto
|
| 40 |
+
before_num = before_keyword.strip().split(' ')[0]
|
| 41 |
+
after_num = after_keyword.strip().split(' ')[0]
|
| 42 |
+
|
| 43 |
+
# Hacemos el mapeo uno -> 1
|
| 44 |
+
num1_int = dict_numeros[before_num]
|
| 45 |
+
num2_int = dict_numeros[after_num]
|
| 46 |
+
|
| 47 |
+
return float(str(num1_int) + '.' + str(num2_int))
|
| 48 |
+
|
| 49 |
+
def cadena(text):
|
| 50 |
+
"""Convierte un texto de numero en string (str)
|
| 51 |
+
|
| 52 |
+
Parametros
|
| 53 |
+
----------
|
| 54 |
+
text: list
|
| 55 |
+
Serie de valores
|
| 56 |
+
|
| 57 |
+
Regresa
|
| 58 |
+
---------
|
| 59 |
+
string: str
|
| 60 |
+
Una cadena con el contenido del texto
|
| 61 |
+
"""
|
| 62 |
+
numero_str = text[:]
|
| 63 |
+
return ' '.join(text)
|
| 64 |
+
|
| 65 |
+
def lista(text):
|
| 66 |
+
"""Convierte un texto de numero en string (str)
|
| 67 |
+
|
| 68 |
+
Parametros
|
| 69 |
+
----------
|
| 70 |
+
text: list
|
| 71 |
+
Serie de valores
|
| 72 |
+
|
| 73 |
+
Regresa
|
| 74 |
+
---------
|
| 75 |
+
lista: list
|
| 76 |
+
Una lista vacia
|
| 77 |
+
"""
|
| 78 |
+
return []
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
|
| 82 |
+
diccionario_fonetico={'andrea':'a',
|
| 83 |
+
'bravo':'b',
|
| 84 |
+
'carlos':'c',
|
| 85 |
+
'delta':'d',
|
| 86 |
+
'eduardo':'e',
|
| 87 |
+
'fernando':'f',
|
| 88 |
+
'garcia':'g',
|
| 89 |
+
'hotel':'h',
|
| 90 |
+
'india':'i',
|
| 91 |
+
'julieta':'j',
|
| 92 |
+
'kilo':'k',
|
| 93 |
+
'lima':'l',
|
| 94 |
+
'miguel':'m',
|
| 95 |
+
'noviembre':'n',
|
| 96 |
+
'oscar':'o',
|
| 97 |
+
'papa':'p',
|
| 98 |
+
'queretaro':'q',
|
| 99 |
+
'romero':'',
|
| 100 |
+
'sierra':'s',
|
| 101 |
+
'tango':'t',
|
| 102 |
+
'uniforme':'u',
|
| 103 |
+
'victor':'v',
|
| 104 |
+
'wafle':'w',
|
| 105 |
+
'equis':'x',
|
| 106 |
+
'yarda':'y',
|
| 107 |
+
'llarda':'y',
|
| 108 |
+
'espacio':' '}
|
| 109 |
+
|
| 110 |
+
# Separa en operadores comunes
|
| 111 |
+
|
| 112 |
+
# si esto se lematiza puedes agarrar todas las frases de la forma suma, sumar, etc.
|
| 113 |
+
dict_operaciones={
|
| 114 |
+
'producto':'*','mas':'+','menos':'-','concatena':'+','entre':'/','modulo':'%'
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
dict_numeros = {
|
| 118 |
+
'cero':0,
|
| 119 |
+
'uno': 1,
|
| 120 |
+
'dos': 2,
|
| 121 |
+
'tres': 3,
|
| 122 |
+
'cuatro':4,
|
| 123 |
+
'cinco': 5,
|
| 124 |
+
'seis': 6,
|
| 125 |
+
'siete': 7,
|
| 126 |
+
'ocho': 8,
|
| 127 |
+
'nueve': 9,
|
| 128 |
+
'diez': 10,
|
| 129 |
+
'once': 11,
|
| 130 |
+
'doce': 12,
|
| 131 |
+
'trece': 13,
|
| 132 |
+
'catorce': 14,
|
| 133 |
+
'quince': 15,
|
| 134 |
+
'dieciseis': 16,
|
| 135 |
+
'diecisiete': 17,
|
| 136 |
+
'dieciocho': 18,
|
| 137 |
+
'diecinueve': 19,
|
| 138 |
+
'veinte': 20,
|
| 139 |
+
'treinta': 30,
|
| 140 |
+
'cuarenta': 40,
|
| 141 |
+
'cicuenta': 50,
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
# Diccionario de funciones
|
| 145 |
+
tipos_datos ={
|
| 146 |
+
'natural': numero,
|
| 147 |
+
'flotante': flotante,
|
| 148 |
+
'cadena': cadena,
|
| 149 |
+
'lista': lista,
|
| 150 |
+
}
|
requirements.txt
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
|
| 2 |
transformers
|
| 3 |
transformers
|
| 4 |
-
torch
|
|
|
|
|
|
| 1 |
|
| 2 |
transformers
|
| 3 |
transformers
|
| 4 |
+
torch
|
| 5 |
+
unidecode
|
wav/andreabravo.wav
ADDED
|
Binary file (542 kB). View file
|
|
|
wav/asignar_a_c.wav
ADDED
|
Binary file (507 kB). View file
|
|
|
wav/asignar_c_b.wav
ADDED
|
Binary file (438 kB). View file
|
|
|
wav/bravoigual.wav
ADDED
|
Binary file (593 kB). View file
|
|
|
wav/comentario.wav
ADDED
|
Binary file (467 kB). View file
|
|
|
wav/comentario2.wav
ADDED
|
Binary file (442 kB). View file
|
|
|
wav/definir_var_andrea.wav
ADDED
|
Binary file (703 kB). View file
|
|
|
wav/definira.wav
ADDED
|
Binary file (699 kB). View file
|
|
|
wav/definirandrea.wav
ADDED
|
Binary file (576 kB). View file
|
|
|
wav/definirb.wav
ADDED
|
Binary file (735 kB). View file
|
|
|
wav/funcion.wav
ADDED
|
Binary file (639 kB). View file
|
|
|
wav/iteracion.wav
ADDED
|
Binary file (737 kB). View file
|
|
|
wav/llamada.wav
ADDED
|
Binary file (536 kB). View file
|
|
|
wav/regresa.wav
ADDED
|
Binary file (340 kB). View file
|
|
|
wav/regresarandrea.wav
ADDED
|
Binary file (426 kB). View file
|
|
|
wav/terminar_bloque.wav
ADDED
|
Binary file (317 kB). View file
|
|
|