For this programming assignment I want you to write a program that calculates bigram frequencies for a set of text.  Your program should assess the text and calculate the frequency of word pairs that occur throughout the entire file. Your program should ignore case (meaning "the dog" and "The dog" should count as the same phrase). Your program should write out the frequency count for each uniquely occurring bigram to a file with the count and the bigram separated by a tab.   As an example, bigram frequencies for the following sentence are: Sentence: The dog and the cat do not get along because the dog is mean to the cat and the cat is aloof to the dog. Bigrams:   the cat 3 the dog 3 and the 2 to the 2 along because 1 aloof to 1 because the 1 cat and 1 cat do 1 cat is 1 do not 1 dog and 1 dog is 1 get along 1 is aloof 1 is mean 1 mean to 1 not get 1

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
[PYTHON]
For this programming assignment I want you to write a program that calculates bigram frequencies for a set of text. 
  • Your program should assess the text and calculate the frequency of word pairs that occur throughout the entire file.
  • Your program should ignore case (meaning "the dog" and "The dog" should count as the same phrase).
  • Your program should write out the frequency count for each uniquely occurring bigram to a file with the count and the bigram separated by a tab.
 
As an example, bigram frequencies for the following sentence are:
Sentence: The dog and the cat do not get along because the dog is mean to the cat and the cat is aloof to the dog.
Bigrams:
 
the cat 3
the dog 3
and the 2
to the 2
along because 1
aloof to 1
because the 1
cat and 1
cat do 1
cat is 1
do not 1
dog and 1
dog is 1
get along 1
is aloof 1
is mean 1
mean to 1
not get 1
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY