source/io/output.py
def parse_HTML(data):  
    """Create the final HTML that's output to the user"""

    if_header2_open = if_header3_open = if_bold_open = if_italic_open = if_paragraph_open = False

    combined = ""
    for word in data:
        article_word = encode_text(word[0])
        if(word[1]!="," and word[1]!= "'" and word[1]!= "." and word[0]!= "'s" #Punctuation that doesn't need space before it
           and word[1]!="``" and word[1]!="''" and word[1]!='"'): #Quotation marks
            if word[0] == "_HEADER2START_":
                combined = combined + "<h3>" #<h2> is too big, so consistently bring it down a number
                if_header2_open = True
            elif word[0] == "_HEADER2END_":
                combined = combined + "</h3>"
            elif word[0] == "_HEADER3START_":
                combined = combined + "<h4>"
                if_header3_open = True
            elif word[0] == "_HEADER3END_":
                combined = combined + "</h4>"
                if_header3_open = False
            elif word[0] == "_BOLDSTART_":
                combined = combined + "<b>"
                if_bold_open = True
            elif word[0] == "_BOLDEND_":
                combined = combined + "</b>"
                if_bold_open = False
            elif word[0] == "_ITALICSTART_":
                combined = combined + "<i>"
                if_italic_open = True
            elif word[0] == "_ITALICEND_":
                combined = combined + "</i>"
                if_italic_open = False
            elif word[0] == "_PARAGRAPHSTART_":
                combined = combined + "<p>"
                if_paragraph_open = True
            elif word[0] == "_PARAGRAPHEND_":
                combined = combined + "</p>"
                if_paragraph_open = False
            elif word[2] == 'fail':
                combined = combined + ''' <span class="bad" title="'''+word[1]+'''" >''' + article_word + "</span>"
            elif word[2] == 'pass':
                combined = combined + ''' <span class="good" title="'''+word[1]+'''" >''' + article_word + "</span>"
            else:
                combined = combined + " " + article_word
        else: #Punctuation, so no space needed.
            combined = combined + article_word
    if if_header2_open:
        combined = combined + "</h3>"
    if if_header3_open:
        combined = combined + "</h4>"
    if if_bold_open:
        combined = combined + "</b>"
    if if_italic_open:
        combined = combined + "</i>"
    if if_paragraph_open:
        combined = combined + "</p>"
    
    return combined
Create the final HTML that's output to the user
Create the final HTML that's output to the user
Create the final HTML that ' s output to the user
def parse_HTML(data):  
    if_header2_open = if_header3_open = if_bold_open = if_italic_open = if_paragraph_open = False
    combined = ""
    for word in data:
        article_word = encode_text(word[0])
        if(word[1]!="," and word[1]!= "'" and word[1]!= "." and word[0]!= "'s" 
           and word[1]!="``" and word[1]!="''" and word[1]!='"'): 
            if word[0] == "_HEADER2START_":
                combined = combined + "<h3>" 
                if_header2_open = True
            elif word[0] == "_HEADER2END_":
                combined = combined + "</h3>"
            elif word[0] == "_HEADER3START_":
                combined = combined + "<h4>"
                if_header3_open = True
            elif word[0] == "_HEADER3END_":
                combined = combined + "</h4>"
                if_header3_open = False
            elif word[0] == "_BOLDSTART_":
                combined = combined + "<b>"
                if_bold_open = True
            elif word[0] == "_BOLDEND_":
                combined = combined + "</b>"
                if_bold_open = False
            elif word[0] == "_ITALICSTART_":
                combined = combined + "<i>"
                if_italic_open = True
            elif word[0] == "_ITALICEND_":
                combined = combined + "</i>"
                if_italic_open = False
            elif word[0] == "_PARAGRAPHSTART_":
                combined = combined + "<p>"
                if_paragraph_open = True
            elif word[0] == "_PARAGRAPHEND_":
                combined = combined + "</p>"
                if_paragraph_open = False
            elif word[2] == 'fail':
                combined = combined + ''' <span class="bad" title="'''+word[1]+'''" >''' + article_word + "</span>"
            elif word[2] == 'pass':
                combined = combined + ''' <span class="good" title="'''+word[1]+'''" >''' + article_word + "</span>"
            else:
                combined = combined + " " + article_word
        else: 
            combined = combined + article_word
    if if_header2_open:
        combined = combined + "</h3>"
    if if_header3_open:
        combined = combined + "</h4>"
    if if_bold_open:
        combined = combined + "</b>"
    if if_italic_open:
        combined = combined + "</i>"
    if if_paragraph_open:
        combined = combined + "</p>"
    return combined
def parse_HTML ( data ) : if_header2_open = if_header3_open = if_bold_open = if_italic_open = if_paragraph_open = False combined = "" for word in data : article_word = encode_text ( word [ 0 ] ) if ( word [ 1 ] != "," and word [ 1 ] != "'" and word [ 1 ] != "." and word [ 0 ] != "'s" and word [ 1 ] != "``" and word [ 1 ] != "''" and word [ 1 ] != '"' ) : if word [ 0 ] == "_HEADER2START_" : combined = combined + "<h3>" if_header2_open = True elif word [ 0 ] == "_HEADER2END_" : combined = combined + "</h3>" elif word [ 0 ] == "_HEADER3START_" : combined = combined + "<h4>" if_header3_open = True elif word [ 0 ] == "_HEADER3END_" : combined = combined + "</h4>" if_header3_open = False elif word [ 0 ] == "_BOLDSTART_" : combined = combined + "<b>" if_bold_open = True elif word [ 0 ] == "_BOLDEND_" : combined = combined + "</b>" if_bold_open = False elif word [ 0 ] == "_ITALICSTART_" : combined = combined + "<i>" if_italic_open = True elif word [ 0 ] == "_ITALICEND_" : combined = combined + "</i>" if_italic_open = False elif word [ 0 ] == "_PARAGRAPHSTART_" : combined = combined + "<p>" if_paragraph_open = True elif word [ 0 ] == "_PARAGRAPHEND_" : combined = combined + "</p>" if_paragraph_open = False elif word [ 2 ] == 'fail' : combined = combined + ''' <span class="bad" title="''' + word [ 1 ] + '''" >''' + article_word + "</span>" elif word [ 2 ] == 'pass' : combined = combined + ''' <span class="good" title="''' + word [ 1 ] + '''" >''' + article_word + "</span>" else : combined = combined + " " + article_word else : combined = combined + article_word if if_header2_open : combined = combined + "</h3>" if if_header3_open : combined = combined + "</h4>" if if_bold_open : combined = combined + "</b>" if if_italic_open : combined = combined + "</i>" if if_paragraph_open : combined = combined + "</p>" return combined
Create the final HTML that's output to the user
Create the final HTML that ' s output to the user
"""Create the final HTML that's output to the user""" #Punctuation that doesn't need space before it #Quotation marks #<h2> is too big, so consistently bring it down a number #Punctuation, so no space needed.
data