Skip to main content

apertium2ud

Obtaining the mapping between the two tagsets based on the information from Apertium Wiki.

Loosely based on this code, hence the GPLv3 license.

To install, run

python -m pip install apertium2ud

The latest uploaded version is 0.0.8.

NB! The latest version from PyPI (yes, you can install the tool via pip) is equipped with the apertium-kir .udx file rules.

To build the machine-readable mapping, run

python apertium_wiki_parser.py

Apertium to Universal tags

>>> from apertium2ud.convert import a2ud
>>> tags = ["n", "pl", "acc"]
>>> a2ud(tags)
(['NOUN'], ['Number=Plur', 'Case=Acc'])
>>> tags_sophisticated = ["v", "tv", "ger", "nom", "cop", "aor", "p3", "pl"]
>>> a2ud(tags_sophisticated)
(['VERB', 'AUX'], ['Subcat=Tran', 'VerbForm=Vnoun', 'Case=Nom', 'Tense=Past', 'Person=3', 'Number=Plur'])

Universal tags to Apertium

So far the conversion is far from perfect

Кыз NOUN {'Number[psor]=Sing', 'Number=Sing', 'Case=Nom', 'Person[psor]=3', 'Person=3'} ->
<px3sg><n><subj?nom?><sg><p3><px3sp> 

досуна NOUN {'Number[psor]=Sing', 'Number=Sing', 'Person[psor]=3', 'Case=Dat', 'Person=3'} ->
<px3sg><n><sg><dat><p3><px3sp> 

кат NOUN {'Case=Nom', 'Person=3', 'Number=Sing'} ->
<n><subj?nom?><sg><p3> 

жазган VERB {'Aspect=Perf', 'Polarity=Pos', 'Number=Sing', 'Tense=Past', 'Person=3', 'Evident=Fh'} ->
<past3p><vblex?v?vbmod?><sg><aff><aor?past?pret?><perf><p3> 

. PUNCT set() ->
<sent?apos?percent?clb?punct?> 

TODO

  • Should sections chunks and XML tags be added? No.
  • Tests: Apertium -> UD -> Apertium, UD -> Apertium -> UD (sometimes losses are inevitable)
  • Add the possibility to add the rules based on a .udx file, which usually describes custom tags

How to cite

Greatly appreciated, if you use this work.

@misc{apertium2ud2023alekseev,
  title     = {{alexeyev/apertium2ud: mapping tagsets}},
  year      = {2023},
  url       = {https://github.com/alexeyev/apertium2ud}
}

Metadata

Release files for apertium2ud 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for apertium2ud 0.0.8
File Size Uploaded
apertium2ud-0.0.8.tar.gz 24.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for apertium2ud 0.0.8
File Interpreter ABI Platform
apertium2ud-0.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 47.9 kB

Release files / apertium2ud-0.0.8.tar.gz

Download URL apertium2ud-0.0.8.tar.gz
Size 24.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6738d13d6fadaadb64703798ce5db21928902c7ec1ccaa5bb3ff51b58b4324dd
BLAKE2b-256 checksum
How to use checksums
41091e7aab6f22f0a03ba73e73b5039650d2ecbad3d27047e3cd7318264b719c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.10

Release files / apertium2ud-0.0.8-py3-none-any.whl

Download URL apertium2ud-0.0.8-py3-none-any.whl
Size 23.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f8ceb7ce0ab40c657a0277fc57c4ce9f680056761aeb9f59606d670cb3b2577
BLAKE2b-256 checksum
How to use checksums
0859a35ea22a187e24cbd88e10c25b8377cc4e5ea3f8a82b552590eb7a9a403e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.10

Release history Release notifications | RSS feed

This release

0.0.8 This release

2 release files

0.0.7

2 release files

0.0.6

1 release file

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page