I have a txt file that contains the following: pumpkin dices pencil harvest. I want to perform a function that tells me the number of syllables that each word in that text file has. How can I read the letter a of the alphabet again?
I have the following lines of code:
local ejer = io.open("archivo.txt","r")
local mejer={}
local i=1
for line in ejer:lines() do
mejer[i] = line
i=i+1
end
print(mejer[1])
abecedario={ "a", "e", "i", "o","u","á", "é", "í", "ó","ú","b","c","d","e","f","g","h","i","j","k","l","m","n","ñ","o","p","q","r","s","t","v","w","x","y","z"}
silabas={}
local misilaba=""
local m=1
repeat
local x=1
local y=1
local j=1
repeat
local letra=abecedario[x]
local encontrar = string.find(mejer[y],letra)
if (encontrar==m)then
silabas[j]=letra
misilaba=misilaba..silabas[j]
print(misilaba)
end
x=x+1
until x==36
m=m+1
until m>12
with these lines I get the following result: