melisabok / tabula-java

Extract tables from PDF files
MIT License
1 stars 2 forks source link

TestTableDetection.[26]: Differences in horizontal rulings #13

Open melisabok opened 7 years ago

melisabok commented 7 years ago

For the first rulings there is a difference of 1, so we get different y in the detected table and the test fails

old: [x=75.0,y=154.0,w=447.0,h=344.0,bottom=498.000000,right=522.000000]

new: [x=75.0,y=155.0,w=446.0,h=343.0,bottom=498.000000,right=521.000000]

and the expected table should be

technology.tabula.Rectangle[x=82.0,y=154.88995,w=400.0,h=338.0,bottom=492.889954,right=482.000000]

because 155 > 154.88 then the test fails because the contains(comparePages) evaluation returns false.

old:

horizontalRulings: [class technology.tabula.Ruling[x1=76.500000 y1=155.250000 x2=520.500000 y2=155.250000], class technology.tabula.Ruling[x1=76.500000 y1=169.000000 x2=520.500000 y2=169.000000], class technology.tabula.Ruling[x1=76.500000 y1=218.250000 x2=520.500000 y2=218.250000], class technology.tabula.Ruling[x1=76.500000 y1=290.750000 x2=520.500000 y2=290.750000], class technology.tabula.Ruling[x1=76.500000 y1=362.750000 x2=520.500000 y2=362.750000], class technology.tabula.Ruling[x1=76.500000 y1=398.750000 x2=520.500000 y2=398.750000], class technology.tabula.Ruling[x1=76.500000 y1=459.250000 x2=520.500000 y2=459.250000], class technology.tabula.Ruling[x1=76.500000 y1=496.500000 x2=520.500000 y2=496.500000]]

new:

horizontalRulings: [class technology.tabula.Ruling[x1=76.250000 y1=156.250000 x2=519.750000 y2=156.250000], class technology.tabula.Ruling[x1=76.250000 y1=169.500000 x2=519.750000 y2=169.500000], class technology.tabula.Ruling[x1=76.250000 y1=219.250000 x2=519.750000 y2=219.250000], class technology.tabula.Ruling[x1=76.250000 y1=291.250000 x2=519.750000 y2=291.250000], class technology.tabula.Ruling[x1=76.250000 y1=363.250000 x2=519.750000 y2=363.250000], class technology.tabula.Ruling[x1=76.250000 y1=399.750000 x2=519.750000 y2=399.750000], class technology.tabula.Ruling[x1=76.250000 y1=459.750000 x2=519.750000 y2=459.750000], class technology.tabula.Ruling[x1=76.250000 y1=497.000000 x2=519.750000 y2=497.000000]]
jazzido commented 7 years ago

When changes between master and pdfbox2.0 are this small, just modify the tests's expectation. While making sure that they make semantic sense, of course.

melisabok commented 7 years ago

https://github.com/melisabok/tabula-java/commit/cf540728aa538fa6b7227a6a92d5ea1268a84359