@staticmethod
    def join(left, right):
        if left.n is not None:
            left.delete_digram()
            # This code is ugly and handles a corner case, can it be made more elegant?
            if right.p is not None and right.n is not None and right.value == right.p.value and \
               right.value == right.n.value:
                digrams[str(right.value) + str(right.n.value)] = right
            if left.p is not None and left.n is not None and left.value == left.p.value and \
               left.value == left.n.value:
                digrams[str(left.p.value) + str(left.value)] = left.p
        left.n = right
        right.p = left
Joins two symbols, removing old diagrams from the dictionary.
dataset/ETHPy150Open ResilientScience/wot/wot/sequitur.py/Symbol.join