WSpell ActiveX Spelling Checker |
|
Home Site index Contact us Catalog Shopping Cart Products Support Search |
|
You are here: Home > Support > WSpell > Using multi-lingual dictionaries |
|
|
Product: WSpell, any version
Question: How can I set up my application so it uses the Dutch, French, German, etc. dictionaries instead of English?
Answer: Use the dictionaries the same way you use the American, Canadian, or British English dictionaries. Wintertree Software's Dictionary products for each language include three files: sscexx.tlx, sscexx1.clx, and sscexx2.clx (the xx in each name is a 2-letter language code). The sscexx1.clx file (and any other files that may be included) is for other Wintertree spelling products and should not be used with WSpell.
Instructions on using the dictionary with WSpell are given in documentation (readme.htm file) included with the dictionary. In some cases, it is necessary to enable or disable certain WSpell options. For example, If you use the German or Finnish dictionaries, your application should set the SplitWords property to True. If you use the French or Italian dictionaries, your application should set the SplitContractedWords option to True. Again, follow the instructions which accompany the dictionary product to determine the appropriate set of option changes.
Normally, you set WSpell's MainDictionaryFiles property to the list of dictionary files for the language you want to use. For example, to check spelling in Danish, you would set MainDictionaryFiles like this:
MainDictionaryFiles = "ssceda.tlx,ssceda2.clx"
One thing you should not do is set MainDictionaryFiles to the files for more than one language at the same time. Doing so would increase the probability that a misspelled word in one language would match a valid word in another language, and therefore go undetected. Unless you have some very specific requirement (e.g., you want to detect words that are not common to French and Dutch), you should set MainDictionaryFiles to the set of files for one language only.
It's also important to note that WSpell cannot, by itself, detect the language of text submitted to it for checking and automatically use the appropriate dictionary files and property settings. If there is no better way to determine the language of text entered by the user, your application can use WSpell to "guess" the language, and the approach to use in doing so is described below.
Ideally, the users of your application will indicate the language of the text they enter. Depending on the needs of your application and its users, this indication may be more or less permanent (e.g., a selection made during installation of your application, where re-installation is required to change it) or quite variable (e.g., your application provides a way of assigning a language attribute to text, so words in the same sentence could use different language attributes).
If the user's language preference changes infrequently, the best approach is to configure WSpell's MainDictionaryFiles property and other language-sensitive properties once, each time your application starts. An easy way to achieve this is via a table of language properties, indexed by the preferred language. The language properties would include the settings of the following properties:
MainDictionaryFiles
The specific values of these properties for each language are documented in the readme.htm file included with Wintertree Software's dictionary products. Any unaffected properties should be left at their default values, which are documented in the WSpell Programmer's Guide.
If the user changes their language preference, WSpell's properties would be set from values in the table corresponding to the new language selection.
If the user's language preference changes very frequently, a more time-efficient approach would be to declare multiple instances of WSpell, and configure MainDictionaryFiles and other language-sensitive properties of each instance for a specific language. To check spelling in Brazilian Portuguese, for example, you would use the instance of WSpell configured for Brazilian Portuguese. Note that this approach would consume more memory than a single instance of WSpell that was reconfigured when the language preference changed.
In situations where a user is unavailable to specify the language of text to be checked, or where the language of text is unknown and must be determined programmatically, the following approach can be used: Check the spelling of the text (or sample text) using WSpell configured for each available language in turn (without interacting with the user) and count the number of misspelled words detected. The language which results in the smallest number of misspelled words is probably the right one. Of course, the text must contain a good variety of words (not just a list of telephone numbers, or the same word repeated, for example) and a large number of words, for the results to be statistically meaningful.
|
Home Site index Contact us Catalog Shopping Cart Products Support Search |
|
Copyright © 2015 Wintertree Software Inc. |