def split_words(s):
    """Разделяет текст на слова по-умному для подсчёта различий."""
    ALPHA = 1
    SPACE = 2
    OTHER = 0
    result = []
    last = OTHER
    tag = False
    for char in s:
        current = OTHER
        if char.isspace():
            current = SPACE
        elif char.isalpha() or char.isdigit():
            current = ALPHA
        if char == '\n':
            result.append(char)
            tag = False
        elif current == SPACE:
            if tag or not result or last == SPACE or last == OTHER:
                result.append(char)
                tag = False
            else:
                result[-1] += char
        elif char == '<':
            result.append(char)
            tag = True
        elif tag and (current == ALPHA or char == '=' or char == '/' or 
            char == '>'):
            result[-1] += char
            if char == '>':
                tag = False
        elif current != OTHER and current == last:
            result[-1] += char
        elif current == OTHER and last == ALPHA and char in '.,?!:;':
            result[-1] += char
        else:
            result.append(char)
            tag = False
        last = current
    return result
