svgling
svgling copied to clipboard
"box_constituent" Option
I am trying to set a frame for one of the elements of my sentence tree, and I'm using the ".box_constituent()" option for that.
Here is my code:
out = svgling.draw_tree(t5, font_size = 20, distance_to_daughter=2.5) out.set_leaf_style(font_size = 28, text_color = 'navy') out.set_node_style((0, 0, 0), font_size = 28, text_color = 'red') out.box_constituent((1, 3, 0)) out.set_node_style((1, 3, 0), font_size = 28, text_color = 'red') out.set_edge_style((1,4,1,1,0), svgling.core.TriangleEdge()) out.movement_arrow((0, 0, 0), (1, 3, 0), stroke_width=1.8, stroke="purple") out
I want both "he" to be red and "boxed".
Here is my outcome so far:
One more question: Can a "strike_through" option be used for a text? In my case, grammar conventions prescribe the initial place for the first "he". In the real text, it is in the middle of a sentence. I have used the ".movement_arrow()" option to visualize the movement. And it works perfectly, as you can see. However, the ".box_constituent()" does not seem to work... Moreover, the initial "he" needs to be stricken through. Could you help, please?