close Warning: Can't synchronize with repository "(default)" (/var/svn/tolp does not appear to be a Subversion repository.). Look in the Trac log for more information.

Opened 21 years ago

Closed 16 years ago

#105 closed defect (fixed)

BDBReg() loses one character in some lines

Reported by: request Owned by: Víctor de Buen Remiro
Priority: normal Milestone:
Component: SetAlgebra Version: 1.1.1
Severity: major Keywords:
Cc:

Description

Text files with lines of differents lengths
The error depends on the file size.
If you delete lines in the file BDBReg() would work well again.
(round problems in the bytes counter ?)

Source code:

Set inpBdb = BDBOpen("error20040803.txt", 0, "\n", "", "");
Real maxReg = inpBdb->RegNumber;
Real numReg = 1;
Real While(LE(numReg,maxReg),
{

Text inpLin = BDBReg(inpBdb, numReg)[1]; Read a line
Text WriteLn("<"+inpLin+">");
Real(numReg:=numReg+1);
TRUE

});

Real BDBClose(inpBdb);

Output:

<a>
<aaronica>
<aaronico>
<aaronita>
<ab>
<aba>
<baba> !!! is ababa not baba, the a is missing
<ababillarse>
<ababol>
<abaca>
<abacal>
<abacalera>
<abacalero>
<abacera>
<abaceria>
<abacero>
<abacial>
...

If greater files loses charaters in several lines

Input file:

a
aaronica
aaronico
aaronita
ab
aba
ababa
ababillarse
ababol
abaca
abacal
abacalera
abacalero
abacera
abaceria
abacero
abacial
abaco
abacora
abacorar
abad
abada
abadejo
abadenga
abadengo
abadernar
abadesa
abadi
abadia
abadiado
abadiato
abajadero
abajamiento
abajar
abajena
abajeno
abajera
abajo
abajote
abalada
abalado
abalanzar
abalar
abalaustrada
abalaustrado
abaldonadamente
abaldonamiento
abaldonar
abaleador
abaleadora
abaleadura
abalear
abaleo
abalizamiento
abalizar
abalorio
abaluartar
aballar
aballestar
abanador
abanar
abancalar

<end of file>

Change History (7)

comment:1 Changed 21 years ago by danirus

Resolution: invalid
Status: newclosed

comment:2 Changed 21 years ago by request

Resolution: invalid
Status: closedreopened

For the CRACK (bug 106) the correct bug was
-> http://bugs.tol-project.org/show_bug.cgi?id=109 the WriteLn()

But, in any case, BDBReg() lose one character sometimes (this bug 105) .

Set inpBdb = BDBOpen("error200408-105-106.txt", 0, "\n", "", "");
Real maxReg = inpBdb->RegNumber;
Real numReg = 1;
Real While(LE(numReg,maxReg),
{

Text inpLin = BDBReg(inpBdb, numReg)[1]; Read a line
/* Text */ WriteLn("<"+inpLin+">");
Whithout Text
Real(numReg:=numReg+1);
TRUE

});

Real BDBClose(inpBdb);

comment:3 Changed 21 years ago by danirus

This bug is merely incredible but real.
First, I have to say that the implementation of BQFile and BQSepFile classes
have been modified to also support GNU/Linux environments.
There is a rare behavior when reading the seventh line of the file: "ababa". If
we change the line eight, the problem disappears.

The changes in classes BQFile and BQSepFile are in Tol CVS.

comment:4 Changed 21 years ago by manuelb

Owner: changed from danirus to manuelb
Status: reopenednew

comment:5 Changed 21 years ago by manuelb

Status: newassigned

comment:6 Changed 16 years ago by Víctor de Buen Remiro

Owner: changed from manuelb to Víctor de Buen Remiro

Problem seems to be solved a long time ago.

comment:7 Changed 16 years ago by Víctor de Buen Remiro

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.