def __init__(self): """ """ Component.__init__(self, "DS2PageXml", self.usage, self.version, self.description) self.dpi = 300 self.nle_id = 10000 self.storagePath = '' self.dTagNameMapping = { 'PAGE': 'Page', 'TEXT': 'TextLine', 'LINE': 'TextLine', 'COLUMN': 'TextRegion', 'REGION': 'TextRegion', 'BLOCK': 'TextRegion', 'GRAPHELT': 'LineDrawingRegion', 'TABLE': 'TableRegion', 'CELL': 'TableCell', 'SeparatorRegion': 'SeparatorRegion' } self.pageXmlNS = None self.bMultiPages = False self.bRegionOnly = False
def setParams(self, dParams): """ Always call first the Component setParams """ Component.setParams(self, dParams) if "bMultiPage" in dParams: self.bMultiPages = dParams["bMultiPage"] if "bRegionOnly" in dParams: self.bRegionOnly = dParams["bRegionOnly"] if "outdir" in dParams: self.storagePath = dParams["outdir"]