in reply to Re^2: constructing a matrix with perl
in thread constructing a matrix with perl

In that case, I would probably first create the square "matrix" with all entries initialized to 0. Then I would read in the data you have as in my previous reply. Finally, I would loop over the entries making them symmetric. To do this, you could make an array @A with entries AA,...,ZH and then do the symmetrizing over the matrix entries $M{$A[i]}{$A[j]} where i<j.
AA,...,ZH includes 208 values, doesn't it? So it seems like your matrix is much bigger than 39 by 39. But I may be misunderstanding something still.
It is probably possible to do all this in fewer steps, but there probably isn't much change in efficiency.
(I am getting disconnected a lot, so I may stop posting till later.)
chas

Replies are listed 'Best First'.
Re^4: constructing a matrix with perl
by Anonymous Monk on Feb 28, 2005 at 19:10 UTC
    there are 39 values (phonemes) between AA and ZH; AA AE AH AO AW AY B CH D DH EH ER EY F G HH IH IY JH K L M N NG OW OY P R S SH T TH UH UW V W Y Z ZH - thanks for the help its great stuff!