CODE:string Text;
loadsymbolbase ("D:\Kibor2\basetext.sib");
readtext (NUM, #Text, 8, 1, -1, -1, -1, -1, -1, 0, -1, 39, 66, 577, 222, -1);
messagebox (Text);//тест
double SymbolCorrect = 0.5; // коррекстность символа
int LenText = size(Text);
string Result = "";
char TextC[999];
strcpy(#TextC[0], Text);
int LastMinPosX = -9999;
for(int j =0; j<LenText; j++)
{
int PosSymbol;
int MinPosX = 9999;
int Found = 0;
for(int i=0; i<LenText; i++)
{
if(TextC[i] != '^r' && TextC[i] != '^n' && TextC[i] != ' ')
{
if(symbolxpos(i) < MinPosX && symbolxpos(i) > LastMinPosX)
{
MinPosX = symbolxpos(i);
PosSymbol = i;
Found = 1;
}
}
}
if(Found==0) continue;
if(symbolcorrect(PosSymbol) >= SymbolCorrect) Result = Result + TextC[PosSymbol];
LastMinPosX = MinPosX;
}
messagebox(Result); |