Own gazetteer and transducer in 8.5


Paweł Banaś
 

Hi everyone

 

I cannot find in the user guide etc. any hint on how to move, or make from scratch, in the 8.5 style GATE a plugin with my own gazetteer and jape. In 8.4 and before, apart from the creole.xml, I needed only the main class of the plugin with two others, very simple ones:

 

import gate.creole.gazetteer.DefaultGazetteer;

public class myGazetteer extends DefaultGazetteer { }

 

and:

 

import gate.creole.Transducer;

public class myTransducer extends Transducer { }


Now when the creole.gazetteer package and the creole.Transducer are not available directly, it does not work any more.

I guess, the DefaultGazetteer or Transducer should be called in a @CreoleParameter of the classes,similarly as ResourceReference listsURL and rulesURL, but in which?
 

- - -

I’ve had also a problem with the GATE Maven artifact in Windows – sent by me out of this list (sorry – the newbie’s fault) and solved by Mark A. Greenwood – thanks once again Mark. If anybody is interested, I can send it to the list.

- - -

 

Regards

Paweł


Mark Greenwood
 

If you just want to load a gazetter and jape grammar you don't need them to be in a plugin at all, just specify the URLs to the lists.def and main.jape files when creating the PRs in the GUI (i.e. change the URLs from the default ones to yours).

If you do want a specific subclass so you can set the default URL to your own, then you can do this. You'll need to subclass the class as you mention and add @CreoleResource annotations so you can give your new PRs a sensible name (otherwise you won't be able to tell them apart from the originals). You'll then need to subclass the relevant set method and add a @CreoleParameter with a defaultValue pointing at you resource files. This is exactly the same as it was in 8.4. The only difference in 8.5 is that as you spotted the classes are no longer in gate-core they are now in the ANNIE plugin. This means you need to add ANNIE as a provided dependency (that is very important don't add it as a compile dependency) inside the pom.xml and reference the version you want to use at runtime in creole.xml. Have a look at the Romanian plugin (https://github.com/GateNLP/gateplugin-Lang_Romanian) for examples of all these bits (subclasses, pom.xml, and creole.xml) as it subclasses both the generic JAPE and Gazetteer PRs to provide Romanian specific versions

Mark


On 10/08/18 10:03, Paweł Banaś wrote:

Hi everyone

 

I cannot find in the user guide etc. any hint on how to move, or make from scratch, in the 8.5 style GATE a plugin with my own gazetteer and jape. In 8.4 and before, apart from the creole.xml, I needed only the main class of the plugin with two others, very simple ones:

 

import gate.creole.gazetteer.DefaultGazetteer;

public class myGazetteer extends DefaultGazetteer { }

 

and:

 

import gate.creole.Transducer;

public class myTransducer extends Transducer { }


Now when the creole.gazetteer package and the creole.Transducer are not available directly, it does not work any more.

I guess, the DefaultGazetteer or Transducer should be called in a @CreoleParameter of the classes,similarly as ResourceReference listsURL and rulesURL, but in which?
 

- - -

I’ve had also a problem with the GATE Maven artifact in Windows – sent by me out of this list (sorry – the newbie’s fault) and solved by Mark A. Greenwood – thanks once again Mark. If anybody is interested, I can send it to the list.

- - -

 

Regards

Paweł



Paweł Banaś
 

I need mainly GATE Embeded. So, the most straighforward way looks like:

- start Annie in Developer,
- add copies of Annie Gazetteer and Transducer, changing their pahts at the initialisation
- save the application to xgapp and use it in the Embedded

It is realy simple and work at first try. I will learn from the Romanian case and use your advice when developing my code.Thanks a lot Mark

Maybe this more systemic role of ANNIE from 8.5 on could be emphasised in the the user guide even stronger than now? I stopped for a while when found that these basic packages are not available in gate.creole - it looked like lost retro-compatibility at first. With your explanation it is much clearer.

Best wishes
Paweł



2018-08-10 11:13 GMT+02:00 Mark Greenwood <m.a.greenwood@...>:

If you just want to load a gazetter and jape grammar you don't need them to be in a plugin at all, just specify the URLs to the lists.def and main.jape files when creating the PRs in the GUI (i.e. change the URLs from the default ones to yours).

If you do want a specific subclass so you can set the default URL to your own, then you can do this. You'll need to subclass the class as you mention and add @CreoleResource annotations so you can give your new PRs a sensible name (otherwise you won't be able to tell them apart from the originals). You'll then need to subclass the relevant set method and add a @CreoleParameter with a defaultValue pointing at you resource files. This is exactly the same as it was in 8.4. The only difference in 8.5 is that as you spotted the classes are no longer in gate-core they are now in the ANNIE plugin. This means you need to add ANNIE as a provided dependency (that is very important don't add it as a compile dependency) inside the pom.xml and reference the version you want to use at runtime in creole.xml. Have a look at the Romanian plugin (https://github.com/GateNLP/gateplugin-Lang_Romanian) for examples of all these bits (subclasses, pom.xml, and creole.xml) as it subclasses both the generic JAPE and Gazetteer PRs to provide Romanian specific versions

Mark


On 10/08/18 10:03, Paweł Banaś wrote:

Hi everyone

 

I cannot find in the user guide etc. any hint on how to move, or make from scratch, in the 8.5 style GATE a plugin with my own gazetteer and jape. In 8.4 and before, apart from the creole.xml, I needed only the main class of the plugin with two others, very simple ones:

 

import gate.creole.gazetteer.DefaultGazetteer;

public class myGazetteer extends DefaultGazetteer { }

 

and:

 

import gate.creole.Transducer;

public class myTransducer extends Transducer { }


Now when the creole.gazetteer package and the creole.Transducer are not available directly, it does not work any more.

I guess, the DefaultGazetteer or Transducer should be called in a @CreoleParameter of the classes,similarly as ResourceReference listsURL and rulesURL, but in which?
 

- - -

I’ve had also a problem with the GATE Maven artifact in Windows – sent by me out of this list (sorry – the newbie’s fault) and solved by Mark A. Greenwood – thanks once again Mark. If anybody is interested, I can send it to the list.

- - -

 

Regards

Paweł




Diana Maynard
 

Hi Pawel
I would highly recommend working through the first couple of modules of the GATE training course, available on the website, as these demonstrate exactly this kind of thing.
Diana

On 10 Aug 2018, at 11:05, Paweł Banaś <pb@...> wrote:

I need mainly GATE Embeded. So, the most straighforward way looks like:

- start Annie in Developer,
- add copies of Annie Gazetteer and Transducer, changing their pahts at the initialisation
- save the application to xgapp and use it in the Embedded

It is realy simple and work at first try. I will learn from the Romanian case and use your advice when developing my code.Thanks a lot Mark

Maybe this more systemic role of ANNIE from 8.5 on could be emphasised in the the user guide even stronger than now? I stopped for a while when found that these basic packages are not available in gate.creole - it looked like lost retro-compatibility at first. With your explanation it is much clearer.

Best wishes
Paweł



2018-08-10 11:13 GMT+02:00 Mark Greenwood <m.a.greenwood@...>:
If you just want to load a gazetter and jape grammar you don't need them to be in a plugin at all, just specify the URLs to the lists.def and main.jape files when creating the PRs in the GUI (i.e. change the URLs from the default ones to yours).

If you do want a specific subclass so you can set the default URL to your own, then you can do this. You'll need to subclass the class as you mention and add @CreoleResource annotations so you can give your new PRs a sensible name (otherwise you won't be able to tell them apart from the originals). You'll then need to subclass the relevant set method and add a @CreoleParameter with a defaultValue pointing at you resource files. This is exactly the same as it was in 8.4. The only difference in 8.5 is that as you spotted the classes are no longer in gate-core they are now in the ANNIE plugin. This means you need to add ANNIE as a provided dependency (that is very important don't add it as a compile dependency) inside the pom.xml and reference the version you want to use at runtime in creole.xml. Have a look at the Romanian plugin (https://github.com/GateNLP/gateplugin-Lang_Romanian) for examples of all these bits (subclasses, pom.xml, and creole.xml) as it subclasses both the generic JAPE and Gazetteer PRs to provide Romanian specific versions

Mark

On 10/08/18 10:03, Paweł Banaś wrote:
Hi everyone


I cannot find in the user guide etc. any hint on how to move, or make from scratch, in the 8.5 style GATE a plugin with my own gazetteer and jape. In 8.4 and before, apart from the creole.xml, I needed only the main class of the plugin with two others, very simple ones:


import gate.creole.gazetteer.DefaultGazetteer;

public class myGazetteer extends DefaultGazetteer { }


and:


import gate.creole.Transducer;

public class myTransducer extends Transducer { }



Now when the creole.gazetteer package and the creole.Transducer are not available directly, it does not work any more.

I guess, the DefaultGazetteer or Transducer should be called in a @CreoleParameter of the classes,similarly as ResourceReference listsURL and rulesURL, but in which?

- - -

I’ve had also a problem with the GATE Maven artifact in Windows – sent by me out of this list (sorry – the newbie’s fault) and solved by Mark A. Greenwood – thanks once again Mark. If anybody is interested, I can send it to the list.

- - -


Regards

Paweł




Paweł Banaś
 

Hi Diana

I admire the training course materials, they helped me a lot until now, and I will come back to them often, that's sure. Last weeks they were still in the 2017 version (about 8.4.1), but now I see the 2018 materials are already available. Great news.

Paweł

2018-08-10 12:10 GMT+02:00 Diana Maynard <d.maynard@...>:

Hi Pawel
I would highly recommend working through the first couple of modules of the GATE training course, available on the website, as these demonstrate exactly this kind of thing.
Diana


> On 10 Aug 2018, at 11:05, Paweł Banaś <pb@...> wrote:
>
> I need mainly GATE Embeded. So, the most straighforward way looks like:
>
> - start Annie in Developer,
> - add copies of Annie Gazetteer and Transducer, changing their pahts at the initialisation
> - save the application to xgapp and use it in the Embedded
>
> It is realy simple and work at first try. I will learn from the Romanian case and use your advice when developing my code.Thanks a lot Mark
>
> Maybe this more systemic role of ANNIE from 8.5 on could be emphasised in the the user guide even stronger than now? I stopped for a while when found that these basic packages are not available in gate.creole - it looked like lost retro-compatibility at first. With your explanation it is much clearer.
>
> Best wishes
> Paweł
>
>
>
> 2018-08-10 11:13 GMT+02:00 Mark Greenwood <m.a.greenwood@...>:
> If you just want to load a gazetter and jape grammar you don't need them to be in a plugin at all, just specify the URLs to the lists.def and main.jape files when creating the PRs in the GUI (i.e. change the URLs from the default ones to yours).
>
> If you do want a specific subclass so you can set the default URL to your own, then you can do this. You'll need to subclass the class as you mention and add @CreoleResource annotations so you can give your new PRs a sensible name (otherwise you won't be able to tell them apart from the originals). You'll then need to subclass the relevant set method and add a @CreoleParameter with a defaultValue pointing at you resource files. This is exactly the same as it was in 8.4. The only difference in 8.5 is that as you spotted the classes are no longer in gate-core they are now in the ANNIE plugin. This means you need to add ANNIE as a provided dependency (that is very important don't add it as a compile dependency) inside the pom.xml and reference the version you want to use at runtime in creole.xml. Have a look at the Romanian plugin (https://github.com/GateNLP/gateplugin-Lang_Romanian) for examples of all these bits (subclasses, pom.xml, and creole.xml) as it subclasses both the generic JAPE and Gazetteer PRs to provide Romanian specific versions
>
> Mark
>
> On 10/08/18 10:03, Paweł Banaś wrote:
>> Hi everyone
>>
>>
>> I cannot find in the user guide etc. any hint on how to move, or make from scratch, in the 8.5 style GATE a plugin with my own gazetteer and jape. In 8.4 and before, apart from the creole.xml, I needed only the main class of the plugin with two others, very simple ones:
>>
>>
>> import gate.creole.gazetteer.DefaultGazetteer;
>>
>> public class myGazetteer extends DefaultGazetteer { }
>>
>>
>> and:
>>
>>
>> import gate.creole.Transducer;
>>
>> public class myTransducer extends Transducer { }
>>
>>
>>
>> Now when the creole.gazetteer package and the creole.Transducer are not available directly, it does not work any more.
>>
>> I guess, the DefaultGazetteer or Transducer should be called in a @CreoleParameter of the classes,similarly as ResourceReference listsURL and rulesURL, but in which?
>>
>> - - -
>>
>> I’ve had also a problem with the GATE Maven artifact in Windows – sent by me out of this list (sorry – the newbie’s fault) and solved by Mark A. Greenwood – thanks once again Mark. If anybody is interested, I can send it to the list.
>>
>> - - -
>>
>>
>> Regards
>>
>> Paweł
>>
>
>
>
>
>






Diana Maynard
 

Yes, I just updated it (the 2018 materials were there but just not directly linked!)
Your post reminded me to update the link :-)
Most of the introductory materials are the same anyway, but there are some changes (e.g. to the plugin management)
Diana

On 10 Aug 2018, at 11:29, Paweł Banaś <pb@...> wrote:

Hi Diana

I admire the training course materials, they helped me a lot until now, and I will come back to them often, that's sure. Last weeks they were still in the 2017 version (about 8.4.1), but now I see the 2018 materials are already available. Great news.

Paweł

2018-08-10 12:10 GMT+02:00 Diana Maynard <d.maynard@...>:
Hi Pawel
I would highly recommend working through the first couple of modules of the GATE training course, available on the website, as these demonstrate exactly this kind of thing.
Diana


On 10 Aug 2018, at 11:05, Paweł Banaś <pb@...> wrote:

I need mainly GATE Embeded. So, the most straighforward way looks like:

- start Annie in Developer,
- add copies of Annie Gazetteer and Transducer, changing their pahts at the initialisation
- save the application to xgapp and use it in the Embedded

It is realy simple and work at first try. I will learn from the Romanian case and use your advice when developing my code.Thanks a lot Mark

Maybe this more systemic role of ANNIE from 8.5 on could be emphasised in the the user guide even stronger than now? I stopped for a while when found that these basic packages are not available in gate.creole - it looked like lost retro-compatibility at first. With your explanation it is much clearer.

Best wishes
Paweł



2018-08-10 11:13 GMT+02:00 Mark Greenwood <m.a.greenwood@...>:
If you just want to load a gazetter and jape grammar you don't need them to be in a plugin at all, just specify the URLs to the lists.def and main.jape files when creating the PRs in the GUI (i.e. change the URLs from the default ones to yours).

If you do want a specific subclass so you can set the default URL to your own, then you can do this. You'll need to subclass the class as you mention and add @CreoleResource annotations so you can give your new PRs a sensible name (otherwise you won't be able to tell them apart from the originals). You'll then need to subclass the relevant set method and add a @CreoleParameter with a defaultValue pointing at you resource files. This is exactly the same as it was in 8.4. The only difference in 8.5 is that as you spotted the classes are no longer in gate-core they are now in the ANNIE plugin. This means you need to add ANNIE as a provided dependency (that is very important don't add it as a compile dependency) inside the pom.xml and reference the version you want to use at runtime in creole.xml. Have a look at the Romanian plugin (https://github.com/GateNLP/gateplugin-Lang_Romanian) for examples of all these bits (subclasses, pom.xml, and creole.xml) as it subclasses both the generic JAPE and Gazetteer PRs to provide Romanian specific versions

Mark

On 10/08/18 10:03, Paweł Banaś wrote:
Hi everyone


I cannot find in the user guide etc. any hint on how to move, or make from scratch, in the 8.5 style GATE a plugin with my own gazetteer and jape. In 8.4 and before, apart from the creole.xml, I needed only the main class of the plugin with two others, very simple ones:


import gate.creole.gazetteer.DefaultGazetteer;

public class myGazetteer extends DefaultGazetteer { }


and:


import gate.creole.Transducer;

public class myTransducer extends Transducer { }



Now when the creole.gazetteer package and the creole.Transducer are not available directly, it does not work any more.

I guess, the DefaultGazetteer or Transducer should be called in a @CreoleParameter of the classes,similarly as ResourceReference listsURL and rulesURL, but in which?

- - -

I’ve had also a problem with the GATE Maven artifact in Windows – sent by me out of this list (sorry – the newbie’s fault) and solved by Mark A. Greenwood – thanks once again Mark. If anybody is interested, I can send it to the list.

- - -


Regards

Paweł








Paweł Banaś
 

At your service ;-)
Paweł

2018-08-10 12:33 GMT+02:00 Diana Maynard <d.maynard@...>:

Yes, I just updated it (the 2018 materials were there but just not directly linked!)
Your post reminded me to update the link :-)
Most of the introductory materials are the same anyway, but there are some changes (e.g. to the plugin management)
Diana


> On 10 Aug 2018, at 11:29, Paweł Banaś <pb@...> wrote:
>
> Hi Diana
>
> I admire the training course materials, they helped me a lot until now, and I will come back to them often, that's sure. Last weeks they were still in the 2017 version (about 8.4.1), but now I see the 2018 materials are already available. Great news.
>
> Paweł
>
> 2018-08-10 12:10 GMT+02:00 Diana Maynard <d.maynard@...>:
> Hi Pawel
> I would highly recommend working through the first couple of modules of the GATE training course, available on the website, as these demonstrate exactly this kind of thing.
> Diana
>
>
> > On 10 Aug 2018, at 11:05, Paweł Banaś <pb@...> wrote:
> >
> > I need mainly GATE Embeded. So, the most straighforward way looks like:
> >
> > - start Annie in Developer,
> > - add copies of Annie Gazetteer and Transducer, changing their pahts at the initialisation
> > - save the application to xgapp and use it in the Embedded
> >
> > It is realy simple and work at first try. I will learn from the Romanian case and use your advice when developing my code.Thanks a lot Mark
> >
> > Maybe this more systemic role of ANNIE from 8.5 on could be emphasised in the the user guide even stronger than now? I stopped for a while when found that these basic packages are not available in gate.creole - it looked like lost retro-compatibility at first. With your explanation it is much clearer.
> >
> > Best wishes
> > Paweł
> >
> >
> >
> > 2018-08-10 11:13 GMT+02:00 Mark Greenwood <m.a.greenwood@...>:
> > If you just want to load a gazetter and jape grammar you don't need them to be in a plugin at all, just specify the URLs to the lists.def and main.jape files when creating the PRs in the GUI (i.e. change the URLs from the default ones to yours).
> >
> > If you do want a specific subclass so you can set the default URL to your own, then you can do this. You'll need to subclass the class as you mention and add @CreoleResource annotations so you can give your new PRs a sensible name (otherwise you won't be able to tell them apart from the originals). You'll then need to subclass the relevant set method and add a @CreoleParameter with a defaultValue pointing at you resource files. This is exactly the same as it was in 8.4. The only difference in 8.5 is that as you spotted the classes are no longer in gate-core they are now in the ANNIE plugin. This means you need to add ANNIE as a provided dependency (that is very important don't add it as a compile dependency) inside the pom.xml and reference the version you want to use at runtime in creole.xml. Have a look at the Romanian plugin (https://github.com/GateNLP/gateplugin-Lang_Romanian) for examples of all these bits (subclasses, pom.xml, and creole.xml) as it subclasses both the generic JAPE and Gazetteer PRs to provide Romanian specific versions
> >
> > Mark
> >
> > On 10/08/18 10:03, Paweł Banaś wrote:
> >> Hi everyone
> >>
> >>
> >> I cannot find in the user guide etc. any hint on how to move, or make from scratch, in the 8.5 style GATE a plugin with my own gazetteer and jape. In 8.4 and before, apart from the creole.xml, I needed only the main class of the plugin with two others, very simple ones:
> >>
> >>
> >> import gate.creole.gazetteer.DefaultGazetteer;
> >>
> >> public class myGazetteer extends DefaultGazetteer { }
> >>
> >>
> >> and:
> >>
> >>
> >> import gate.creole.Transducer;
> >>
> >> public class myTransducer extends Transducer { }
> >>
> >>
> >>
> >> Now when the creole.gazetteer package and the creole.Transducer are not available directly, it does not work any more.
> >>
> >> I guess, the DefaultGazetteer or Transducer should be called in a @CreoleParameter of the classes,similarly as ResourceReference listsURL and rulesURL, but in which?
> >>
> >> - - -
> >>
> >> I’ve had also a problem with the GATE Maven artifact in Windows – sent by me out of this list (sorry – the newbie’s fault) and solved by Mark A. Greenwood – thanks once again Mark. If anybody is interested, I can send it to the list.
> >>
> >> - - -
> >>
> >>
> >> Regards
> >>
> >> Paweł
> >>
> >
> >
> >
> >
> >
>
>
>
>
>
>