django_ocr_server/utils.py
def pdf_need_ocr(pdf_text):
    """
    This function analyses a text of a pdf document and determines whenever pdf document is need to be OCRed or not 2019-03-11
    :param pdf_text: a text of a pdf document
    :return: boolean. True if a pdf document need to be OCRed, False otherwise
    """
    if not len(pdf_text):
        return True  # a pdf document does not contain a text. It needs to be OCRed
    if regex.search(r'\p{IsCyrillic}', pdf_text):
        return False  # a pdf document contains cyrillic symbols. It does not need to be OCRed
    if re.search(r'the', pdf_text, re.IGNORECASE):
        return False  # a pdf document contains the 'the' article. It needs to be OCRed
    return True

    This function analyses a text of a pdf document and determines whenever pdf document is need to be OCRed or not 2019-03-11
    :param pdf_text: a text of a pdf document
    :return: boolean. True if a pdf document need to be OCRed, False otherwise
    
This function analyses a text of a pdf document and determines whenever pdf document is need to be OCRed or not 2019-03-11
This function analyses a text of a pdf document and determines whenever pdf document is need to be OCRed or not 2019 - 03 - 11
def pdf_need_ocr(pdf_text):
    if not len(pdf_text):
        return True  
    if regex.search(r'\p{IsCyrillic}', pdf_text):
        return False  
    if re.search(r'the', pdf_text, re.IGNORECASE):
        return False  
    return True
def pdf_need_ocr ( pdf_text ) : if not len ( pdf_text ) : return True if regex . search ( r'\p{IsCyrillic}' , pdf_text ) : return False if re . search ( r'the' , pdf_text , re . IGNORECASE ) : return False return True
This function analyses a text of a pdf document and determines whenever pdf document is need to be OCRed or not 2019-03-11
This function analyses a text of a pdf document and determines whenever pdf document is need to be OCRed or not 2019 - 03 - 11
"""
    This function analyses a text of a pdf document and determines whenever pdf document is need to be OCRed or not 2019-03-11
    :param pdf_text: a text of a pdf document
    :return: boolean. True if a pdf document need to be OCRed, False otherwise
    """ # a pdf document does not contain a text. It needs to be OCRed # a pdf document contains cyrillic symbols. It does not need to be OCRed # a pdf document contains the 'the' article. It needs to be OCRed
boolean. True if a pdf document need to be OCRed, False otherwise
boolean . True if a pdf document need to be OCRed False otherwise
pdf_text
a text of a pdf document
a text of a pdf document