TRINITY CSCI 1311 - Text Processing (7 pages)

Previewing pages 1, 2 of 7 page document View the full content.
View Full Document

Text Processing



Previewing pages 1, 2 of actual document.

View the full content.
View Full Document
View Full Document

Text Processing

56 views


Pages:
7
School:
Trinity University
Course:
Csci 1311 -
Documents

Unformatted text preview:

Text Processing 3 30 2009 Opening Discussion Minute Essay comments Mad libs program I know of more optimization problems For spreadsheets I need ideas Data encryption Games conflict with current projects Have you ever had things you wanted to do with text that your tools weren t good for and it took a long time The Problems I would like us to look at two different problems this week I have a bad habit of falling into a rut in my word usage I want to count word frequency to see how often different words occur Annotating large amounts of text for things like web pages The goal is to take advantage of something computers are really good at processing large amounts of information Counting Words Today I want us to do the word counting problem Obviously we need to read in the file We can read it word by word Each time we see a word we increment a count for it To keep our counts we will use a new data structure called a map Maps Arrays and lists let us associate data with integer locations Maps are more flexible You get can associate any type of data with any type of key We will use the java util HashMap for this We want to have Integer counts associated with String keys Let s look at the API page Writing the Code Let s write the code that will count the words After we have counted them we need to print out each word and how many times it occurred Minute Essay Can you think of any other uses for a map Do you have any questions about what we did today Remember that the project is due on Wednesday



View Full Document

Access the best Study Guides, Lecture Notes and Practice Exams

Loading Unlocking...
Login

Join to view Text Processing and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Text Processing and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?