Skip to main content

Syntrans

This toolkit is based on the idea of Default Interlingual Synsets

You can write a hierarchy or graph in a YAML file, using precise concept meaning references from various namespaces of semantic web, notably, WikiData, automatically them converted into their representations in a language of choice.

The aim is to continue with introducing default meanings for tokens in languages, so as to convert not to arbitrary first expressions, but to the default expressions for concepts in each language. Since, those default expressions are likely to coincide with the multi-meaning traditional expressions, we want to come up with a way to emphasize default meanings in such texts, perhaps prepending words with a symbol like in the examples/test.yml, though, language references would also be required.

Usage

Install it with pip install synsets, then you can translate YAML documents with keys like in the examples directory, for example, using WikiData concept IDs with namespace WD: or other namespaces supported by Metawiki package.

syntrans -h
usage: syntrans [-h] [-c CONCEPT] [-s SOURCE] [-l LANGUAGE] [-r REFRESH]

optional arguments:
  -h, --help            show this help message and exit
  -s SOURCE, --source SOURCE
                        Source text file to parse.
  -l LANGUAGE, --language LANGUAGE
                        Language reference, e.g., en, lt, ja, ru, cn.
  -r CONCEPT, --concept CONCEPT
                        Single concept to refresh cache from source.

For example, let’s translate the sample text.

Example source:

$ cat examples/sample.yml
WD:Q4503831:
  - WD:Q1156970 WD:Q7949 WD:Q8 WD:Q245962
  - WD:Q1378301 WD:Q3 WD:Q15290 WD:Q185957 WD:Q468777 WD:Q245962

Example to English:

$ syntrans -s examples/sample.yml -l en

goal:
- humanity • truth • happiness • implementation
  - universal set • life • good • quality • existence • implementation

Example to Japanese:

syntrans -s examples/sample.yml -l ja

目標:
- 人類 • 真理 • 幸福 • 実装
  - 普遍集合 • 生命 • 善 • 品質 • 存在 • 実装

Refresh concept from web:

syntrans -r WD:Q1156970

Delete .concept folder to refresh all cached concepts.

Metadata

Release files for syntrans 0.5.0

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

Source distribution (sdist)

Source distribution for syntrans 0.5.0
File Size Uploaded Provenance Actions
syntrans-0.5.0.tar.gz 4.4 kB Without provenance Details for syntrans-0.5.0.tar.gz

Release files / syntrans-0.5.0.tar.gz

Download URL syntrans-0.5.0.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4bef1ab017e5ec0718ca0a4f09a8d6aaa479d686a462c2b42f8f61f30be7c6ba
BLAKE2b-256 checksum
How to use checksums
5cdff839082119c1402c20eb6770035638cbfa5834943e9856473d65cfbaca1e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.7

Security for syntrans 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.5.0 This release

1 release file No provenance

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