Skip to content

Commit 0c24956

Browse files
committed
more typos
1 parent 1067910 commit 0c24956

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Source/simba.pixelocr.pas

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ TPixelOCR = record
7575
function RecognizeLines(Image: TSimbaImage; constref Font: TPixelFont; Bounds: TBox): TStringArray;
7676
end;
7777

78+
const
79+
ALPHA_NUM_SYMBOLS = ['a'..'z', 'A'..'Z', '0'..'9', '%', '&', '#', '$', '[', ']', '{', '}', '@', '!', '?'];
7880
var
79-
ALPHA_NUM_SYMBOLS: array [Char] of Boolean;
81+
AlphaNumSymbolTable: array [Char] of Boolean;
8082

8183
implementation
8284

@@ -87,14 +89,12 @@ implementation
8789
simba.fs;
8890

8991
initialization
90-
const
91-
CHARACTERS = ['a'..'z', 'A'..'Z', '0'..'9', '%', '&', '#', '$', '[', ']', '{', '}', '@', '!', '?'];
9292
var
93-
c: Char;
93+
i: Integer
9494
begin
95-
FillChar(ALPHA_NUM_SYMBOLS, SizeOf(ALPHA_NUM_SYMBOLS), False);
96-
for c in CHARACTERS do
97-
ALPHA_NUM_SYMBOLS[c] := True;
95+
FillChar(AlphaNumSymbolTable, SizeOf(AlphaNumSymbolTable), False);
96+
for i to High(ALPHA_NUM_SYMBOLS) do
97+
AlphaNumSymbolTable[ALPHA_NUM_SYMBOLS[i]] := True;
9898
end;
9999

100100
function IsSimilar(const Image: TSimbaImage; const X, Y: Integer; const Color2: TColorBGRA; const Tol: Single): Boolean; inline;
@@ -131,7 +131,7 @@ function IsAlphaNumSym(const text: string): Boolean; inline;
131131
needed := (Length(text) * 50 + 99) div 100;
132132

133133
for i := 1 to Length(text) do
134-
if ALPHA_NUM_SYMBOLS[text[i]] then
134+
if AlphaNumSymbolTable[text[i]] then
135135
begin
136136
Inc(count);
137137
//if 50% of the text is ALPHA_NUM_SYMBOLS we are good.

0 commit comments

Comments
 (0)