diff --git a/code/python/src/hirschberg/types.py b/code/python/src/hirschberg/types.py index 7578599..3ec2e0e 100644 --- a/code/python/src/hirschberg/types.py +++ b/code/python/src/hirschberg/types.py @@ -46,7 +46,7 @@ class Alignment(): indent: str = ' ', prefix: str = '', braces: bool = False, - branch: str = '|____ ', + branch: str = ' └──── ', ) -> str: return '\n'.join(list(self._astree_recursion(indent=indent, prefix=prefix, braces=braces, branch=branch))); @@ -56,19 +56,24 @@ class Alignment(): indent: str = ' ', prefix: str = '', braces: bool = False, - branch: str = '|____ ', + branch: str = ' └──── ', + branch_atom: str = '˚└──── ', ) -> Generator[str, None, None]: word1 = self.as_string1(braces=braces); word2 = self.as_string2(braces=braces); if isinstance(self, AlignmentBasic): - u = prefix + branch if depth > 0 else prefix; + u = prefix + branch_atom if depth > 0 else prefix; yield f'{u}{word2}'; + if depth == 0: + yield f'{" "*len(u)}{"-"*len(word1)}'; yield f'{" "*len(u)}{word1}'; elif isinstance(self, AlignmentPair): u = prefix + branch if depth > 0 else prefix; yield f'{u}{word2}'; + if depth == 0: + yield f'{" "*len(u)}{"-"*len(word1)}'; yield f'{" "*len(u)}{word1}'; - yield ''; + yield f'{indent}{prefix} │'; yield from self.left._astree_recursion( depth = depth + 1, indent = indent,