Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 15 in printed book and digital formats -- plus a one-year subscription so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview

Buy Now




Checking With Style

Issue: 7.1 (November/December 2008)
Author: JC Cruz
Article Description: No description available.
Article Length (in bytes): 26,931
Starting Page Number: 28
RBD Number: 7113
Resource File(s):

Download Icon project7113.zip Updated: Saturday, November 1, 2008 at 11:57 AM

Related Web Link(s):


Known Limitations: None

Excerpt of article text...

In the last two REALWord articles, we learned how a spell-checker works. We got to build a basic spell-check engine, and even improved it by using refactoring and by adding new features. Now, we will study its next of kin: the style checker. We will learn some of the basic rules of styles and how to render each rule as a regex pattern. And we will build a basic style-check engine as a finite-state machine.

The Need For Style

A grammar engine is another feature found in many word processors. With this feature, users can check for and correct any grammar errors in their documents. The grammar engine works by first dividing each sentence into its component words. It then looks at how each word is used and how one word relates to the other. If either usage or relation is wrong, the engine flags the offending word(s) and prompts users for correction. Some engines will display the correct usage; others will even correct the error themselves.

Grammar engines, however, are quite complex little beasts. They use special algorithms to break down a sentence into verbs, nouns, pronouns, and so on. Then they examine how each word fits in the sentence based on a large set of rules. Some of the rules differ based on the target language; others differ based on audience. And many of the algorithms use optimized data structures to store their data.

...End of Excerpt. Please purchase the magazine to read the full article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.




Weblog Commenting and Trackback by HaloScan.com