in reply to Identifying bigrams and making a note of which ones exist
Well, first, we can make @bigram like this:
@bigram = ( 'aa' .. 'zz' ); # magic!
Next, do the searching and remembering (this is just one way to do it):
# make a "set" of the ones in the list: my %bigram_list; @bigram_list{@bigram_list} = (); # corresponds to (and same size as) @bigram. my @bigrams_existing = map { exists $bigram_list{$_} ? 1 : 0 } @bigram;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Identifying bigrams and making a note of which ones exist
by GrandFather (Saint) on Mar 10, 2006 at 21:06 UTC |