this is a windows installer for apertium
Project description
Apertium + Python
Introduction
- The code-base is in development for the Gsoc '18 project called Apertium API in Python
- The Apertium core modules are written in C++.
- This project is an attempt to make the Apertium modules available in python, which because of it's simplicity is more appealing to users.
About the Exisiting Code Base
- The exisiting code base has the subprocess implementation of the basic functions of Apertium.
- A branch called the
windows
has the implementation for thewindows
support and will soon be available on master. Detailed instructions can be found here
Major things to do
- Subprocess implementation of the C++ functions in Apertium. To make the wrapper thinner.
- Other small issues can be found here
Usage of library
Analysis
Performing Morphological Analysis
Method 1: One can create Analyzer
objects on which analyze()
function can be run.
In [1]: import apertium
In [2]: a = apertium.Analyzer('en')
In [3]: a.analyze('cats')
Out[3]: [cats/cat<n><pl>, ./.<sent>]
Method 2: Alternatively, the library provides an option to directly run the analyze
method.
In [1]: import apertium
In [2]: apertium.analyze('en', 'cats')
Out[2]: cats/cat<n><pl>
Generation
Performing Morphological Generation
Method 1: Just like the Analyzer
, One can create Generator
objects on which generate()
function can be run.
In [1]: import apertium
In [2]: g = apertium.Generator('en')
In [3]: g.generate('^cat<n><pl>$')
Out[3]: 'cats'
Method 2: Running generate()
directly.
In [1]: import apertium
In [2]: apertium.generate('en', '^cat<n><pl>$')
Out[2]: 'cats'
Installing more modes from other language data
One can also install modes by providing the path to the lang-data using this simple function
In [1]: import apertium
In [2]: apertium.append_pair_path('..')
Translation
Performing Translations
In [1]: import apertium
In [2]: t = apertium.Translator('eng', 'spa')
In [3]: t.translate('cats')
Out[3]: 'Gatos'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
apertium_app-1.0-py3-none-any.whl
(14.7 kB
view hashes)
Close
Hashes for apertium_app-1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 109cb3bdfe15178e60d182e083a02cadb0cce793bd7671da8b39de399e7abcf9 |
|
MD5 | b3b0565a8eef22b626112bc2650ddf13 |
|
BLAKE2b-256 | f1beb27ff947aa5947fac8aac2da8a3844c0e001d8ae98449e17fa1f5e37c943 |