![]() |
![]() ![]() ![]() ![]() ![]() |
![]() ![]() ![]() ![]() ![]() ![]() |
![]() |
SpellCheck |
![]() ![]() SpellCheck lets you add spell checking to your Basic application. All you do is call the SpellCheck routine with the word in question and SpellCheck will tell you if it is in its dictionary. You can add new words to the dictionary or utilize your own custom dictionaries. Full source code is provided.
DictionariesBy default, SpellCheck will use an American English language dictionary file that contains over 70,000 words. But you can also specify your own dictionary for foreign languages or special terms. You can expand the dictionary without practical limit (the actual limit is a little more than four megabytes, which should be enough to hold about 1,000,000 words).When you add a word to the dictionary, SpellCheck will automatically restructure the dictionary when necessary. To both speed retrieval and reduce storage space the words are stored in a compressed format in 128 byte blocks. Usually, it will take about a dozen insertions into a single block before any reorganization is necessary. Each block ordinarily holds several dozen words, but as more words are added to the dictionary the blocks will become more efficient at storing text. It is possible for a single block to hold about 40 words. Automatic reorganizationSCC2.DIC is somewhat "tighter" than an average dictionary file, and will require somewhat more reorganization at first as new words are added. Assuming random additions of new words, you may see a reorganization after 50-100 words have been added (as few as two, or as many as 2,000). After you have used it a while, you will find that reorganization will be necessary only every several thousand additions. You may go months or years without encountering one. Do expect SCC2.DIC to grow as it reorganizes, however.Misspelling AlternativesWhen a word is not found in the current dictionary you have the option to display a list of possible corrections. These are based on the soundex of the original word. Next, call SpellCheck with the word you would like to check. You can check a word with or without a list of words to ignore.Check single words or whole documentsIn addition to checking the spelling of just one word at a time, you can check a sequence of words like that found in this sentence and/or paragraph. The text can come from a text box, a memo field, or even a line or paragraph from a text file. There are two routines that do this similar to that of checking a single word. They are called SccCheckText, for checking text without an ignore list, and SccCheckTextIg, for checking text with an ignore list.Word definitionSpellCheck defines a word as any series of characters composed only of upper or lower-case letters. Foreign accented characters (ASCII code > 128) are also allowed. No other characters should be present, but hyphens and dashes may be included if you wish. Possessives and contractions (DON'T, WOMAN'S) are not in the default dictionary, but you may add them if you wish. The default dictionary includes only that part of the word up to the apostrophe, so contains words like "wouldn" and "couldn"; this was done to make it easier to parse words from text. A sample program demonstrations both how to parse new words out of ASCII files and how to add them to the dictionary.SpellCheck has no way of telling a "soft" hyphen from a "hard" one. In fact, there is no such ASCII character as a "soft" hyphen. Therefore, you should not pass SpellCheck a word containing a hyphen unless the hyphen is a real part of the word. There are few such words where that may make a difference: co-operate and re-organize are the only ones that come to mind. If you insist on passing SpellCheck hyphenated words, you will get many "not found" results and may greatly expand the dictionary and fill much of it with word fragments. LimitationsSpellCheck expects that you will pass it legal words. Legal words are defined simply: upper or lower-case ASCII characters, not including punctuation of any kind whatever, and excluding blanks, tabs, or any other white-space character. Words may not include spaces, commas, periods, nulls, parentheses, or quotation marks. Leading spaces or nulls in words you attempt to add will cause your dictionary to become corrupt and unusable. SpellCheck can run faster and take less memory from your application because it assumes the data you send it has already been edited. Be sure to do so!Supports: Visual Basic, QuickBasic and PowerBasic Search HALLoGRAM || Request More Information CALL TOLL FREE 1-866-340-3404 |
©Copyright 1998
HALLoGRAM Publishing, Aurora CO. All Rights Reserved. All products mentioned in this site are trademarks of their respective owners. dmcakegrim |