1 / 10

CS 101 – Nov. 6

CS 101 – Nov. 6. The Joy of Text Software for text Text formatters vs. word processors Spell checking. Text Software. Text editor (Notepad, Wordpad, emacs, vi) (Web) Browser (Netscape, Opera) Text formatter (LaTeX, Groff) Word processor (MS Word).

Download Presentation

CS 101 – Nov. 6

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. CS 101 – Nov. 6 The Joy of Text • Software for text • Text formatters vs. word processors • Spell checking

  2. Text Software • Text editor (Notepad, Wordpad, emacs, vi) • (Web) Browser (Netscape, Opera) • Text formatter (LaTeX, Groff) • Word processor (MS Word)

  3. Different strategies for creating formatted text file: example.html example.tex example.doc LaTeX browser Word example.ps See on screen printer

  4. Text Formatters • Groff was first in 1969 • LaTeX most popular since 1974 • Used extensively in scientific pub’s • Formatting commands embedded in text. • Run “latex” to convert .tex to .ps file • Advantages: free & saves space!

  5. Word Processors • Popular among general public since 1980s. • WYSIWYG • Formatting commands are invisible • Entire document in 1 file • Many features: spell checking, word count, readability, etc. • Not free, generally requires more space.

  6. Example • My vita is a 2-page document • LaTeX • vita.tex has 4,210 bytes • vita.ps has 43,675 bytes (can delete!) • Microsoft Word • vita.doc has 31,232 bytes

  7. Spell Checking • One feature of MS Word is spell checking • Looks up each word in its “dictionary” • Uses binary search to make lookup fast! • Analogy: Try to guess my number 1-100.

  8. Binary Search • If dictionary has 100 words, need 7 guesses to see if word is spelled right. log2 100 ~ 7 • What if 1,000 words? • A real dictionary may have > 25,000 words.

  9. Example • Looking for “goat”. Here are guesses: Joachin, degumming, gale, holly, guideline, gloomy, granite, golly, gnu, … • Notice they go back and forth.

  10. Search summary • By now, we have seen 4 ways to search for data. • If the data is arranged linearly: • Linear search • Binary search (linear data, already sorted) • If the data is arranged non-linearly: • Breadth-first search • Depth-first search

More Related