02_build_empty_tree.pl

This Perl script is used to prepare the directory structure of the prefix tree.

This is the documentation of all downloads.

Move your mouse over the code area and look at its top right corner where a set of icons for downloading, copy-pasting, etc. will appear.


#!/usr/bin/perl
use strict;
use warnings;

use Tree::Prefix;

# =============== parameters ===============

our $limit=10;		# number of suggestions to show

# ======================= initialize =======================

my @species=qw/drome caeel human/;

my $tree=new Tree::Prefix;
$tree->{limit}=$limit;
my $pwd=$tree->pwd;

# ======================= read from file =======================

for my $species (@species) {
	$tree->set_basedir("$pwd/$species");

	print STDERR "loading species: $species\n";
	$tree->load_file_to_hash("$pwd/prefixes_$species.dat");

	$tree->{hash}->cut_tree($limit);
	$tree->hash_tree_2_dir_tree;
}