Ignore Tampio output and add fi-x-morpho dictionary to Docker
This commit is contained in:
@@ -16,3 +16,9 @@ npm-debug.log*
|
|||||||
# Mac and Windows breadcrumbs
|
# Mac and Windows breadcrumbs
|
||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|
||||||
|
# Compiled Tampio output — generated from .itp source files via `make`
|
||||||
|
examples/**/*.html
|
||||||
|
|
||||||
|
# Hiding temp files
|
||||||
|
diff.txt
|
||||||
+14
-1
@@ -4,15 +4,28 @@ FROM ubuntu:24.04
|
|||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
# libvoikko: the Finnish morphology library Tampio depends on
|
# libvoikko: the Finnish morphology library Tampio depends on
|
||||||
# voikko-fi: the actual Finnish dictionary data
|
# voikko-fi: provides only mor-standard; fi-x-morpho must be downloaded separately
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
libvoikko-dev \
|
libvoikko-dev \
|
||||||
voikko-fi \
|
voikko-fi \
|
||||||
python3 \
|
python3 \
|
||||||
python3-libvoikko \
|
python3-libvoikko \
|
||||||
git \
|
git \
|
||||||
|
curl \
|
||||||
|
unzip \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Install the fi-x-morpho dictionary that Tampio requires.
|
||||||
|
# The voikko-fi apt package only ships mor-standard; the morpho variant is a
|
||||||
|
# separate snapshot published by the voikko-fi project. The zip unpacks to
|
||||||
|
# 5/mor-morpho/ which is exactly where libvoikko looks for it under a search
|
||||||
|
# path. We install it system-wide under /usr/lib/voikko so it is available to
|
||||||
|
# all users (including non-interactive Docker runs).
|
||||||
|
RUN curl -fsSL https://www.puimula.org/htp/testing/voikko-snapshot-v5/dict-morpho.zip \
|
||||||
|
-o /tmp/dict-morpho.zip \
|
||||||
|
&& unzip /tmp/dict-morpho.zip -d /usr/lib/voikko \
|
||||||
|
&& rm /tmp/dict-morpho.zip
|
||||||
|
|
||||||
# Install Tampio directly from source (not on PyPI or npm)
|
# Install Tampio directly from source (not on PyPI or npm)
|
||||||
RUN git clone https://github.com/fergusq/tampio.git /opt/tampio
|
RUN git clone https://github.com/fergusq/tampio.git /opt/tampio
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
TAMPIO = docker compose run --rm tampio tampio -i -p
|
||||||
|
|
||||||
|
EXAMPLES = \
|
||||||
|
examples/basics/hello.html \
|
||||||
|
examples/basics/factorial.html \
|
||||||
|
examples/basics/fibonacci.html \
|
||||||
|
examples/basics/index.html \
|
||||||
|
examples/data-structures/lista.html \
|
||||||
|
examples/data-structures/vektori.html \
|
||||||
|
examples/strings/merkkijono.html \
|
||||||
|
examples/async/nappi.html \
|
||||||
|
examples/program/kasvutaulukko.html
|
||||||
|
|
||||||
|
.PHONY: all clean
|
||||||
|
|
||||||
|
all: $(EXAMPLES)
|
||||||
|
|
||||||
|
%.html: %.itp
|
||||||
|
$(TAMPIO) $< 2>/dev/null > $@
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $(EXAMPLES)
|
||||||
Reference in New Issue
Block a user