Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

hash of hashes
Hi.
I have a file with a word and it's part-of-speech on each line.
I have so far put all words in one array and the part-of-speech in another s
o that one word's index corresponds with the part of speech.

But what I really want to do is to check which part-of-speech one word has (
 it can have more than one) and then count how many times it has the differe
nt part-of-speech.

So I was thinking about using a hash of hashes where the parent hash has wor
ds as keys and hashes as value. The child hashes should have part-of-speech 
as keys and the number of these as values.

Like this example:

# %wordPos = (
#     cat => {
#         noun      => 30,
#     },
#     race => {
#         noun      => 6,
#         verb      => 2,
#     },
#     jump => {
#         noun      => 3,
#         verb      => 7,
#     },
# );


I don't know if there is a better way to do it. But I still don't know how t
o build this hash of hashes with the input I get.

/Maria

Report this thread to moderator Post Follow-up to this message
Old Post
kimimila
10-04-04 10:46 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:45 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.