Skip to content
Snippets Groups Projects
Commit bc00795a authored by Jakob Moser's avatar Jakob Moser
Browse files

Add run and build instructions

parent d796097a
No related branches found
No related tags found
No related merge requests found
......@@ -6,4 +6,39 @@ Docker image containing the [Xerox Linguistic Environment (XLE)][xle] to parse s
Designed to be used in a "functional" style: You start a container from this image, pass a grammar and a sentence as input parameter and get the C- and F-structure in return. The container then terminates.
## :whale: Build the image
To run a container from this image, you first have to build it. To do so, clone the repository, change into it and then execute
```bash
sudo docker build -t xle .
```
This will create an image from the [`Dockerfile`](Dockerfile) and tag it as `xle`.
## :runner: Run a container
To parse a sentence using xle-docker, you need three things:
* The path to an LFG grammar file, e.g. `/home/mustermann/grammatik.lfg`
* The path to an existing folder where the results should be stored, e.g. `/home/mustermann/parses`
* A sentence, e.g. `in der Arena veranstalten die Ritter ein Turnier .`
Then, you have to execute the following command:
```
sudo docker run -it \
--mount type=bind,source=/home/mustermann/grammatik.lfg,target=/grammar.lfg \
--mount type=bind,source=/home/mustermann/parses,target=/output \
xle "in der Arena veranstalten die Ritter ein Turnier ."
```
This will take a few seconds, in which the container starts, xle parses the sentences and the results are written to a file. Afterwards, the container terminates.
<summary>
<details>Advanced tips</details>
Note that the `xle` specified in the `docker run` command is the name of the tag you've given the image when building, _not_ the command to be executed (although under the hood the container will call a Linux command also called `xle`).
</summary>
[xle]:https://ling.sprachwiss.uni-konstanz.de/pages/xle/
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment