| 1598 | else : s = token.custom_tags.get(tag) |
| 1599 | return s or placeholder |
| 1600 | def outline(column, fill=1, padding=3, align="left"): |
| 1601 | # Add spaces to each string in the column so they line out to the highest width. |
| 1602 | n = max([len(x) for x in column]+[fill]) |
| 1603 | if align == "left" : return [x+" "*(n-len(x))+" "*padding for x in column] |
| 1604 | if align == "right" : return [" "*(n-len(x))+x+" "*padding for x in column] |
| 1605 | |
| 1606 | # Gather the tags of the tokens in the sentece per column. |
| 1607 | # If the IOB-tag is I-, mark the chunk tag with "^". |