in reply to matching arrays
Make a bit vector, each bit corresponding to a search term (bit 0 means 'male', bit 1 'female'). Convert your occurences into bit vectors as well and use those as keys in your tally ([ 'male', 'child'] would have bits 0 and 2 set (0b101)). Then turn the bit vector keys back into the original terms on the way out.
Update: I was going to expand on this but connectivity on the train was kinda spotty. At any rate, see perldoc -f vec and search for Set modules on CPAN (since that's basically what you're asking about).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: matching arrays
by rsiedl (Friar) on May 25, 2004 at 21:31 UTC | |
by Jasper (Chaplain) on May 26, 2004 at 09:12 UTC |