Re: [SoC] Grammar checker API

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [SoC] Grammar checker API

Bruno Sant'Anna-2
Thomas / Mathias

I'm looking forward the source code of TextRange and Text  Services, wich
implements the XTextRange and XText interfaces, I want to take a look in
their source codes (c++), but I cannot find them in anywere, I have searched
in LXR tool (http://go-ooo.org) and In the new build (OOB680). I want to
take a look because i just want to know how a service can deal with objects
of a runnin writer.

Thanks

Bruno Sant'Anna
Reply | Threaded
Open this post in threaded view
|

Re: [SoC] Grammar checker API

thomas.lange

Hi Bruno,
> Thomas / Mathias
>
> I'm looking forward the source code of TextRange and Text  Services,
> wich implements the XTextRange and XText interfaces, I want to take a
> look in their source codes (c++), but I cannot find them in anywere, I
> have searched in LXR tool ( http://go-ooo.org) and In the new build
> (OOB680). I want to take a look because i just want to know how a
> service can deal with objects of a runnin writer.
The implementation for XTextRange in a Writer document can be found in
  sw/source/core/unocore/unoobj2.cxx
Just grep for "SwXTextRange:"
As for the implementation of XText it is more often implemented for each
specific object (e.g. tables, cells, bookmarks, ...)
The base class SwXText can be found in
  sw/source/core/unocore/unotext.cxx

BTW: all UNO implementations for the Writer are either in
sw/source/core/unocore  or  sw/source/ui/uno

But I wonder what you need looking for.
Basically there should be no need for you to look in the implementation
of those objects.

Note: For the Writer objects implementing services (which almost all do)
you can get the implemntation name by
calling sth. like
  myObj.getImplementationName()
(part of the XServiceInfo interface) and grep the source code for that
name to find the implementation(s) for that
service.

Regards,
Thomas





---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [SoC] Grammar checker API

Bruno Sant'Anna-2
Hi Thomas =),


I will take a look into the source of the component that you sent to me, for
sure it will help since in my implementation I only created a shell
executable, not uno pkg... Thanks a lot.

BTW,  can you pass me some reference about language binding? I looked into
dev guide but I've not found any code about component language binding...
I'd like to bind my component to JAVA too, It could be useful.

Cheers

Bruno Sant'Anna
Reply | Threaded
Open this post in threaded view
|

Re: [SoC] Grammar checker API

thomas.lange

Hi Bruno Sant'Anna,

> I will take a look into the source of the component that you sent to
> me, for sure it will help since in my implementation I only created a
> shell executable, not uno pkg... Thanks a lot.
What will be missing is how to install sth UI related. As I understood
this will be a different task.
If you have the actual problem at hand you can drop it to me and I will
ask how it can be solved.
Yesterdays attachment was my first use of UNO packages as well...

>
> BTW,  can you pass me some reference about language binding? I looked
> into dev guide but I've not found any code about component language
> binding... I'd like to bind my component to JAVA too, It could be useful.
What for?
If it is just about being able to use your component from JAVA there is
no need for it.
It does not matter in which language an existing component was written.
You can use it from any UNO code written in language XY as long as there
exists an UNO bridge
for that language XY (and maybe the specific compiler).
Thus if you write it in C or C++ it can be used e.g. from Python, Java
and Basic as well.

The advantage of writing the component in C/C++ is that (because OOo is
written in C++)
there is no need for an UNO bridge on that side.
That is if you call from a Java component into a Python component two
UNO bridges and the office
will be involved. Whereas if you have a Java component calling into a
C++ component (or vice versa)
there will only one UNO bridge and the office be involved.

Since I'm not familiar with the implementation of UNO and the UNO
bridges I must admit though
that I don not know if in the case of Java component 1 calling Java
component 2 any UNO bridge
is involved or not.

Thomas


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [SoC] Grammar checker API

Bruno Sant'Anna-2
On 7/7/06, Thomas Lange <[hidden email]> wrote:
>
> > BTW,  can you pass me some reference about language binding? I looked
> > into dev guide but I've not found any code about component language
> > binding... I'd like to bind my component to JAVA too, It could be
> useful.
> What for?


for just being able to use my component form java.

If it is just about being able to use your component from JAVA there is
> no need for it.
> It does not matter in which language an existing component was written.
> You can use it from any UNO code written in language XY as long as there
> exists an UNO bridge
> for that language XY (and maybe the specific compiler).
> Thus if you write it in C or C++ it can be used e.g. from Python, Java
> and Basic as well.


Nice to know this, i'll try it now if i face too much trouble i ping you =)

The advantage of writing the component in C/C++ is that (because OOo is

> written in C++)
> there is no need for an UNO bridge on that side.
> That is if you call from a Java component into a Python component two
> UNO bridges and the office
> will be involved. Whereas if you have a Java component calling into a
> C++ component (or vice versa)
> there will only one UNO bridge and the office be involved.
>
> Since I'm not familiar with the implementation of UNO and the UNO
> bridges I must admit though
> that I don not know if in the case of Java component 1 calling Java
> component 2 any UNO bridge
> is involved or not.


Its not necessary, I wrote it in C++.

Thomas
>
>
>
Thanks for now
Reply | Threaded
Open this post in threaded view
|

Re: [SoC] Grammar checker API

Bruno Sant'Anna-2
Hi Thomas,

I'm posting on blog tonight or tomorrow morning some code that I wrote, Its
basically a component like yours, a SOffice Basic script, a shell executable
of course and a Java executable too... regarding this, let me know if
anything is wrong with it ok?

Now I'll start thinking about XGrammarChecker.idl methods based on your
previous e-mails...

We think we are understanding components creation process. ^^

A question:
We guess we will need modify some pieces of OOo source; for example, we will
need to mark in each paragraph object where are mistakes, so it seems this
object will need more attributes (proprieties); what do you think?
In Chapter 3 (Professional UNO) of Developer Guide, we read that it is
possible add properties to services. Can we use this concept to add
properties to paragraphs, which save correction state of these objects? If
not, what should be the best way?
Reply | Threaded
Open this post in threaded view
|

Re: [SoC] Grammar checker API

thomas.lange
In reply to this post by Bruno Sant'Anna-2

Hi Bruno,

> I'm posting on blog tonight or tomorrow morning some code that I wrote, Its
> basically a component like yours, a SOffice Basic script, a shell executable
> of course and a Java executable too... regarding this, let me know if
> anything is wrong with it ok?

I'll do, probably tomorrow, since I have another issue at hand today.

> A question:
> We guess we will need modify some pieces of OOo source; for example, we will
> need to mark in each paragraph object where are mistakes, so it seems this
> object will need more attributes (proprieties); what do you think?
> In Chapter 3 (Professional UNO) of Developer Guide, we read that it is
> possible add properties to services. Can we use this concept to add
> properties to paragraphs, which save correction state of these objects? If
> not, what should be the best way?

This can't be used for the required purpose.
Even though there is a ParagraphProperties service one can not add
properties at run-time. Also there is only one such service and you
would need a way to store data for all paragraphs (with incorrect text)
in all documents and must be able to identify them correctly.
The amount of data to be stored would be rather large.

And above all I think that is something the document should take
care of.
I have to ask Mathias if we have time to think about a suitable
solution and implement it as well in the time frame of SoC already.

For the time being I would suggest to just use existing character
attributes e.g. CharUnderlining and life with it's disadvantages.
You could choose for example a green value that differs in one
or two bits (e.g. transparency values) from any common value a
user is likely to choose and thus be able to identify the text
portions with that value if you need to identify where it is used.

I dare say though that if everything will be fine with the Dummy
implementation / integration of the grammar checker it won't take
us too long to add the missing functionality. ^_~

Thomas







---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [SoC] Grammar checker API

Bruno Sant'Anna-2
Hi All

I would like asking you to take a look in project blog:

http://soc-grammar.blogspot.com

It is starting to work, the sources are there too so you can understand the
logic that I am using to check.

I'm waiting some comments =)

Regards

Bruno Sant'Anna
Reply | Threaded
Open this post in threaded view
|

Re: [SoC] Grammar checker API

Laurent Godard-3
HI Bruno,

> I would like asking you to take a look in project blog:
>
> http://soc-grammar.blogspot.com
>
> It is starting to work, the sources are there too so you can understand the
> logic that I am using to check.
>
> I'm waiting some comments =)
>

thanks a lot
i'll have a look and probably re-start a work on french grammar uin autumn
I'll surely play with your developments :-)

btw, do you have any rss feeds on your blog , i didn't find one

thanks again

Laurent


--
Laurent Godard <[hidden email]> - Ingénierie OpenOffice.org
Indesko >> http://www.indesko.com
Nuxeo CPS >> http://www.nuxeo.com - http://www.cps-project.org
Livre "Programmation OpenOffice.org", Eyrolles 2004

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [SoC] Grammar checker API

Bruno Sant'Anna-2
Hi Laurent,

On 8/14/06, Laurent Godard <[hidden email]> wrote:

>
> HI Bruno,
>
> > I would like asking you to take a look in project blog:
> >
> > http://soc-grammar.blogspot.com
> >
> > It is starting to work, the sources are there too so you can understand
> the
> > logic that I am using to check.
> >
> > I'm waiting some comments =)
> >
>
> thanks a lot
> i'll have a look and probably re-start a work on french grammar uin autumn
> I'll surely play with your developments :-)


Great =) ,
As I told Thomas and Carlos Menezes, now we just need to improve this (API)
even more =)

btw, do you have any rss feeds on your blog , i didn't find one


Yes, addess:
http://soc-grammar.blogspot.com/atom.xml


Kind regards

Bruno Sant'Anna


thanks again

>
> Laurent
>
>
> --
> Laurent Godard <[hidden email]> - Ingénierie OpenOffice.org
> Indesko >> http://www.indesko.com
> Nuxeo CPS >> http://www.nuxeo.com - http://www.cps-project.org
> Livre "Programmation OpenOffice.org", Eyrolles 2004
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [SoC] Grammar checker API

Laurent Godard-3
Hi

> Great =) ,
> As I told Thomas and Carlos Menezes, now we just need to improve this (API)
> even more =)
>

:)

> btw, do you have any rss feeds on your blog , i didn't find one
>
>
> Yes, addess:
> http://soc-grammar.blogspot.com/atom.xml
>

thanks

(just a detail
for the underlining waves, could it be double wawed (and blue) so that
it is clearly separated from spellchecking
but this is a minor minor minor detail:) )

good luck and keep up the good job

Laurent

--
Laurent Godard <[hidden email]> - Ingénierie OpenOffice.org
Indesko >> http://www.indesko.com
Nuxeo CPS >> http://www.nuxeo.com - http://www.cps-project.org
Livre "Programmation OpenOffice.org", Eyrolles 2004

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [SoC] Grammar checker API

Bruno Sant'Anna-2
In reply to this post by Bruno Sant'Anna-2
Hi Daniel,

Thanks =)

Maybe the error occurred because I compiled this package in my linux
machine, It should be safer if you try to compile it using SDK, I know that
Thomas Lange got it compiled, let me check with him first. =)

Cogroo is not required to run the examples, it is just one example.
the other examples compare strings and force an error (hard coded).

This API is a new service for uno, like XSpellChecker, so you can integrate
it using your grammar checker in the same way that you have been using until
now. The name of the service is XGrammarChecker.

I'm starting to write the documentation for this project, so you can have a
better Idea how it works.


Regards

Bruno Sant'Anna

On 8/14/06, Daniel Naber <[hidden email]> wrote:

>
> On Montag 14 August 2006 13:41, Bruno Sant'Anna wrote:
>
> > I would like asking you to take a look in project blog:
> >
> > http://soc-grammar.blogspot.com
>
> Hi Bruno,
>
> this looks very promising! I tried to install it but I get this error:
>
> /opt/openoffice.org2.0/program/unopkg add grammarchecker.uno.pkg
>
> ERROR: Error binding package: vnd.sun.star.expand:
> $UNO_USER_PACKAGES_CACHE/uno_packages/YfKZnk_/grammarchecker.uno.pkg
>        Cause: an error occured during file opening
>
> I do not have the grammar checker (CoGrOO) installed, could that be the
> problem? I know I cannot really check anything without it yet, but I
> thought that the installation might work anyway. I don't have the SDK yet
> either.
>
> Could you tell me how I can integrate my own checker (LanguageTool,
> written
> in Java) into your tool?
>
> Regards
> Daniel
>
> --
> http://www.danielnaber.de
>
Reply | Threaded
Open this post in threaded view
|

Re: [SoC] Grammar checker API

thomas.lange
In reply to this post by Bruno Sant'Anna-2

Hi Bruno and Daniel,

> Maybe the error occurred because I compiled this package in my linux
> machine, It should be safer if you try to compile it using SDK, I know that
> Thomas Lange got it compiled, let me check with him first. =)

I compiled the version you send me yesterday with the SDK and Linux
(as said elsewhere the Makefile still gives me trouble with Windows).
But I wonder what syntax you expect for running the sample?

Since there is a document sampletext_pt.odt and checking the content
of check_main.cxx I thought

make check_main.run sampletext_pt.odt
make check_main.run_interactive sampletext_pt.odt

should work but I only resulted in an exception that says
'URL seems to be an unsupported one'.
What am I missing?
(Before starting debugging I at least want to try to get the answer
without doing so ^_~)

BTW I also have not installed CoGrOO under Linux.
Still I would expect the above two calls to work...


Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [SoC] Grammar checker API

Bruno Sant'Anna-2
Thomas,

Sorry but it was missing in the TGZ file the sample_text.odt

I'm sending one to you.

There are three examples:

make check_main.run

make check_main.run_interactive

make check_main.run_cogroo



Daniel,

I'll today fix the windows compilation problem... after that you can safety
compile and run the examples =).


Bruno Sant'Anna


On 8/16/06, Thomas Lange <[hidden email]> wrote:

>
>
> Hi Bruno and Daniel,
>
> > Maybe the error occurred because I compiled this package in my linux
> > machine, It should be safer if you try to compile it using SDK, I know
> that
> > Thomas Lange got it compiled, let me check with him first. =)
>
> I compiled the version you send me yesterday with the SDK and Linux
> (as said elsewhere the Makefile still gives me trouble with Windows).
> But I wonder what syntax you expect for running the sample?
>
> Since there is a document sampletext_pt.odt and checking the content
> of check_main.cxx I thought
>
> make check_main.run sampletext_pt.odt
> make check_main.run_interactive sampletext_pt.odt
>
> should work but I only resulted in an exception that says
> 'URL seems to be an unsupported one'.
> What am I missing?
> (Before starting debugging I at least want to try to get the answer
> without doing so ^_~)
>
> BTW I also have not installed CoGrOO under Linux.
> Still I would expect the above two calls to work...
>
>
> Thomas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>