diff --git a/luscenje_struktur/loader.py b/luscenje_struktur/loader.py index e844a9c..77fdd34 100644 --- a/luscenje_struktur/loader.py +++ b/luscenje_struktur/loader.py @@ -22,6 +22,10 @@ def load_files(args, database, w_collection=None, input_corpus=None): if len(filenames) == 1 and os.path.isdir(filenames[0]): filenames = [os.path.join(filenames[0], file) for file in os.listdir(filenames[0]) if file[-5:] != '.zstd'] + if len(filenames) > 1: + filenames = [filename for filename in filenames if filename[-5:] != '.zstd'] + filenames = sorted(filenames, key=lambda x: int(x.split('.')[-1])) + database.init("CREATE TABLE Files ( filename varchar(2048) )") for idx, fname in enumerate(filenames): diff --git a/run.sh.example b/run.sh.example index 85561d0..95395c4 100755 --- a/run.sh.example +++ b/run.sh.example @@ -1 +1 @@ -pypy3 src/wani.py data/Kolokacije_strukture_JOS-32-representation_3D_08_1.xml data/input --out data/output --sloleks_db '' --collocation_sentence_map_dest data/collocation-sentence-mapper --db /mnt/tmp/mysql-wani --multiple-output --load-sloleks +pypy3 wani.py data/Kolokacije_strukture_JOS-32-representation_3D_08_1.xml data/input --out data/output --sloleks_db '' --collocation_sentence_map_dest data/collocation-sentence-mapper --db /mnt/tmp/mysql-wani --multiple-output --load-sloleks diff --git a/luscenje_struktur/wani.py b/wani.py similarity index 100% rename from luscenje_struktur/wani.py rename to wani.py