SpellCheck 1.1What is SpellCheck? SpellCheck let's 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 it's dictionary. You can add new words to the dictionary or utilize your own custom dictionaries. Full source code is provided. * Fast look-up * Foreign character support * Soundex alternatives provided * Multiple dictionaries * Low overhead * Free dictionary distribution Memory requirements SpellCheck requires approximately 5-6K of memory to run. If you don't intend to add any words to the dictionary, you may safely run with only 2K of memory to hold temporary strings and the single file buffer used. Dictionaries By default, SpellCheck will use a 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 reorganization SCC2.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 Alternatives When 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. Word definition SpellCheck 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. Limitations SpellCheck 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! The Specs SpellCheck has been tested with QuickBASIC 4.5, PDS Basic 7.1, VBDOS 1.0, Visual Basic/Windows and Power Basic. It may also work with other standard Basics. Demo: SpellCheck
| ||