Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 101 – Nov. 6 The Joy of Text Software for text –Text formatters vs. word processors Spell checking.

Similar presentations


Presentation on theme: "CS 101 – Nov. 6 The Joy of Text Software for text –Text formatters vs. word processors Spell checking."— 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 example.html browser See on screen example.tex LaTeX example.ps printer example.doc Word Different strategies for creating formatted text file:

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. log 2 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


Download ppt "CS 101 – Nov. 6 The Joy of Text Software for text –Text formatters vs. word processors Spell checking."

Similar presentations


Ads by Google