def __add__(self, other):
        """Implements addition in the form of TextWithPosition(...) + (obj).

        >>> t1 = TokenWithPosition('as', 0) + TokenWithPosition('df', 1)
        >>> str(t1)
        'asdf'
        >>> t1.position
        0
        >>> t2 = TokenWithPosition('as', 1) + 'df'
        >>> str(t2)
        'asdf'
        >>> t3 = TokenWithPosition(t2)
        >>> t3.position
        1
        """

        if isinstance(other, TokenWithPosition):
            return TokenWithPosition(self.text + other.text,
                                     self.position)
        else:
            return TokenWithPosition(self.text + other,
                                     self.position)
def __add__ ( self , other ) : if isinstance ( other , TokenWithPosition ) : return TokenWithPosition ( self . text + other . text , self . position ) else : return TokenWithPosition ( self . text + other , self . position )
Implements addition in the form of TextWithPosition(...) + (obj).

        >>> t1 = TokenWithPosition('as', 0) + TokenWithPosition('df', 1)
        >>> str(t1)
        'asdf'
        >>> t1.position
        0
        >>> t2 = TokenWithPosition('as', 1) + 'df'
        >>> str(t2)
        'asdf'
        >>> t3 = TokenWithPosition(t2)
        >>> t3.position
        1