Skip to content

Commit

Permalink
Merge pull request #1 from mateusvicente100/master
Browse files Browse the repository at this point in the history
Removing warnings
  • Loading branch information
viniciussanchez authored Jul 27, 2022
2 parents 099dd74 + 89297d6 commit a511ab5
Showing 1 changed file with 20 additions and 26 deletions.
46 changes: 20 additions & 26 deletions src/Fonetiza.CodigoFonetico.Core.pas
Original file line number Diff line number Diff line change
Expand Up @@ -218,45 +218,39 @@ function TCodigoFoneticoCore.randomize(const str: string): string;
for j := 0 to 255 do
fonaux[j] := ' ';

j := 0;
// percorre a palavra, letra a letra
while j < auxStr.Length do
// se a palavra iniciar por vogal, insere um "R" no inicio da palavra
if ((foncmp[0] = 'I') or (foncmp[0] = 'A') or (foncmp[0] = 'U')) then
begin
// se a palavra iniciar por vogal, insere um "R" no inicio da palavra
if ((foncmp[0] = 'I') or (foncmp[0] = 'A') or (foncmp[0] = 'U')) then
begin
fonaux[0] := 'R';
for j := 0 to Pred(auxStr.Length) do
fonaux[j + 1] := foncmp[j];
end
else
fonaux[0] := 'R';
for j := 0 to Pred(auxStr.Length) do
fonaux[j + 1] := foncmp[j];
end
else
begin
// se a palavra iniciar com "GI", suprime o "G"
if ((foncmp[0] = 'G') and (auxStr.Length > 1)) then
begin
// se a palavra iniciar com "GI", suprime o "G"
if ((foncmp[0] = 'G') and (auxStr.Length > 1)) then
if (foncmp[1] = 'I') then
begin
if (foncmp[1] = 'I') then
begin
for j := 0 to auxStr.Length - 2 do
fonaux[j] := foncmp[j + 1];
Inc(J);
end
else
begin
// senao apenas copia a palavra original
for j := 0 to Pred(auxStr.Length) do
fonaux[j] := foncmp[j];
end;
for j := 0 to auxStr.Length - 2 do
fonaux[j] := foncmp[j + 1];
end
else
begin
// senao apenas copia a palavra original
for j := 0 to Pred(auxStr.Length) do
fonaux[j] := foncmp[j];
end;
end
else
begin
// senao apenas copia a palavra original
for j := 0 to Pred(auxStr.Length) do
fonaux[j] := foncmp[j];
end;
end;

auxStr := EmptyStr; // >>>>>>>> ADDED BY VINICIUS
auxStr := EmptyStr;
for lchar in fonaux do
auxStr := auxStr + lchar;
auxStr := auxStr.Trim;
Expand Down

0 comments on commit a511ab5

Please sign in to comment.