MCPcopy Index your code
hub / github.com/clips/pattern / _colorize

Function _colorize

pattern/text/tree.py:1516–1525  ·  view source on GitHub ↗
(x, colors)

Source from the content-addressed store, hash-verified

1514}
1515
1516def _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
1527def graphviz_dot(sentence, font="Arial", colors=BLUE):
1528 """ Returns a dot-formatted string that can be visualized as a graph in GraphViz.

Callers 1

graphviz_dotFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…