Tool for drawing parse trees?

Xodarap picture Xodarap · Feb 11, 2011 · Viewed 15.4k times · Source

Does anyone have a good tool for drawing parse trees arising from a context-free grammar? There is this question, but it dealt specifically with finite automata instead of parse trees. I've been using graphviz, but it's kind of annoying to have to label each node individually etc.

Answer

Franck Dernoncourt picture Franck Dernoncourt · Jan 8, 2018

You can use http://ironcreek.net/phpsyntaxtree/.

Example:

enter image description here

Input was:

[ROOT
  [S
    [S
      [NP [PRP It]]
      [VP [VBZ is]
        [NP
          [QP [RB nearly] [DT half] [JJ past] [CD five]]]]]
    [, ,]
    [S
      [NP [PRP we]]
      [VP [MD can] [RB not]
        [VP [VB reach]
          [NP [NN town]]
          [PP [IN before]
            [NP [NN dark]]]]]]
    [, ,]
    [S
      [NP [PRP we]]
      [VP [MD will]
        [VP [VB miss]
          [NP [NN dinner]]]]]
    [. .]]]

Also works if the string has no line breaks, e.g.:

[S [NP [DT The] [NN man]] [VP [VBZ is] [VP [VBG running] [PP [IN on] [NP [DT the] [NN mountain]]]]] [. .]]