SlideShare a Scribd company logo
1 of 1
Download to read offline
9.8 LAB: Word Count Weite a program that first reads in the raime of an inout file and then reada
the file sing the cov readed0 method The fik contains mit ple lines : each a comma segarated list
of words. The program must outeut the words and theit frequehbies tive number of tenes eoch
wers appeats in the fila) witheut any duplicates and daregarcing case (output the words in lower
case) Why do this? in case you are wondenng wry it woudd be important to calcubete bow many
times a word oceurted a a documxent. this is a ocnoept known as ferm trequency and is a concept
oftien used in information ietreval in fact, one of the ear lent papers related to Big Daia discusaes
how Google did word count but at a much latger scide - they were doing t across alt of the
documents they had crawicd in bulding thes search inder. Example: If theinput is cintoniesy and
the contents of Cintor eav consusted of the folowing 4 knes If, there, is, one, needage, that,
echees, forth, fren, thia, conference let, it, be, tkat, humss, rhahti, are, ,youne's, at rights, and,
wocen'a, righti aro, hueian, rtabtin, ence, and, for, akl, Wet, wes, not, fotget, that, ansed the outhut
is if -1 chere - 1 ts- 1 one-1 tesaage - 1 that -3 achoes - 1 forte -1tran--1thin1obaferuace-11it=21t1
be=2himan4fightn5are=dmonea2and=3iopce=1fer-1a.11-1iu=1inot=1furget:=1afope=1those=1the
3ituht=2to-2apeai=1freely=1hisard1 Notes: - The curient versian of Python stares dictionary
entries in the order in which dects were mserted - The itenat) method retums all of the keyvalue
pair entries from a dectonary and can be comerted to a lat. For esample if a dictionary was named
myydict, a ast (inorder) of af of the entries can be gensrated by caling 1 ist ( my_diec.itena () ).
Each item in the list would be a tuple wth the key and value for an entiy: - Similarly
sst(nyydetkeys0) will generate a liat of the keys (in ordes)- The cument version of Python stores
dictionary entries in the order in which items were ingerted - The items () method relurns all of the
keyvalue pair entriea from a dictionary and can be corverted to a fat. For example, if a dictionary
was named my_dict, a lst (in ordet) of all of the entries can be generated by calling 1i=1 fy diet.
items() ). Each item in the list would be a taple with the key and value for an entry. - Similathy. list
my, idict keys0) will generate a jst of the keys (in order). - Output words in oeder of their first
occurfence in the fili - The file Clintoncsv is available to download

More Related Content

Similar to 98 LAB Word Count Weite a program that first reads in the .pdf

Mastering Python lesson 5a_lists_list_operations
Mastering Python lesson 5a_lists_list_operationsMastering Python lesson 5a_lists_list_operations
Mastering Python lesson 5a_lists_list_operationsRuth Marvin
 
These questions will be a bit advanced level 2
These questions will be a bit advanced level 2These questions will be a bit advanced level 2
These questions will be a bit advanced level 2sadhana312471
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answerskavinilavuG
 
Introduction to Linux Slides.pptx
Introduction to Linux Slides.pptxIntroduction to Linux Slides.pptx
Introduction to Linux Slides.pptxhazhamina
 
Article link httpiveybusinessjournal.compublicationmanaging-.docx
Article link httpiveybusinessjournal.compublicationmanaging-.docxArticle link httpiveybusinessjournal.compublicationmanaging-.docx
Article link httpiveybusinessjournal.compublicationmanaging-.docxfredharris32
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answersRojaPriya
 
Paper id 42201608
Paper id 42201608Paper id 42201608
Paper id 42201608IJRAT
 
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board ExamsC++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Examshishamrizvi
 
An Efficient Search Engine for Searching Desired File
An Efficient Search Engine for Searching Desired FileAn Efficient Search Engine for Searching Desired File
An Efficient Search Engine for Searching Desired FileIDES Editor
 
Python introduction
Python introductionPython introduction
Python introductionleela rani
 
Fp growth algorithm
Fp growth algorithmFp growth algorithm
Fp growth algorithmPradip Kumar
 
Introduction To Python
Introduction To PythonIntroduction To Python
Introduction To PythonVanessa Rene
 
Hello guys please make sure program runs well USING C anyth.pdf
Hello guys please make sure program runs well USING C anyth.pdfHello guys please make sure program runs well USING C anyth.pdf
Hello guys please make sure program runs well USING C anyth.pdfactioncbe1
 

Similar to 98 LAB Word Count Weite a program that first reads in the .pdf (20)

Mastering Python lesson 5a_lists_list_operations
Mastering Python lesson 5a_lists_list_operationsMastering Python lesson 5a_lists_list_operations
Mastering Python lesson 5a_lists_list_operations
 
These questions will be a bit advanced level 2
These questions will be a bit advanced level 2These questions will be a bit advanced level 2
These questions will be a bit advanced level 2
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answers
 
biopython, doctest and makefiles
biopython, doctest and makefilesbiopython, doctest and makefiles
biopython, doctest and makefiles
 
Introduction to Linux Slides.pptx
Introduction to Linux Slides.pptxIntroduction to Linux Slides.pptx
Introduction to Linux Slides.pptx
 
Article link httpiveybusinessjournal.compublicationmanaging-.docx
Article link httpiveybusinessjournal.compublicationmanaging-.docxArticle link httpiveybusinessjournal.compublicationmanaging-.docx
Article link httpiveybusinessjournal.compublicationmanaging-.docx
 
Phython presentation
Phython presentationPhython presentation
Phython presentation
 
A-Study_TopicModeling
A-Study_TopicModelingA-Study_TopicModeling
A-Study_TopicModeling
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answers
 
Paper id 42201608
Paper id 42201608Paper id 42201608
Paper id 42201608
 
Advance python
Advance pythonAdvance python
Advance python
 
Pa1 session 2
Pa1 session 2 Pa1 session 2
Pa1 session 2
 
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board ExamsC++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
 
Python ppt_118.pptx
Python ppt_118.pptxPython ppt_118.pptx
Python ppt_118.pptx
 
An Efficient Search Engine for Searching Desired File
An Efficient Search Engine for Searching Desired FileAn Efficient Search Engine for Searching Desired File
An Efficient Search Engine for Searching Desired File
 
Python introduction
Python introductionPython introduction
Python introduction
 
Fp growth algorithm
Fp growth algorithmFp growth algorithm
Fp growth algorithm
 
Fp growth algorithm
Fp growth algorithmFp growth algorithm
Fp growth algorithm
 
Introduction To Python
Introduction To PythonIntroduction To Python
Introduction To Python
 
Hello guys please make sure program runs well USING C anyth.pdf
Hello guys please make sure program runs well USING C anyth.pdfHello guys please make sure program runs well USING C anyth.pdf
Hello guys please make sure program runs well USING C anyth.pdf
 

More from sastaindin

A 7 year 15000 bond paying a coupon rate of 475 compound.pdf
A 7 year 15000 bond paying a coupon rate of 475 compound.pdfA 7 year 15000 bond paying a coupon rate of 475 compound.pdf
A 7 year 15000 bond paying a coupon rate of 475 compound.pdfsastaindin
 
A 25 yearold graduate student enters the student health ce.pdf
A 25 yearold graduate student enters the student health ce.pdfA 25 yearold graduate student enters the student health ce.pdf
A 25 yearold graduate student enters the student health ce.pdfsastaindin
 
a 2 pts Construct the final Fibonacci heap after the fol.pdf
a 2 pts Construct the final Fibonacci heap after the fol.pdfa 2 pts Construct the final Fibonacci heap after the fol.pdf
a 2 pts Construct the final Fibonacci heap after the fol.pdfsastaindin
 
A 2010 Pew Research poll asked 1306 Americans From what yo.pdf
A 2010 Pew Research poll asked 1306 Americans From what yo.pdfA 2010 Pew Research poll asked 1306 Americans From what yo.pdf
A 2010 Pew Research poll asked 1306 Americans From what yo.pdfsastaindin
 
a 1 The first step is to understand the requirements of th.pdf
a 1 The first step is to understand the requirements of th.pdfa 1 The first step is to understand the requirements of th.pdf
a 1 The first step is to understand the requirements of th.pdfsastaindin
 
A 10 year old develops severe pharyngitis at summer camp He.pdf
A 10 year old develops severe pharyngitis at summer camp He.pdfA 10 year old develops severe pharyngitis at summer camp He.pdf
A 10 year old develops severe pharyngitis at summer camp He.pdfsastaindin
 
A modeling study of the stomatogastric ganglion STG of th.pdf
A  modeling study of the stomatogastric ganglion STG of th.pdfA  modeling study of the stomatogastric ganglion STG of th.pdf
A modeling study of the stomatogastric ganglion STG of th.pdfsastaindin
 
9 Using the key choices complete the crossword puzale by a.pdf
9 Using the key choices complete the crossword puzale by a.pdf9 Using the key choices complete the crossword puzale by a.pdf
9 Using the key choices complete the crossword puzale by a.pdfsastaindin
 
9 Sickle Cell Anemia is a condition that shows codominance.pdf
9 Sickle Cell Anemia is a condition that shows codominance.pdf9 Sickle Cell Anemia is a condition that shows codominance.pdf
9 Sickle Cell Anemia is a condition that shows codominance.pdfsastaindin
 
A Blastula aamas B zigot aamas C Morula aamas D.pdf
A  Blastula aamas   B  zigot aamas   C  Morula aamas   D.pdfA  Blastula aamas   B  zigot aamas   C  Morula aamas   D.pdf
A Blastula aamas B zigot aamas C Morula aamas D.pdfsastaindin
 
97 Using the table for the t distributions make an assess.pdf
97 Using the table for the t distributions make an assess.pdf97 Using the table for the t distributions make an assess.pdf
97 Using the table for the t distributions make an assess.pdfsastaindin
 
925 Match the following generally accepted accounting princ.pdf
925 Match the following generally accepted accounting princ.pdf925 Match the following generally accepted accounting princ.pdf
925 Match the following generally accepted accounting princ.pdfsastaindin
 
8En Alemania los trabajadores Seleccione uno a pued.pdf
8En Alemania los trabajadores    Seleccione uno  a pued.pdf8En Alemania los trabajadores    Seleccione uno  a pued.pdf
8En Alemania los trabajadores Seleccione uno a pued.pdfsastaindin
 
9Tara asiste a una escuela secundaria en un rea urbana Q.pdf
9Tara asiste a una escuela secundaria en un rea urbana Q.pdf9Tara asiste a una escuela secundaria en un rea urbana Q.pdf
9Tara asiste a una escuela secundaria en un rea urbana Q.pdfsastaindin
 
918 LAB Sorting user IDs Given a main that reads user ID.pdf
918 LAB Sorting user IDs Given a main that reads user ID.pdf918 LAB Sorting user IDs Given a main that reads user ID.pdf
918 LAB Sorting user IDs Given a main that reads user ID.pdfsastaindin
 
900 ABDli yetikinden oluan bir rneklemde 206s nllerin .pdf
900 ABDli yetikinden oluan bir rneklemde 206s nllerin .pdf900 ABDli yetikinden oluan bir rneklemde 206s nllerin .pdf
900 ABDli yetikinden oluan bir rneklemde 206s nllerin .pdfsastaindin
 
9 You are studying the molecular behavior of myosin II S1 .pdf
9 You are studying the molecular behavior of myosin II S1 .pdf9 You are studying the molecular behavior of myosin II S1 .pdf
9 You are studying the molecular behavior of myosin II S1 .pdfsastaindin
 
9 What will be the outgut of the C program Aincluderstdich.pdf
9 What will be the outgut of the C program Aincluderstdich.pdf9 What will be the outgut of the C program Aincluderstdich.pdf
9 What will be the outgut of the C program Aincluderstdich.pdfsastaindin
 
9 Which Git command should be used to update a local reposi.pdf
9 Which Git command should be used to update a local reposi.pdf9 Which Git command should be used to update a local reposi.pdf
9 Which Git command should be used to update a local reposi.pdfsastaindin
 
9 Private solutions to correct for externalities Consider t.pdf
9 Private solutions to correct for externalities Consider t.pdf9 Private solutions to correct for externalities Consider t.pdf
9 Private solutions to correct for externalities Consider t.pdfsastaindin
 

More from sastaindin (20)

A 7 year 15000 bond paying a coupon rate of 475 compound.pdf
A 7 year 15000 bond paying a coupon rate of 475 compound.pdfA 7 year 15000 bond paying a coupon rate of 475 compound.pdf
A 7 year 15000 bond paying a coupon rate of 475 compound.pdf
 
A 25 yearold graduate student enters the student health ce.pdf
A 25 yearold graduate student enters the student health ce.pdfA 25 yearold graduate student enters the student health ce.pdf
A 25 yearold graduate student enters the student health ce.pdf
 
a 2 pts Construct the final Fibonacci heap after the fol.pdf
a 2 pts Construct the final Fibonacci heap after the fol.pdfa 2 pts Construct the final Fibonacci heap after the fol.pdf
a 2 pts Construct the final Fibonacci heap after the fol.pdf
 
A 2010 Pew Research poll asked 1306 Americans From what yo.pdf
A 2010 Pew Research poll asked 1306 Americans From what yo.pdfA 2010 Pew Research poll asked 1306 Americans From what yo.pdf
A 2010 Pew Research poll asked 1306 Americans From what yo.pdf
 
a 1 The first step is to understand the requirements of th.pdf
a 1 The first step is to understand the requirements of th.pdfa 1 The first step is to understand the requirements of th.pdf
a 1 The first step is to understand the requirements of th.pdf
 
A 10 year old develops severe pharyngitis at summer camp He.pdf
A 10 year old develops severe pharyngitis at summer camp He.pdfA 10 year old develops severe pharyngitis at summer camp He.pdf
A 10 year old develops severe pharyngitis at summer camp He.pdf
 
A modeling study of the stomatogastric ganglion STG of th.pdf
A  modeling study of the stomatogastric ganglion STG of th.pdfA  modeling study of the stomatogastric ganglion STG of th.pdf
A modeling study of the stomatogastric ganglion STG of th.pdf
 
9 Using the key choices complete the crossword puzale by a.pdf
9 Using the key choices complete the crossword puzale by a.pdf9 Using the key choices complete the crossword puzale by a.pdf
9 Using the key choices complete the crossword puzale by a.pdf
 
9 Sickle Cell Anemia is a condition that shows codominance.pdf
9 Sickle Cell Anemia is a condition that shows codominance.pdf9 Sickle Cell Anemia is a condition that shows codominance.pdf
9 Sickle Cell Anemia is a condition that shows codominance.pdf
 
A Blastula aamas B zigot aamas C Morula aamas D.pdf
A  Blastula aamas   B  zigot aamas   C  Morula aamas   D.pdfA  Blastula aamas   B  zigot aamas   C  Morula aamas   D.pdf
A Blastula aamas B zigot aamas C Morula aamas D.pdf
 
97 Using the table for the t distributions make an assess.pdf
97 Using the table for the t distributions make an assess.pdf97 Using the table for the t distributions make an assess.pdf
97 Using the table for the t distributions make an assess.pdf
 
925 Match the following generally accepted accounting princ.pdf
925 Match the following generally accepted accounting princ.pdf925 Match the following generally accepted accounting princ.pdf
925 Match the following generally accepted accounting princ.pdf
 
8En Alemania los trabajadores Seleccione uno a pued.pdf
8En Alemania los trabajadores    Seleccione uno  a pued.pdf8En Alemania los trabajadores    Seleccione uno  a pued.pdf
8En Alemania los trabajadores Seleccione uno a pued.pdf
 
9Tara asiste a una escuela secundaria en un rea urbana Q.pdf
9Tara asiste a una escuela secundaria en un rea urbana Q.pdf9Tara asiste a una escuela secundaria en un rea urbana Q.pdf
9Tara asiste a una escuela secundaria en un rea urbana Q.pdf
 
918 LAB Sorting user IDs Given a main that reads user ID.pdf
918 LAB Sorting user IDs Given a main that reads user ID.pdf918 LAB Sorting user IDs Given a main that reads user ID.pdf
918 LAB Sorting user IDs Given a main that reads user ID.pdf
 
900 ABDli yetikinden oluan bir rneklemde 206s nllerin .pdf
900 ABDli yetikinden oluan bir rneklemde 206s nllerin .pdf900 ABDli yetikinden oluan bir rneklemde 206s nllerin .pdf
900 ABDli yetikinden oluan bir rneklemde 206s nllerin .pdf
 
9 You are studying the molecular behavior of myosin II S1 .pdf
9 You are studying the molecular behavior of myosin II S1 .pdf9 You are studying the molecular behavior of myosin II S1 .pdf
9 You are studying the molecular behavior of myosin II S1 .pdf
 
9 What will be the outgut of the C program Aincluderstdich.pdf
9 What will be the outgut of the C program Aincluderstdich.pdf9 What will be the outgut of the C program Aincluderstdich.pdf
9 What will be the outgut of the C program Aincluderstdich.pdf
 
9 Which Git command should be used to update a local reposi.pdf
9 Which Git command should be used to update a local reposi.pdf9 Which Git command should be used to update a local reposi.pdf
9 Which Git command should be used to update a local reposi.pdf
 
9 Private solutions to correct for externalities Consider t.pdf
9 Private solutions to correct for externalities Consider t.pdf9 Private solutions to correct for externalities Consider t.pdf
9 Private solutions to correct for externalities Consider t.pdf
 

Recently uploaded

UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024Borja Sotomayor
 
size separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceuticssize separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceuticspragatimahajan3
 
The Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. HenryThe Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. HenryEugene Lysak
 
Software testing for project report .pdf
Software testing for project report .pdfSoftware testing for project report .pdf
Software testing for project report .pdfKamal Acharya
 
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45MysoreMuleSoftMeetup
 
MichaelStarkes_UncutGemsProjectSummary.pdf
MichaelStarkes_UncutGemsProjectSummary.pdfMichaelStarkes_UncutGemsProjectSummary.pdf
MichaelStarkes_UncutGemsProjectSummary.pdfmstarkes24
 
An Overview of the Odoo 17 Discuss App.pptx
An Overview of the Odoo 17 Discuss App.pptxAn Overview of the Odoo 17 Discuss App.pptx
An Overview of the Odoo 17 Discuss App.pptxCeline George
 
The Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptxThe Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptxNehaChandwani11
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnershipsexpandedwebsite
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...Nguyen Thanh Tu Collection
 
Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).Mohamed Rizk Khodair
 
How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17Celine George
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project researchCaitlinCummins3
 
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING II
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING IIII BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING II
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING IIagpharmacy11
 
Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024CapitolTechU
 
philosophy and it's principles based on the life
philosophy and it's principles based on the lifephilosophy and it's principles based on the life
philosophy and it's principles based on the lifeNitinDeodare
 
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17Celine George
 

Recently uploaded (20)

UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
Word Stress rules esl .pptx
Word Stress rules esl               .pptxWord Stress rules esl               .pptx
Word Stress rules esl .pptx
 
size separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceuticssize separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceutics
 
The Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. HenryThe Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. Henry
 
Software testing for project report .pdf
Software testing for project report .pdfSoftware testing for project report .pdf
Software testing for project report .pdf
 
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
 
MichaelStarkes_UncutGemsProjectSummary.pdf
MichaelStarkes_UncutGemsProjectSummary.pdfMichaelStarkes_UncutGemsProjectSummary.pdf
MichaelStarkes_UncutGemsProjectSummary.pdf
 
An Overview of the Odoo 17 Discuss App.pptx
An Overview of the Odoo 17 Discuss App.pptxAn Overview of the Odoo 17 Discuss App.pptx
An Overview of the Odoo 17 Discuss App.pptx
 
The Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptxThe Ball Poem- John Berryman_20240518_001617_0000.pptx
The Ball Poem- John Berryman_20240518_001617_0000.pptx
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
“O BEIJO” EM ARTE .
“O BEIJO” EM ARTE                       .“O BEIJO” EM ARTE                       .
“O BEIJO” EM ARTE .
 
Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).
 
How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17How to Analyse Profit of a Sales Order in Odoo 17
How to Analyse Profit of a Sales Order in Odoo 17
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING II
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING IIII BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING II
II BIOSENSOR PRINCIPLE APPLICATIONS AND WORKING II
 
Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024
 
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
Operations Management - Book1.p  - Dr. Abdulfatah A. SalemOperations Management - Book1.p  - Dr. Abdulfatah A. Salem
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
 
philosophy and it's principles based on the life
philosophy and it's principles based on the lifephilosophy and it's principles based on the life
philosophy and it's principles based on the life
 
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
 

98 LAB Word Count Weite a program that first reads in the .pdf

  • 1. 9.8 LAB: Word Count Weite a program that first reads in the raime of an inout file and then reada the file sing the cov readed0 method The fik contains mit ple lines : each a comma segarated list of words. The program must outeut the words and theit frequehbies tive number of tenes eoch wers appeats in the fila) witheut any duplicates and daregarcing case (output the words in lower case) Why do this? in case you are wondenng wry it woudd be important to calcubete bow many times a word oceurted a a documxent. this is a ocnoept known as ferm trequency and is a concept oftien used in information ietreval in fact, one of the ear lent papers related to Big Daia discusaes how Google did word count but at a much latger scide - they were doing t across alt of the documents they had crawicd in bulding thes search inder. Example: If theinput is cintoniesy and the contents of Cintor eav consusted of the folowing 4 knes If, there, is, one, needage, that, echees, forth, fren, thia, conference let, it, be, tkat, humss, rhahti, are, ,youne's, at rights, and, wocen'a, righti aro, hueian, rtabtin, ence, and, for, akl, Wet, wes, not, fotget, that, ansed the outhut is if -1 chere - 1 ts- 1 one-1 tesaage - 1 that -3 achoes - 1 forte -1tran--1thin1obaferuace-11it=21t1 be=2himan4fightn5are=dmonea2and=3iopce=1fer-1a.11-1iu=1inot=1furget:=1afope=1those=1the 3ituht=2to-2apeai=1freely=1hisard1 Notes: - The curient versian of Python stares dictionary entries in the order in which dects were mserted - The itenat) method retums all of the keyvalue pair entries from a dectonary and can be comerted to a lat. For esample if a dictionary was named myydict, a ast (inorder) of af of the entries can be gensrated by caling 1 ist ( my_diec.itena () ). Each item in the list would be a tuple wth the key and value for an entiy: - Similarly sst(nyydetkeys0) will generate a liat of the keys (in ordes)- The cument version of Python stores dictionary entries in the order in which items were ingerted - The items () method relurns all of the keyvalue pair entriea from a dictionary and can be corverted to a fat. For example, if a dictionary was named my_dict, a lst (in ordet) of all of the entries can be generated by calling 1i=1 fy diet. items() ). Each item in the list would be a taple with the key and value for an entry. - Similathy. list my, idict keys0) will generate a jst of the keys (in order). - Output words in oeder of their first occurfence in the fili - The file Clintoncsv is available to download