<commit_before>#!/bin/sh

set -e

[ -n "$1" ] || { echo Usage: $0 version >&2; exit 1; }

dir=ufal.morphodita
rm -rf $dir
mkdir -p $dir

# Local files
cp -a Changes ../../../LICENSE MANIFEST.in ../../../bindings/python/examples test $dir
mkdir $dir/test/data
cp ../test_data/test.dict ../test_data/test.tagger $dir/test/data

# MorphoDiTa sources
make -C ../../../src_lib_only morphodita.cpp
mkdir $dir/morphodita
cp ../../../src_lib_only/morphodita.[ch]* $dir/morphodita

# SWIG files
make -C ../../../bindings/python morphodita_python.cpp
cp ../../../bindings/python/morphodita_python.cpp $dir/morphodita
cp -a ../../../bindings/python/ufal $dir

# Fill in version
sed "s/^\\( *version *= *'\\)[^']*'/\\1$1'/" setup.py >$dir/setup.py

# README file
./README.sh >$dir/README

# Generate sdist
(cd ufal.morphodita && python setup.py sdist && cd dist && tar xf ufal.morphodita-$1.tar.gz)<commit_msg>Fill version in the `__version__` member in the PyPI package.<commit_after>#!/bin/sh

set -e

[ -n "$1" ] || { echo Usage: $0 version >&2; exit 1; }

dir=ufal.morphodita
rm -rf $dir
mkdir -p $dir

# Local files
cp -a Changes ../../../LICENSE MANIFEST.in ../../../bindings/python/examples test $dir
mkdir $dir/test/data
cp ../test_data/test.dict ../test_data/test.tagger $dir/test/data

# MorphoDiTa sources
make -C ../../../src_lib_only morphodita.cpp
mkdir $dir/morphodita
cp ../../../src_lib_only/morphodita.[ch]* $dir/morphodita

# SWIG files
make -C ../../../bindings/python morphodita_python.cpp
cp ../../../bindings/python/morphodita_python.cpp $dir/morphodita
cp -a ../../../bindings/python/ufal $dir

# Fill in version
sed "s/^\\( *version *= *'\\)[^']*'/\\1$1'/" setup.py >$dir/setup.py
sed "s/^# *__version__ *=.*$/__version__ = \"$1\"/" $dir/ufal/morphodita.py -i

# README file
./README.sh >$dir/README

# Generate sdist
(cd ufal.morphodita && python setup.py sdist && cd dist && tar xf ufal.morphodita-$1.tar.gz)
{'fraction_non_alphanumeric': 0.21788871554862194, 'fraction_numerical': 0.0078003120124804995, 'mean_word_length': 2.886868686868687, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2825905', 'n_tokens_mistral': 797, 'n_tokens_neox': 748, 'n_words': 183}