@@ -0,0 +1,2448 @@
+package technology.tabula;%0A%0Aimport java.io.File;%0Aimport java.io.FilenameFilter;%0Aimport java.nio.file.Files;%0A%0Aimport org.junit.Test;%0Aimport org.w3c.dom.*;%0A%0Aimport javax.xml.parsers.DocumentBuilder;%0Aimport javax.xml.parsers.DocumentBuilderFactory;%0A%0A/**%0A * Created by matt on 2015-12-14.%0A */%0Apublic class TestTableDetection %7B%0A%0A    @Test%0A    public void testDetectionOfTables() throws Exception %7B%0A        String%5B%5D regionCodes = %7B%22eu%22, %22us%22%7D;%0A%0A        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();%0A        DocumentBuilder builder = factory.newDocumentBuilder();%0A%0A        for (String regionCode : regionCodes) %7B%0A            String directoryName = %22src/test/resources/technology/tabula/icdar2013-dataset/competition-dataset-%22 + regionCode + %22/%22;%0A            File dir = new File(directoryName);%0A%0A            File%5B%5D pdfs = dir.listFiles(new FilenameFilter() %7B%0A                @Override%0A                public boolean accept(File dir, String name) %7B%0A                    return name.toLowerCase().endsWith(%22.pdf%22);%0A                %7D%0A            %7D);%0A%0A            for (File pdf : pdfs) %7B%0A%0A                System.out.println(%22Testing %22 + pdf.getName());%0A%0A                Document regionDocument = builder.parse(pdf.getAbsolutePath().replace(%22.pdf%22, %22-reg.xml%22));%0A%0A                NodeList tables = regionDocument.getElementsByTagName(%22table%22);%0A%0A                for (int i=0; i%3Ctables.getLength(); i++) %7B%0A%0A                    Element table = (Element) tables.item(i);%0A                    int tableId = Integer.parseInt(table.getAttribute(%22id%22));%0A%0A                    Element region = (Element) table.getElementsByTagName(%22region%22).item(0);%0A                    int regionId = Integer.parseInt(region.getAttribute(%22id%22));%0A                    int page = Integer.parseInt(region.getAttribute(%22page%22));%0A%0A                    Element boundingBox = (Element) region.getElementsByTagName(%22bounding-box%22).item(0);%0A                    int x1 = Integer.parseInt(boundingBox.getAttribute(%22x1%22));%0A                    int y1 = Integer.parseInt(boundingBox.getAttribute(%22y1%22));%0A                    int x2 = Integer.parseInt(boundingBox.getAttribute(%22x2%22));%0A                    int y2 = Integer.parseInt(boundingBox.getAttribute(%22y2%22));%0A%0A                    System.out.println(%22Table %22 + tableId + %22 is region %22 + regionId + %22 on page %22 + page + %22 with coords %22 + x1 + %22, %22 + y1 + %22, %22 + x2 + %22, %22 + y2);%0A                %7D%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

Create a test that reads in the icdar xml data