'Dot representation of the aligned sentence'

def _to_dot(self):

    s = u'graph    align    {\n'
    s += u'node[shape=plaintext]\n'
    for w in self._words:
        s += (u'"%s_source"    [label="%s"]    \n' % (w, w))
    for w in self._mots:
        s += (u'"%s_target"    [label="%s"]    \n' % (w, w))
    for (u, v) in self._alignment:
        s += (u'"%s_source"    --    "%s_target"    \n' % (self._words[u], self._mots[v]))
    for i in range((len(self._words) - 1)):
        s += (u'"%s_source"    --    "%s_source"    [style=invis]\n' % (self._words[i], self._words[(i + 1)]))
    for i in range((len(self._mots) - 1)):
        s += (u'"%s_target"    --    "%s_target"    [style=invis]\n' % (self._mots[i], self._mots[(i + 1)]))
    s += (u'{rank    =    same;    %s}\n' % u'    '.join(((u'"%s_source"' % w) for w in self._words)))
    s += (u'{rank    =    same;    %s}\n' % u'    '.join(((u'"%s_target"' % w) for w in self._mots)))
    s += u'}'
    return s
