1 / 5

Construction of Index: (Page 197)

Construction of Index: (Page 197). Objective: Given a document, find the number of occurrences of each word in the document. Example: Computer Science students know computers and computer languages. Keywords: computer, computers, science, students, know, and, languages.

Download Presentation

Construction of Index: (Page 197)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Construction of Index: (Page 197) • Objective: Given a document, find the number of occurrences of each word in the document. • Example: Computer Science students know computers and computer languages. • Keywords: computer, computers, science, students, know, and, languages.

  2. Linear time algorithm: • Let T be the text, |T| the length of T. We can find the occurrences of each word in T in O(|T|) time.

  3. Constructing an automaton: c o m p u t e r s s c i e n c e s t u d e n t k n o w a n d s l a n g u a g e

  4. Remarks: • There is a final state for each word. • There is a counter on each final state storing the number of occurrences that the final state is reached. • While reading, the algorithm creates new states for the new word. • For words having met before, we just go through the corresponding states. • When the final state is read, add 1 to the counter.

  5. Assignment one (due in week 6 on Friday, 7:30 pm) • Write a program to convert a text into a vector such that each element of the vector is the number of occurrences of the corresponding keyword.

More Related