Update project structure

This commit is contained in:
Patrick Jentsch
2020-03-10 14:20:59 +01:00
parent 2f22105cbd
commit 0237fabeb6
9 changed files with 18 additions and 437565 deletions

View File

@ -0,0 +1,41 @@
FROM debian:stretch-slim
EXPOSE 4877
RUN apt-get update && \
apt-get install -y --no-install-recommends \
subversion \
bison flex gcc make pkg-config libncurses5 libncurses5-dev libpcre3-dev libglib2.0-0 libglib2.0-dev libreadline7 libreadline-dev
WORKDIR /root
# Installation: IMS Open Corpus Workbench
RUN svn -q export http://svn.code.sf.net/p/cwb/code/cwb/trunk cwb && \
cd cwb && \
echo "PLATFORM=linux-64\nSITE=standard" | cat - config.mk > temp && mv temp config.mk && \
make clean && \
make depend && \
make all && \
make install && \
cd ..
# Installation: Perl CWB package
RUN echo "yes" | cpan HTML::Entities && \
svn -q export http://svn.code.sf.net/p/cwb/code/perl/trunk/CWB perl-cwb && \
cd perl-cwb && \
perl Makefile.PL && \
make && \
make test && \
make install && \
cd ..
COPY docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT ["docker-entrypoint.sh"]

View File

@ -0,0 +1,33 @@
#!/bin/bash
if [ $# -eq 0 ]; then
CQPSERVER_HOST="${CQPSERVER_HOST:-*}"
CQPSERVER_PASSWORD="${CQPSERVER_PASSWORD:-}"
CQPSERVER_USER="${CQPSERVER_USER:-anonymous}"
echo "host ${CQPSERVER_HOST};" > /root/cqpserver.init
echo "user ${CQPSERVER_USER} \"${CQPSERVER_PASSWORD}\";" >> /root/cqpserver.init
cqpserver -I /root/cqpserver.init
elif [ $1 == "prepare" ]; then
# Input:
# - Source file: "/root/files/corpus.vrt"
# Output
# - Corpus name: "CORPUS"
# - Corpus data directory: "/corpora/data/corpus"
# - Corpus registry file: "/usr/local/share/cwb/registry/corpus"
mkdir -p /corpora/data/corpus
cwb-encode \
-c utf8 \
-d /corpora/data/corpus \
-f /root/files/corpus.vrt \
-R /usr/local/share/cwb/registry/corpus \
-P lemma -P simple_pos -P pos -P ner \
-S text:0+address+author+booktitle+chapter+editor+institution+journal+pages+publisher+publishing_year+school+title -S s \
-0 corpus \
-xsB
cwb-make \
-V CORPUS
else
echo "Unknown command"
fi