Skip to main content

CJVT conversion utilities

This repository is intended for common conversions needed by CJVT developers. It can of course also be used more broadly, but most of the scripts (with the exception of jos_msds_and_properties.py) were written with specific tasks in mind, and may not generalise as expected. Use at your own risk.

JOS msds and properties

You can use the Msd and Properties to encode, and convert between the two types in either direction (specifying both the input and output language (English or Slovene)) or just translate between English and Slovene. Example usage:

>>> from conversion_utils.jos_msds_and_properties import Converter, Msd, Properties
>>> converter = Converter()
>>> msd = Msd('Sozem', 'sl')
>>> msd.code
'Sozem'
>>> msd.language
'sl'
>>> properties = converter.msd_to_properties(msd, 'en')
>>> properties.category
'noun'
>>> properties.lexeme_feature_map
{'type': 'common', 'gender': 'feminine'}
>>> properties.form_feature_map
{'number': 'singular', 'case': 'locative'}
>>> properties.language
'en'
>>> msd2 = converter.properties_to_msd(properties, 'sl')
>>> msd2 == msd
True
>>> print(converter.translate_msd(msd, 'en'))
code=Ncfsl, language=en
>>> print(converter.translate_properties(properties, 'sl'))
language=sl, category=samostalnik, lexeme features={'vrsta': 'občno_ime', 'spol': 'ženski'}, form_features={'število': 'ednina', 'sklon': 'mestnik'}

Release files for cjvt-conversion-utils 0.3

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

Source distribution (sdist)

Source distribution for cjvt-conversion-utils 0.3
File Size Uploaded
cjvt_conversion_utils-0.3.tar.gz 33.4 kB Details

Release files / cjvt_conversion_utils-0.3.tar.gz

Download URL cjvt_conversion_utils-0.3.tar.gz
Size 33.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2e73c3f49d2ca56186a0e0163f66ffd6fa511ce5e20efc76f75826bafa99ca63
BLAKE2b-256 checksum
How to use checksums
b4983a673dcfeb1f88ec3721899b3dc27ab58c0be25fee229f89c2f901461cd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.3 This release

1 release file

0.2

1 release file

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