Scala Project - Churn Email Inbox with Scala

6 / 7

Scala Project - Churn Emails - Count Number of Messages From Each Email Address

Write a function count_message_from_email which reads the file /cxldata/datasets/project/mbox-short.txt.

This function counts how many messages have come from each email address, stores the count in a Map, and then returns the Map. The email can be found by second word after you split every line that starts with 'From:'

Note: If your logic is correct then your function should return a Map like the following:

Map(zqian@umich.edu -> 4, rjlowe@iupui.edu -> 2, stephen.marquard@uct.ac.za -> 2, louis@media.berkeley.edu -> 3, gopal.ramasammycook@gmail.com -> 1, gsilver@umich.edu -> 3, david.horwitz@uct.ac.za -> 4, ray@media.berkeley.edu -> 1, antranig@caret.cam.ac.uk -> 1, wagnermr@iupui.edu -> 1, cwen@iupui.edu -> 5)
See Answer

No hints are availble for this assesment


Note - Having trouble with the assessment engine? Follow the steps listed here

Loading comments...