Hi Zanga, The best introduction to writing twol rules that I'm aware of is at https://wikis.swarthmore.edu/ling073/Morphological_generator
The #apertium and #hfst IRC channels are also good places. Daniel On Fri, Sep 11, 2020 at 8:19 AM Zanga Chimombo <z.chimo...@gmail.com> wrote: > Hello again, > > I've had a bit of time to continue looking at this. I've copied over > something from: > https://github.com/apertium/apertium-lin/blob/master/apertium-lin.lin.twol > > %{K%}:k <=> :n :0 _ .#. ; > > But it's not working yet and I am not sure how to debug it. Is there > an intro to twol online? > > Rgds, Zanga. > > On Fri, Aug 28, 2020 at 3:56 PM Hèctor Alòs i Font <hectora...@gmail.com> > wrote: > > > > I don't think you have to do anything with the modes or the compilation > file. The problem is in the post-yao.dix file. > > If you add <a/>, it works: > > > > <e> > > <p> > > <l><a/>nk</l> > > <r>ng</r> > > </p> > > <par n="vocals"/> > > </e> > > > > $ echo "~nka" | lt-proc -p yao.autopgen.bin > > nga > > $ echo "~nkb" | lt-proc -p yao.autopgen.bin > > nkb > > > > I don't know why without <a/> there is no match, but in any case you > need to add <a/> to the relevant places (words, affixes, etc.) you want to > trigger this rule. If you want that always nk + vowel should be ng, you > should this in twol, not here. > > > > Hèctor > > > > Missatge de Zanga Chimombo <z.chimo...@gmail.com> del dia dv., 28 d’ag. > 2020 a les 15:41: > >> > >> I am still not getting anywhere and both modes.xml and the Makefile > >> seem ok. My code is here: > >> https://gitlab.com/zangaphee/CiBantu/-/tree/master/twoc/apertium-yao > >> > >> On Fri, Aug 28, 2020 at 7:36 AM Hèctor Alòs i Font < > hectora...@gmail.com> wrote: > >> > > >> > The relevant files are modes.xml and Makefile.am I recommend taking a > look to them in e.g. apertium-fra and apertium-fra-cat (or any other > released pair using post-generation). In the first one you define the > pipeline, so copy and adapt the call to autopgen in the end. In the second > one you have the actual compilation of the programme. > >> > > >> > Missatge de Zanga Chimombo <z.chimo...@gmail.com> del dia dv., 28 > d’ag. 2020 a les 7:52: > >> >> > >> >> Hi again, I actually have: > >> >> > >> >> <e> > >> >> <p> > >> >> <l>nk</l> > >> >> <r>ng</r> > >> >> </p> > >> >> <par n="vocals"/> > >> >> </e> > >> >> > >> >> But it doesn't seem to get executed. Is there a missing flag/ switch > >> >> that I was supposed to initialise/ build with? I am not seeing > >> >> anything relating to building autopgen in the modes.xml file in the > >> >> monolingual directory...? > >> >> > >> >> On Thu, Aug 27, 2020 at 2:57 PM Hèctor Alòs i Font < > hectora...@gmail.com> wrote: > >> >> > > >> >> > Yes, it is in the monodix. It is just a mark put on the right > side, e.g. > >> >> > > >> >> > <e r="LR" lm="que"> <i>que</i><par n="que__prn"/></e> > >> >> > <e r="RL" lm="que"> <p><l><a/>que</l> <r>que<s n="prn"/><s > n="itg"/><s n="mf"/><s n="sg"/></r></p></e> > >> >> > > >> >> > If you want, you may not put it, but if you have in the post-dix > file something like: > >> >> > > >> >> > <e> > >> >> > <p> > >> >> > <l>nk</l> > >> >> > <r>ng</r> > >> >> > </p> > >> >> > </e> > >> >> > > >> >> > ... then every nk will be substituted by ng. That is not what you > want, for sure. So better to put a mark in the dictionnary to know which > "nk" may be changed (in some contexts) to nk. > >> >> > > >> >> > Missatge de Zanga Chimombo <z.chimo...@gmail.com> del dia dj., 27 > d’ag. 2020 a les 15:18: > >> >> >> > >> >> >> Looking at the examples in apertium-fra.post-fra.dix it is clear > that > >> >> >> the tilde/ ~/ <a/> is inserted as some sort of marker earlier in > the > >> >> >> pipeline so that the PG recognises it and actions on it. > >> >> >> > >> >> >> Where in the pipeline is it inserted? Could you give me a line > number > >> >> >> of the insertion within the monodix perhaps? > >> >> >> > >> >> >> On Thu, Aug 27, 2020 at 12:12 PM Hèctor Alòs i Font > >> >> >> <hectora...@gmail.com> wrote: > >> >> >> > > >> >> >> > You can take a look, for instance to > https://github.com/apertium/apertium-fra/blob/master/apertium-fra.post-fra.dix > >> >> >> > > >> >> >> > For example (at line 633) : > >> >> >> > <e><p><l><a/>ne<b/></l><r>n'</r></p><par n="voyelles"/></e> > >> >> >> > > >> >> >> > Missatge de Hèctor Alòs i Font <hectora...@gmail.com> del dia > dj., 27 d’ag. 2020 a les 13:07: > >> >> >> >> > >> >> >> >> There two things in: > >> >> >> >> > >> >> >> >> <e> > >> >> >> >> <p> > >> >> >> >> <l><a/>nk<b/></l> > >> >> >> >> <r>ng<b/></r> > >> >> >> >> </p> > >> >> >> >> </e> > >> >> >> >> > >> >> >> >> First is the <a/> that must precede (that's the ~ Kevin said > because it is shown as a tilde in the output). If you don't have it, there > won't be any matching. > >> >> >> >> > >> >> >> >> Second, is the <b/>, i.e. a space. So nk- will not match, but > only nk followed by a blank (a preceded by an <a/>). If matched, it will be > replaced by ng followed by a blank to. > >> >> >> >> > >> >> >> >> Hèctor > >> >> >> >> > >> >> >> >> > >> >> >> >> Missatge de Zanga Chimombo <z.chimo...@gmail.com> del dia > dj., 27 d’ag. 2020 a les 12:31: > >> >> >> >>> > >> >> >> >>> Not sure I know what you mean by "~"...? Sorry. I'm new to > this > >> >> >> >>> > >> >> >> >>> The input is "nkutenda". Expected output: "ngutenda". > >> >> >> >>> > >> >> >> >>> On Thu, Aug 27, 2020 at 11:26 AM Kevin Brubeck Unhammer > >> >> >> >>> <unham...@fsfe.org> wrote: > >> >> >> >>> > > >> >> >> >>> > Zanga Chimombo <z.chimo...@gmail.com> > >> >> >> >>> > čálii: > >> >> >> >>> > > >> >> >> >>> > > One of the processes that occurs in one of the languages > I am dealing > >> >> >> >>> > > with is "nk-" becoming "ng-" > >> >> >> >>> > > > >> >> >> >>> > > I thought I would be able to fix this using the post > generator here: > >> >> >> >>> > > > https://gitlab.com/zangaphee/CiBantu/-/blob/master/twoc/apertium-yao/apertium-yao.post-yao.dix > >> >> >> >>> > > > >> >> >> >>> > > However, that doesn't fix it. Have I done it incorrectly? > Should I > >> >> >> >>> > > even be using PG to do this? > >> >> >> >>> > > >> >> >> >>> > If there's a ~ before every nk, then I think that should > >> >> >> >>> > work. What's the exact input to pgen? > >> >> >> >>> > > >> >> >> >>> > (There's an open issue on not requiring the > >> >> >> >>> > `~` https://github.com/apertium/lttoolbox/issues/42 ) > >> >> >> >>> > _______________________________________________ > >> >> >> >>> > Apertium-stuff mailing list > >> >> >> >>> > Apertium-stuff@lists.sourceforge.net > >> >> >> >>> > https://lists.sourceforge.net/lists/listinfo/apertium-stuff > >> >> >> >>> > >> >> >> >>> > >> >> >> >>> _______________________________________________ > >> >> >> >>> Apertium-stuff mailing list > >> >> >> >>> Apertium-stuff@lists.sourceforge.net > >> >> >> >>> https://lists.sourceforge.net/lists/listinfo/apertium-stuff > >> >> >> > > >> >> >> > _______________________________________________ > >> >> >> > Apertium-stuff mailing list > >> >> >> > Apertium-stuff@lists.sourceforge.net > >> >> >> > https://lists.sourceforge.net/lists/listinfo/apertium-stuff > >> >> >> > >> >> >> > >> >> >> _______________________________________________ > >> >> >> Apertium-stuff mailing list > >> >> >> Apertium-stuff@lists.sourceforge.net > >> >> >> https://lists.sourceforge.net/lists/listinfo/apertium-stuff > >> >> > > >> >> > _______________________________________________ > >> >> > Apertium-stuff mailing list > >> >> > Apertium-stuff@lists.sourceforge.net > >> >> > https://lists.sourceforge.net/lists/listinfo/apertium-stuff > >> >> > >> >> > >> >> _______________________________________________ > >> >> Apertium-stuff mailing list > >> >> Apertium-stuff@lists.sourceforge.net > >> >> https://lists.sourceforge.net/lists/listinfo/apertium-stuff > >> > > >> > _______________________________________________ > >> > Apertium-stuff mailing list > >> > Apertium-stuff@lists.sourceforge.net > >> > https://lists.sourceforge.net/lists/listinfo/apertium-stuff > >> > >> > >> _______________________________________________ > >> Apertium-stuff mailing list > >> Apertium-stuff@lists.sourceforge.net > >> https://lists.sourceforge.net/lists/listinfo/apertium-stuff > > > > _______________________________________________ > > Apertium-stuff mailing list > > Apertium-stuff@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/apertium-stuff > > > _______________________________________________ > Apertium-stuff mailing list > Apertium-stuff@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/apertium-stuff >
_______________________________________________ Apertium-stuff mailing list Apertium-stuff@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/apertium-stuff