# Spanish: apertium-spa

This is an Apertium monolingual language package for Spanish. What you can use this language package for:

* Morphological analysis of Spanish
* Morphological generation of Spanish
* Part-of-speech tagging of Spanish

## Requirements

You will need the following software installed:

* lttoolbox (>= 3.7.1)
* apertium (>= 3.8.3)
* vislcg3 (>= 1.3.9)

If this does not make any sense, we recommend you look at: https://apertium.org

## Compiling

Given the requirements being installed, you should be able to just run:

```console
$ ./autogen.sh
$ make
```

If you're doing development, you don't have to install the data, you can use it directly from this directory.

If you are installing this language package as a prerequisite for an Apertium translation pair, then do (typically as root / with sudo):

```console
# make install
```

You can give a `--prefix` to `./autogen.sh` to install as a non-root user, but make sure to use the same prefix when installing the translation pair and any other language packages.

If any of this doesn't make sense or doesn't work, see https://wiki.apertium.org/wiki/Install_language_data_by_compiling

## Testing

If you are in the source directory after running make, the following commands should work:

```
$ echo "Voy a la playa" | apertium -d . spa-morph
^Voy/ir<vblex><pri><p1><sg>$ ^a/a<pr>$ ^la/el<det><def><f><sg>/lo<prn><pro><p3><f><sg>$ 
^playa/playa<n><f><sg>$^./.<sent>$

```

```
$ echo "Voy a la playa" | apertium -d . spa-tagger
^ir<vblex><pri><p1><sg>$ ^a<pr>$ ^el<det><def><f><sg>$ ^playa<n><f><sg>$^.<sent>$
```

## Tagger model training

To train the tagger model, do one of the following:

Supervised training:
```console
$ make -f tagger.supervised.make
```

Unsupervised training
```console
$ make -f tagger.unsupervised.make
```

For details on the corpora used in training, check the [corpora information](tagger-data/README.md).

For more information, see https://wiki.apertium.org/wiki/Tagger_training

## Files and data

* [`apertium-spa.spa.metadix`](apertium-spa.spa.metadix) - Monolingual dictionary
* [`spa.prob`](spa.prob) - Tagger model
* [`apertium-spa.spa.rlx`](apertium-spa.spa.rlx) - Constraint Grammar disambiguation rules
* [`apertium-spa.post-spa.dix`](apertium-spa.post-spa.dix) - Post-generator
* [`modes.xml`](modes.xml) - Translation modes

## For more information

* https://wiki.apertium.org/wiki/Installation
* https://wiki.apertium.org/wiki/apertium-spa
* https://wiki.apertium.org/wiki/Using_an_lttoolbox_dictionary

## Help and support

If you need help using this language pair or data, you can contact:

* Mailing list: apertium-stuff@lists.sourceforge.net
* IRC: `#apertium` on `irc.oftc.net` (irc://irc.oftc.net/#apertium)

See also the file AUTHORS included in this distribution.

