d 0 0 a 0 1 ɑ̃ 1 0 s 1 1 #### das dɑ̃s #### #!/usr/bin/perl use strict; use warnings; binmode(STDOUT, ":utf8"); open HASH, '<:utf8', "test_hash.txt"; my %hash = (); while (my $line=) { chomp $line; $line =~ s/^(.*?)\t//; my $key = $1; my @line = split /\s+/, $line; $hash{$key} = \@line; } # foreach my $phoneme (keys %hash) { # print $phoneme . ":"; # my @line = @{ $hash{$phoneme} }; # print join ",", @line; # print "\n"; # } open INPUTFILE, '<:utf8', "test_input.txt";; while (my $entry = ) { chomp $entry; print $entry . "\n"; my @word = $entry =~ /(\X)/g; for (my $j=0; $j<@word; $j++) { my $letter = $word[$j]; my $input_features = $hash{$letter}; my @input_features = @{ $input_features }; print join " ", @input_features; print "\n"; } }