'determines the type of html line ending used most commonly in a document
use before calling docanalysis functions'

def analyze_line_endings(self, html):

    paras_reg = re.compile('<p[^>]*>', re.IGNORECASE)
    spans_reg = re.compile('<span[^>]*>', re.IGNORECASE)
    paras = len(paras_reg.findall(html))
    spans = len(spans_reg.findall(html))
    if (spans > 1):
        if ((float(paras) / float(spans)) < 0.75):
            return 'spanned_html'
        else:
            return 'html'
    else:
        return 'html'
