I am requesting leads, suggestions and comments for the following problem. The problem is, how can one graphically 'draw' *diagrams* (aka graphs, directed-graphs, recursive transition networks, etc) and have that *diagram* be spit out into text? (We already know how to do the reverse with perl and GraphViz).

In other words, I would like to be able to start by drawing something like specimen1 and then from that, automatically generate something like specimen2. I would also like to be able to do the reverse.

The key sticking point is *bi-directional interactivity* it should be easy to go from diagram to text or text to diagram. It doesn't have to be native perl, (XML, SVG, GraphViz dot files or anything works, just as long as it is text or non-proprietary binary format).

No. This is not a homework question. It is part of my due dilligence investigation before I undertake to develop this myself, because if there is no such tool out there, I think it would be useful to either make one, or morph something that already exists into what is described here. In case anyone is wondering, I am leaning toward wxPerl, because of the highly graphical and lexical nature of this undertaking. Critique is welcome.

specimen1:

sentence:                     +-----------+
                            +>| adjective |>+
          +-------------+   | +-----------+ | +------+  +------+
(start)->-| preposition |->-+------->-------+>| noun |--| verb |-(end)
          +-------------+                     +------+  +------+
adjective:       +---------+
             +---| "large" |--+
             |   +---------+  |
             |   +---------+  |
(start) -->--+---| "green" |--+-->-- (end)
             |   +---------+  |
             |   +---------+  |
             +---| "round" |--+
                 +---------+

specimen2:

sentence: pronoun ( adjective | "" ) noun verb ;

adjective: "large" | "green" | "round" ;

The information here and here and here was useful, but unfortunately none of them address both the *bidirectional* aspect and the *graphical* aspect ... the combined goal here.

Any welcome suggestions?


In reply to Diagram to Text and Vice Versa (DAG, RTN) by dimar

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.