<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    Graph::Reader::UnicodeTree - Perl class for reading a graph from unicode
    tree text format.

SYNOPSIS
     use Graph::Reader::UnicodeTree;

     my $obj = Graph::Reader::UnicodeTree-&gt;new;
     my $graph = $obj-&gt;read_graph($unicode_tree_file);

METHODS
  "new"
     my $obj = Graph::Reader::UnicodeTree-&gt;new;

    Constructor. This doesn't take any arguments.

    Returns Graph::Reader::UnicodeTree object.

  "read_graph"
     my $graph = $obj-&gt;read_graph($unicode_tree_file);

    Read a graph from the specified file. The argument can either be a
    filename, or a filehandle for a previously opened file.

    Returns Graph object.

UNICODE TREE FILE FORMAT
     Vertices are simple text.
     Edges are 'â”€â”¬â”€' or 'â”€â”€â”€' in main line and ' â”œâ”€' or ' â””â”€' in other lines.
     Example:
     1â”€â”¬â”€2
       â”œâ”€3â”€â”€â”€4
       â”œâ”€5
       â”œâ”€6â”€â”¬â”€7
       â”‚   â”œâ”€8
       â”‚   â””â”€9
       â””â”€10

EXAMPLE1
     use strict;
     use warnings;

     use Encode qw(decode_utf8 encode_utf8);
     use Graph::Reader::UnicodeTree;
     use IO::Barf qw(barf);
     use File::Temp qw(tempfile);

     # Example data.
     my $data = decode_utf8(&lt;&lt;'END');
     1â”€â”¬â”€2
       â”œâ”€3â”€â”€â”€4
       â”œâ”€5
       â”œâ”€6â”€â”¬â”€7
       â”‚   â”œâ”€8
       â”‚   â””â”€9
       â””â”€10
     END

     # Temporary file.
     my (undef, $tempfile) = tempfile();

     # Save data to temp file.
     barf($tempfile, encode_utf8($data));

     # Reader object.
     my $obj = Graph::Reader::UnicodeTree-&gt;new;

     # Get graph from file.
     my $g = $obj-&gt;read_graph($tempfile);

     # Clean temporary file.
     unlink $tempfile;

     # Print to output.
     print $g."\n";

     # Output:
     # 1-10,1-2,1-3,1-5,1-6,3-4,6-7,6-8,6-9

EXAMPLE2
     use strict;
     use warnings;

     use Graph::Reader::UnicodeTree;

     if (@ARGV &lt; 1) {
             print STDERR "Usage: $0 data_file\n";
             exit 1;
     }
     my $data_file = $ARGV[0];

     # Reader object.
     my $obj = Graph::Reader::UnicodeTree-&gt;new;

     # Get graph from file.
     my $g = $obj-&gt;read_graph($data_file);

     # Print to output.
     print $g."\n";

     # Output like:
     # 1-10,1-2,1-3,1-5,1-6,3-4,6-7,6-8,6-9

DEPENDENCIES
    Encode, Graph::Reader, Readonly.

SEE ALSO
    Graph::Reader
        base class for Graph file format readers

    Task::Graph::Reader
        Install the Graph::Reader modules.

REPOSITORY
    &lt;https://github.com/michal-josef-spacek/Graph-Reader-UnicodeTree&gt;

AUTHOR
    Michal Josef إ&nbsp;paؤچek &lt;mailto:skim@cpan.org&gt;

    &lt;http://skim.cz&gt;

LICENSE AND COPYRIGHT
    آ© Michal Josef إ&nbsp;paؤچek 2013-2021

    BSD 2-Clause License

VERSION
    0.03

</pre></body></html>