Package: apertium-init
Apertium-Init (a.k.a. Apertium Bootstrap)Bootstrap Apertium language modules and pairs usingapertium-init.py.InstallationThere are 3 ways to obtain Apertium-Init:Download the script fromhttps://apertium.org/apertium-initto your local directoryClone this repository and runmake installInstall fromPyPiwithpip install apertium-initIf the script was downloaded directly, it can be run withpython3 apertium-init.py. Otherwise it will be installed asapertium-init.UsageUsage depends on the desired module and is described below. Remember to
search forTODOin the generated module to add example sentences, etc.Monolingual Lttoolbox moduleTo bootstrap a monolingual language moduleapertium-foousing thelttoolboxformalism,$python3apertium-init.pyfooTo bootstrap and compile it at the same time,$python3apertium-init.pyfoo&&(cdapertium-foo/&&make)Monlingual HFST moduleTo bootstrap a monolingual language moduleapertium-foousing theHFSTformalism,$python3apertium-init.pyfoo--analyser=hfstTo bootstrap and compile it at the same time,$python3apertium-init.pyfoo--analyser=hfst&&(cdapertium-foo/&&make)To include a twoc file for handling prefixes,$python3apertium-init.pyfoo--analyser=hfst--with-twocTo include a spellrelax file for handling typographical variance,$python3apertium-init.pyfoo--analyser=hfst--with-spellrelaxBilingual Lttoolbox moduleTo bootstrap a bilingual language moduleapertium-foo-barwhere the
monolingual packagesapertium-fooandapertium-barboth use thelttoolboxformalism,$python3apertium-init.pyfoo-barTo bootstrap and compile it at the same time,$python3apertium-init.pyfoo-bar&&(cdapertium-foo-bar/&&./autogen.sh&&maketest)Bilingual HFST/Lttoolbox moduleTo bootstrap a bilingual language moduleapertium-foo-barwhere the
monolingual packagesapertium-fooandapertium-baruse theHFSTformalism and/or thelttoolboxformalism,$python3apertium-init.pyfoo-bar--analysers=hfst# Both foo and bar use HFST$python3apertium-init.pyfoo-bar--analyser1=hfst# Only foo (first language) uses HFST$python3apertium-init.pyfoo-bar--analyser2=hfst# Only bar (second language) uses HFSTTo bootstrap and compile it at the same time,$python3apertium-init.pyfoo-bar--analysers=hfst&&(cdapertium-foo-bar/&&./autogen.sh&&maketest)# Both foo and bar use HFST$python3apertium-init.pyfoo-bar--analyser1=hfst&&(cdapertium-foo-bar/&&./autogen.sh&&maketest)# Only foo (first language) uses HFST$python3apertium-init.pyfoo-bar--analyser2=hfst&&(cdapertium-foo-bar/&&./autogen.sh&&maketest)# Only bar (second language) uses HFSTBilingual module for monolinguals that don't use apertium-tagger or CGTo bootstrap a bilingual module when one or both of the monolingual modules
don't use apertium-tagger,$python3apertium-init.pyfoo-bar--no-prob1# Only foo doesn't have .prob$python3apertium-init.pyfoo-bar--no-prob2# Only bar doesn't have .prop$python3apertium-init.pyfoo-bar--no-prob1--no-prob2# Neither foo nor bar have .probTo bootstrap a bilingual module when one or both of the monolingual modules
don't useCG,$python3apertium-init.pyfoo-bar--no-rlx1# Only foo doesn't have .rlx$python3apertium-init.pyfoo-bar--no-rlx2# Only bar doesn't have .rlx$python3apertium-init.pyfoo-bar--no-rlx1--no-rlx2# Neither foo nor bar have .rlxBilingual module using recursive transferTo bootstrap a bilingual module which uses apertium-recursive,$python3apertium-init.pyfoo-bar--transfer=rtxBilingual module with anaphora resolutionTo bootstrap a bilingual module which uses apertium-anaphora,$python3apertium-init.pyfoo-bar--with-anaphoraBilingual module with discontiguous multiwordsTo bootstrap a bilingual module which uses apertium-separable,$python3apertium-init.pyfoo-bar--with-separableAdding features to an existing moduleApertium-init can reconfigure an existing module or pair. For example, to add
apertium-separable to an existing pair:$python3apertium-init.pyfoo-bar-r--with-separableNote that all desired options must be specified. If the foo-bar pair used
apertium-anaphora, the above command would remove it.Pushing to GithubTo bootstrap a module or pair and also add it to theapertium
incubator,$python3apertium-init.pyfoo-p# Bootstrap module apertium-foo and push to Github$python3apertium-init.pyfoo-bar-p# Bootstrap pair apertium-foo-bar and push to GithubTo specify what username to push as (rather than relying ongit config),$python3apertium-init.pyfoo-p-ubar# Bootstrap module apertium-foo and push to Github under username barDevelopmentAfter updating vanilla files, runmakein the root of the repository to
generateapertium-init.py.You can also dosudo make installto install to/usr/local/bin/apertium-initor e.g.PREFIX=$HOME/local make installto install to$HOME/local/bin/apertium-init.Usepipenv install --devto install the requirements required for development,
e.g. linters.ReleasingAfter installing development resources following the instructions above,
deploying to PyPi is relatively straightforward.Usemake distto create a source distributable inside thedistdirectory
that can be installed locally viapip.Usemake test-releaseandmake releaseto deploy to thetesting PyPi
instanceand theproduction PyPi
instancerespectively. Either step requires PyPi
authentication credentials with access to the apertium-init package.