Data update

This commit is contained in:
Ingy döt Net 2026-04-30 12:34:36 -04:00
parent 4bb20c9b71
commit cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions

View file

@ -3,42 +3,42 @@ IMPORT Files,StdLog,Strings;
PROCEDURE Do*;
VAR
loc: Files.Locator;
fd: Files.File;
rd: Files.Reader;
x: BYTE;
frecuency: ARRAY 26 OF LONGINT;
c: CHAR;
i: INTEGER;
loc: Files.Locator;
fd: Files.File;
rd: Files.Reader;
x: BYTE;
frecuency: ARRAY 26 OF LONGINT;
c: CHAR;
i: INTEGER;
BEGIN
loc := Files.dir.This("BBTest/Mod");
fd := Files.dir.Old(loc,"LetterFrecuency.odc",FALSE);
rd := fd.NewReader(NIL);
(* init the frecuency array *)
FOR i := 0 TO LEN(frecuency) - 1 DO frecuency[i] := 0 END;
(* collect frecuencies *)
WHILE ~rd.eof DO
rd.ReadByte(x);c := CAP(CHR(x));
(* convert vowels with diacritics *)
CASE ORD(c) OF
193: c := 'A';
|201: c := 'E';
|205: c := 'I';
|211: c := 'O';
|218: c := 'U';
ELSE
END;
IF (c >= 'A') & (c <= 'Z') THEN
INC(frecuency[ORD(c) - ORD('A')]);
END
END;
(* show data *)
FOR i := 0 TO LEN(frecuency) - 1 DO
StdLog.Char(CHR(i + ORD('A')));StdLog.String(":> ");StdLog.Int(frecuency[i]);
StdLog.Ln
END
loc := Files.dir.This("BBTest/Mod");
fd := Files.dir.Old(loc,"LetterFrecuency.odc",FALSE);
rd := fd.NewReader(NIL);
(* init the frecuency array *)
FOR i := 0 TO LEN(frecuency) - 1 DO frecuency[i] := 0 END;
(* collect frecuencies *)
WHILE ~rd.eof DO
rd.ReadByte(x);c := CAP(CHR(x));
(* convert vowels with diacritics *)
CASE ORD(c) OF
193: c := 'A';
|201: c := 'E';
|205: c := 'I';
|211: c := 'O';
|218: c := 'U';
ELSE
END;
IF (c >= 'A') & (c <= 'Z') THEN
INC(frecuency[ORD(c) - ORD('A')]);
END
END;
(* show data *)
FOR i := 0 TO LEN(frecuency) - 1 DO
StdLog.Char(CHR(i + ORD('A')));StdLog.String(":> ");StdLog.Int(frecuency[i]);
StdLog.Ln
END
END Do;
END LetterFrecuency.