Debian Codegraph @

README

raw
1 # Apertium
2
3 Apertium is an open-source rule-based machine translation toolchain and ecosystem. It facilitates the creation of consistent and transparent machine translation systems by relying on deterministic linguistic rules rather than statistical or neural models. Apertium's tools are designed to be language-agnostic and platform-independent, making them suitable for a wide range of languages and applications.
4
5 ## Project Overview
6
7 Apertium's framework is based on finite-state transducers, which enable efficient and accurate processing of natural languages. The language data used by Apertium is stored in XML and other human-readable text formats, organized into modular single-language packages and translation pairs. This modularity allows for the reuse of language data across multiple translation systems.
8
9 ## Features
10
11 - **Rule-Based Translation**: Consistent and understandable translations based on deterministic rules.
12 - **Finite-State Transducers**: Efficient language processing using advanced computational models.
13 - **Language-Agnostic Tools**: Broad applicability across multiple languages.
14 - **Modular Design**: Reusable language packages simplify the development of new translation pairs.
15
16 ## Installation
17
18 Apertium provides binaries for several platforms, including Debian, Ubuntu, Fedora, CentOS, OpenSUSE, Windows, and macOS. Both nightly builds and official releases are available. If you are on a supported platform, it is recommended to use the pre-built binaries.
19
20 For more information, see the [Apertium Installation Guide](https://wiki.apertium.org/wiki/Installation).
21
22 ## Building from Source
23
24 If you need to modify Apertium’s behavior or are on a platform that is not officially supported, follow these steps to build from source.
25
26 ### Requirements
27
28 - [lttoolbox](https://github.com/apertium/lttoolbox)
29 - libxml2
30 - ICU
31
32 ### Compiling
33
34 ```bash
35 $ autoreconf -fvi
36 $ ./configure
37 $ make
38 ```
39
40 ## Usage
41
42 Apertium can be used to translate text between supported languages.
43 Assuming the relevant language data (here the Spanish-Catalan translator) has been installed, translation can be achieved with the following command:
44
45 ```bash
46 $ apertium spa-cat input.txt output.txt
47 ```
48
49 The `apertium` executable can also use piped streams:
50
51 ```bash
52 $ echo "La casa es roja." | apertium spa-cat
53 ```
54
55 Language data which has been compiled but not installed can be used with the `-d` flag:
56
57 ```bash
58 $ echo "La casa es roja." | apertium -d ./apertium-spa-cat spa-cat
59 ```
60
61 Formats other than plaintext can be specified with the `-f` flag:
62
63 ```bash
64 $ apertium -f html spa-cat input.html output.html
65 ```
66
67 Data packages may provide modes besides the main translation mode. Use the `-l` flag to list them.
68
69 ```bash
70 $ apertium -l
71 $ apertium -l -d ./apertium-spa-cat
72 ```
73
74 ## Additional Tools
75
76 This repository also provides the following executables:
77
78 ### Pipeline Modules
79
80 - `apertium-extract-caps`, `apertium-restore-caps`: Handle capitalization
81 - `apertium-pretransfer`: Split compound analyses into separate words for processing by `apertium-transfer`
82 - `apertium-posttransfer`: Clean up repeated spaces
83 - `apertium-tagger`: Perform statistical part-of-speech tagging
84 - `apertium-transfer`, `apertium-interchunk`, `apertium-postchunk`: Structural transfer modules ([documentation](https://wiki.apertium.org/wiki/A_long_introduction_to_transfer_rules))
85 - `apertium-wblank-attach`, `apertium-wblank-detach`, `apertium-wblank-mode`: Handle word-bound blanks
86
87 ### Build Tools
88
89 These programs are used in the process of compiling linguistic data packages.
90
91 - `apertium-compile-caps`: Compile capitalization-handling rules for use by `apertium-restore-caps` ([documentation](https://wiki.apertium.org/wiki/Capitalization_restoration))
92 - `apertium-gen-modes`: Process the `modes.xml` file, which specifies what translation and analysis modes a data package provides
93 - `apertium-preprocess-transfer`: Process structural transfer rule files for use by `apertium-transfer`
94 - `apertium-validate-acx`, `apertium-validate-crx`, `apertium-validate-dictionary`, `apertium-validate-interchunk`, `apertium-validate-modes`, `apertium-validate-postchunk`, `apertium-validate-tagger`, `apertium-validate-transfer`: Validators for various XML rule formats
95
96 ### Format Handlers
97
98 For each supported file format, there is a deformatter named `apertium-des[NAME]` (e.g. `apertium-deshtml`) which reads formatted text from standard input and writes [Apertium stream format](https://wiki.apertium.org/wiki/Apertium_stream_format) to standard output.
99 There is also a corresponding set of reformatters which do the reverse and are named `apertium-re[NAME]` (e.g. `apertium-rehtml`).
100 These programs rarely need to be invoked directly, since they are handled by the `apertium` executable.
101
102 Most of the format handlers are currently deprecated in favor of [Transfuse](https://github.com/TinoDidriksen/transfuse).
103
104 ## License
105
106 This project is licensed under the GNU General Public License v2.0. See the [COPYING](COPYING) file for details.
107
108 For more information, visit [Apertium](https://apertium.org) or the [Apertium Wiki](https://wiki.apertium.org).