From c9da3dce2b5c3d81c3cea3f62896fef4a072b76d Mon Sep 17 00:00:00 2001 From: Jakob Moser <moser@cl.uni-heidelberg.de> Date: Tue, 12 Apr 2022 21:47:16 +0200 Subject: [PATCH] Add documentation for the new feature --- README.md | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9c9dc3a..faa5818 100644 --- a/README.md +++ b/README.md @@ -20,15 +20,13 @@ This will create an image from the [`Dockerfile`](Dockerfile) and tag it as `xle To parse a sentence using xle-docker, you need two things: -* The path to an LFG grammar file, e.g. `/home/mustermann/grammatik.lfg` +* A grammar, e.g. stored in the file `/home/mustermann/grammatik.lfg` * A sentence, e.g. `in der Arena veranstalten die Ritter ein Turnier .` -Then, you have to execute the following command: +You can then execute the following command: ```bash -sudo docker run -it \ - --mount type=bind,source=/home/mustermann/grammatik.lfg,target=/grammar.lfg \ - xle "in der Arena veranstalten die Ritter ein Turnier ." +sudo docker run -i xle "in der Arena veranstalten die Ritter ein Turnier ." < /home/mustermann/grammatik.lfg ``` This will take a few seconds. The parses will then be output to the command line using XLE's own XML export format. If you want to store the output in a file, append `> name_of_your_file.xml` at the end of the command. @@ -39,6 +37,18 @@ This will take a few seconds. The parses will then be output to the command line 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`). </details> +<details> +<summary>Alternative using mounts</summary> + +The container also allows the Grammar file to be mounted as `/grammar.lfg`, if this is more useful for your specific use case: + +```bash +sudo docker run \ + --mount type=bind,source=/home/mustermann/grammatik.lfg,target=/grammar.lfg \ + xle "in der Arena veranstalten die Ritter ein Turnier ." +``` +</details> + ## :page_with_curl: About Here, a more detailed explanation of the relevant files is given. The used sources are marked with :books:. -- GitLab