Aperitium spa-cat heavily uses the preferences system to choose features between variants (and even different standards or language styles within the same dialect) by doing exactly what Kevin and Tino propose.
The dictionary is tagged with the features, and then different modes apply different cg files (see https://github.com/apertium/apertium-cat/blob/master/apertium-cat.cat_valencia.prefs.rlx and other similar files) that apply those preferences by default. -- Xavi Ivars < http://xavi.ivars.me > El dc., 19 de juny 2024, 15:44, Kevin Brubeck Unhammer <unham...@fsfe.org> va escriure: > > How can I define src_lengadocian as the variable that means the source > > language is lengadocian ? > > Hm, it kind of depends. In general, if you use variables, you can do > > export AP_SETVAR=src_lengadocian > echo mau o mal | apertium -d . oci-fra > > and that variable will be available to the CG as VAR:src_lengadocian > > If you put it in oci-fra.preferences.xml, it will also show up on the > web like the Preferences d'estil button at > https://beta.apertium.org/index.cat.html#?dir=cat-spa > > But maybe these source language differences actually *should* be kept as > separate pipelines, and shown as different source languages in the > language selector in the web UI? In that case, it might actually be > simpler to not do variables at all, and just have a separate CG file > with lengadocian rules that runs before the regular CG. So in your > oci-fra_lengadocian mode in > https://github.com/apertium/apertium-oci-fra/blob/master/modes.xml#L373 > instead of > > <program name="lt-proc -w"> > <file name="o...@lengadocian-fra.automorf.bin"/> > </program> > <program name="cg-proc -w" debug-suff="disamb"> > <file name="oci-fra.rlx.bin"/> > </program> > > you would have the general automorf, but two CG disambiguator steps > > <program name="lt-proc -w"> > <file name="oci-fra.automorf.bin"/> > </program> > <program name="cg-proc" debug-suff="disamb-lengadocian"> > <file name="o...@lengadocian-fra.rlx.bin"/> > </program> > <program name="cg-proc -w" debug-suff="disamb"> > <file name="oci-fra.rlx.bin"/> > </program> > > and the first CG would just have a few rules for lengadocian-specific > 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