43 lines
2.7 KiB
XML
43 lines
2.7 KiB
XML
<svg width="700" height="240" xmlns="http://www.w3.org/2000/svg">
|
|
<defs>
|
|
<marker id="dep-arrow" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
|
|
<polygon points="0 0, 8 3, 0 6" fill="#555"/>
|
|
</marker>
|
|
</defs>
|
|
<text x="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Dependency Tree: "the cat sat on the mat"</text>
|
|
|
|
<!-- Words on baseline -->
|
|
<text x="100" y="160" fill="#333" font-size="16" text-anchor="middle" font-weight="bold">the</text>
|
|
<text x="200" y="160" fill="#333" font-size="16" text-anchor="middle" font-weight="bold">cat</text>
|
|
<text x="330" y="160" fill="#e74c3c" font-size="16" text-anchor="middle" font-weight="bold">sat</text>
|
|
<text x="430" y="160" fill="#333" font-size="16" text-anchor="middle" font-weight="bold">on</text>
|
|
<text x="530" y="160" fill="#333" font-size="16" text-anchor="middle" font-weight="bold">the</text>
|
|
<text x="620" y="160" fill="#333" font-size="16" text-anchor="middle" font-weight="bold">mat</text>
|
|
|
|
<!-- ROOT marker -->
|
|
<text x="330" y="42" fill="#e74c3c" font-size="11" text-anchor="middle" font-weight="bold">ROOT</text>
|
|
<line x1="330" y1="46" x2="330" y2="140" stroke="#e74c3c" stroke-width="1.5" marker-end="url(#dep-arrow)"/>
|
|
|
|
<!-- sat → cat (nsubj) - arc above -->
|
|
<path d="M 320,140 Q 260,75 210,140" fill="none" stroke="#3498db" stroke-width="1.8" marker-end="url(#dep-arrow)"/>
|
|
<text x="260" y="90" fill="#3498db" font-size="10" text-anchor="middle" font-weight="bold">nsubj</text>
|
|
|
|
<!-- sat → on (prep) - arc above -->
|
|
<path d="M 340,140 Q 385,90 420,140" fill="none" stroke="#27ae60" stroke-width="1.8" marker-end="url(#dep-arrow)"/>
|
|
<text x="385" y="105" fill="#27ae60" font-size="10" text-anchor="middle" font-weight="bold">prep</text>
|
|
|
|
<!-- cat → the (det) - arc below -->
|
|
<path d="M 190,170 Q 150,205 110,170" fill="none" stroke="#9b59b6" stroke-width="1.5" marker-end="url(#dep-arrow)"/>
|
|
<text x="150" y="210" fill="#9b59b6" font-size="10" text-anchor="middle">det</text>
|
|
|
|
<!-- on → mat (pobj) - arc above -->
|
|
<path d="M 440,140 Q 530,80 610,140" fill="none" stroke="#f39c12" stroke-width="1.8" marker-end="url(#dep-arrow)"/>
|
|
<text x="530" y="92" fill="#f39c12" font-size="10" text-anchor="middle" font-weight="bold">pobj</text>
|
|
|
|
<!-- mat → the (det) - arc below -->
|
|
<path d="M 610,170 Q 575,205 540,170" fill="none" stroke="#9b59b6" stroke-width="1.5" marker-end="url(#dep-arrow)"/>
|
|
<text x="575" y="210" fill="#9b59b6" font-size="10" text-anchor="middle">det</text>
|
|
|
|
<!-- Legend -->
|
|
<text x="350" y="235" fill="#666" font-size="10" text-anchor="middle">Arrows point from head to dependent. "sat" is the root; every other word depends on exactly one head.</text>
|
|
</svg> |