Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


On 05/30/2013 12:46 PM, Guenter Bartsch wrote:
we're currently trying to implement a small, db-based terminology
checker plugin. essentially, this plugin will check for certain
phrases in a document and offer replacements for faulty ones.

a first implementation works, however, the spell checker gets in the
way: since we implemented our extension as a grammer checker plugin,
the spell checker will complain about certain (potentially correct)
technical terms not found in its dictionary.

now, we're planning to implement our own spell checker that goes along
with the grammer checker. it's only purpose would be to accept all the
technical words in the database and hand through all other words to
the real spell checker (i.e. hunspell)

is this possible? is there a mechanism to chain several spell checker
plugins? i.e. could explicitly instantiate the hunspell checker and
hand through all function calls to it?

something like:

                 print ("Speller: instatiating hunspell...")

                 smgr = ctx.ServiceManager
                 hunspell = smgr.createInstanceWithContext(
"org.openoffice.lingu.HspellHunspellChecker", ctx)

                 print ("Speller: hunspell instance: %s" % repr(hunspell))

would be nice - however, we'd have to be able to specify an
instantiation name instead of a service name when instantiating the
object.

The following comment in offapi/com/sun/star/linguistic2/XLinguServiceManager.idl might be what you are looking for:

"For spell checking and thesaurus, the order in the list defines the order of creation/usage of those services. That is, if the first spell checker implementation does not recognize the given word as correct, the second service implementation for that language is created and gets queried. If that one fails, the third one gets created and queried and so on. This chain stops if an implementation reports the word as correct or the end of the list is reached, in which case the word is reported as incorrect."

Stephan



Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.