use strict;
use IO::All;

my $io = io('.');

my @all;

for ($io->all) {
	next unless /\.txt\Z/; # print $_, "\n";
	push @all, io($_)->chomp->slurp;
}

my %words;

for (@all) { 
	chomp;
	next if /\A#/; # print $_, "\n"; 
	next unless /\w+/; # print $_, "\n";
	$words{$_}++;
}

my @unique = keys %words;

#print scalar @all, "\n";
#print scalar @unique, "\n";

my $str = join '', @unique;
$str > io('temp.dic'); 

#system `aspell --lang=en create master ./en-medical.rws < ./temp.dic`
