(x, colors)
| 1514 | } |
| 1515 | |
| 1516 | def _colorize(x, colors): |
| 1517 | s = '' |
| 1518 | if isinstance(x, Word): |
| 1519 | x = x.chunk |
| 1520 | if isinstance(x, Chunk): |
| 1521 | s = ',style=filled, fillcolor="%s", fontcolor="%s"' % ( \ |
| 1522 | colors.get(x.role) or \ |
| 1523 | colors.get(x.type) or \ |
| 1524 | colors.get('') or ("none", "black")) |
| 1525 | return s |
| 1526 | |
| 1527 | def graphviz_dot(sentence, font="Arial", colors=BLUE): |
| 1528 | """ Returns a dot-formatted string that can be visualized as a graph in GraphViz. |
no test coverage detected
searching dependent graphs…