Hi Laurent,
But for input, there is no way zo have sth like "text editor" passed on
to the spellcheckler as a single word.
this is my problem
The only solution currently available would be to process the text of
the document all by yourself using the respective API and maybe the
XBreakiterator as well.
Unfortunately each application is likely to have different API to
access the text. Though all of them probably have the XText interface
implemented it is not really the one to use.
One would probably like to access a paragraph or sentence.
The Writer has an XSentenceCursor, XParagrpaphCursor and a
ParagraphEnumeration for this. But I'm not sure about the other
applications.
would it be hard to define an API for underlining without altering the
text formating ? say pass a text range as argument. The best would be to
play with colors and waves
where is this done into sources ?
Using the character properties to have colored waves is possible.
But setting them will modify the document which is most likely unwanted,
and you will have the problem of undoing the change when everything is
corrected. And considering that each character can have different
attributes and may already have the ones you living up to this task
seems to be troubelsome.
And the redlines for spellchecking are not even attributes.
As mentiones before the Writer keeps a list of all words still flagged
as incorrect. And when the drawing layer paints a word it looks for it
in the wrong-list and if it is found there it draws those red waves
directly as well. Thus there is no distinction between different
occurences of the same word.
And removing the red waves is basically removing the word from the
wrong-list and redrawing that text part.
As you can see this kind of mechanism can not really be used for
grammar checking where a single word will be Ok or not depending
on it's context.
I think this will be needed for future development such as grammar
checker or alternative checkers
We are aware of this.
And grammar checking is already one of out weak spots for a long time.
-_-
btw, HunSpell is written in java, right ?
I'm not sure if there is a Java version on SourceForge as well but
the HunSpell code in OOo is in C/C++.
You may as well write a spellchecker by using the UNO API of the
thesaurus itself. If so please access the thesaurus via the service
com.sun.star.linguistic2.LinguisticServiceManager
because this is the instance that knows about all available
implemementations and dispatches the calls to the respective ones.
I planned to use com.sun.star.linguistic2.Thesaurus but i'll have a look
at this service
The problem with using com.sun.star.linguistic2.Thesaurus is that
there may be several implementations of this service and some of them
may support the same language as well.
Though in OOo this currentlly is not the case for SO it is already
possible since the OOo spellchecker can be used with SO as well.
Oh! Im wrong even now already here in Germany is a famous dictionary
provider that distributes OOo (and it's spellchecker) along with their
own implementation of a spellchecker and proofreader for German.
Using com.sun.star.linguistic2.LinguisticServiceManager will take
care of all the related problems and makes sure to use only what is
defined in "Tools / Options - Language Settings - Writing Aids" when you
press the top-most "Edit" button.
There it will be possible to specify which spellchecker will be used
for what language and if it is to be used at all.
The LinguisticServiceManager takes all those settings into account.
Instantiating com.sun.star.linguistic2.Thesaurus directly via a
multi service factory will give you only one of the registered
services. AFAIR it will be the one last registered.
Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]