'''
Created on 17.12.2013

@author: hgessner
'''

import copy
from slideocr.Handlers import Ocr
from slideocr.ocr.Tesseract import Tesseract
from slideocr.ocr.Abbyy import AbbyyCloud


class OcrEngines(Ocr):
    '''
    Combines several ocr engines
    '''
    
    engines = []
    
    def __init__(self, skipAbbyy = False, skipTesseract = False, tesseractLanguage = "eng", abbyyLanguage = "English", abbyyBatchSize = 100):
        if not skipTesseract:
            self.engines.append(Tesseract(tesseractLanguage))
        if not skipAbbyy:
            self.engines.append(AbbyyCloud(abbyyBatchSize, abbyyLanguage))
    
    
    def process(self, images):
        result = []
        for engine in self.engines:
            engineImages = copy.deepcopy(images)
            engineImages = engine.process(engineImages)
            result.extend(engineImages)
        return result

3284031df109eae8189853c481fb0b7fbd939238
<mask token>


class OcrEngines(Ocr):
    <mask token>
    <mask token>

    def __init__(self, skipAbbyy=False, skipTesseract=False,
        tesseractLanguage='eng', abbyyLanguage='English', abbyyBatchSize=100):
        if not skipTesseract:
            self.engines.append(Tesseract(tesseractLanguage))
        if not skipAbbyy:
            self.engines.append(AbbyyCloud(abbyyBatchSize, abbyyLanguage))

    def process(self, images):
        result = []
        for engine in self.engines:
            engineImages = copy.deepcopy(images)
            engineImages = engine.process(engineImages)
            result.extend(engineImages)
        return result

<mask token>


class OcrEngines(Ocr):
    <mask token>
    engines = []

    def __init__(self, skipAbbyy=False, skipTesseract=False,
        tesseractLanguage='eng', abbyyLanguage='English', abbyyBatchSize=100):
        if not skipTesseract:
            self.engines.append(Tesseract(tesseractLanguage))
        if not skipAbbyy:
            self.engines.append(AbbyyCloud(abbyyBatchSize, abbyyLanguage))

    def process(self, images):
        result = []
        for engine in self.engines:
            engineImages = copy.deepcopy(images)
            engineImages = engine.process(engineImages)
            result.extend(engineImages)
        return result

<mask token>


class OcrEngines(Ocr):
    """
    Combines several ocr engines
    """
    engines = []

    def __init__(self, skipAbbyy=False, skipTesseract=False,
        tesseractLanguage='eng', abbyyLanguage='English', abbyyBatchSize=100):
        if not skipTesseract:
            self.engines.append(Tesseract(tesseractLanguage))
        if not skipAbbyy:
            self.engines.append(AbbyyCloud(abbyyBatchSize, abbyyLanguage))

    def process(self, images):
        result = []
        for engine in self.engines:
            engineImages = copy.deepcopy(images)
            engineImages = engine.process(engineImages)
            result.extend(engineImages)
        return result

<mask token>
import copy
from slideocr.Handlers import Ocr
from slideocr.ocr.Tesseract import Tesseract
from slideocr.ocr.Abbyy import AbbyyCloud


class OcrEngines(Ocr):
    """
    Combines several ocr engines
    """
    engines = []

    def __init__(self, skipAbbyy=False, skipTesseract=False,
        tesseractLanguage='eng', abbyyLanguage='English', abbyyBatchSize=100):
        if not skipTesseract:
            self.engines.append(Tesseract(tesseractLanguage))
        if not skipAbbyy:
            self.engines.append(AbbyyCloud(abbyyBatchSize, abbyyLanguage))

    def process(self, images):
        result = []
        for engine in self.engines:
            engineImages = copy.deepcopy(images)
            engineImages = engine.process(engineImages)
            result.extend(engineImages)
        return result

'''
Created on 17.12.2013

@author: hgessner
'''

import copy
from slideocr.Handlers import Ocr
from slideocr.ocr.Tesseract import Tesseract
from slideocr.ocr.Abbyy import AbbyyCloud


class OcrEngines(Ocr):
    '''
    Combines several ocr engines
    '''
    
    engines = []
    
    def __init__(self, skipAbbyy = False, skipTesseract = False, tesseractLanguage = "eng", abbyyLanguage = "English", abbyyBatchSize = 100):
        if not skipTesseract:
            self.engines.append(Tesseract(tesseractLanguage))
        if not skipAbbyy:
            self.engines.append(AbbyyCloud(abbyyBatchSize, abbyyLanguage))
    
    
    def process(self, images):
        result = []
        for engine in self.engines:
            engineImages = copy.deepcopy(images)
            engineImages = engine.process(engineImages)
            result.extend(engineImages)
        return result
