diff options
-rwxr-xr-x | get_data.sh | 2 | ||||
-rwxr-xr-x | scripts/train_dic_creator.pl | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/get_data.sh b/get_data.sh index a658ec2..068c776 100755 --- a/get_data.sh +++ b/get_data.sh | |||
@@ -62,7 +62,7 @@ done | |||
62 | 62 | ||
63 | READY="${WNET}/ready" | 63 | READY="${WNET}/ready" |
64 | mkdir -p "${READY}" | 64 | mkdir -p "${READY}" |
65 | mv "${SCRIPTS}"/*.def "${READY}" | 65 | mv "${ROOT}"/*.def "${READY}" |
66 | 66 | ||
67 | echo "Downloading dictionaries" | 67 | echo "Downloading dictionaries" |
68 | 68 | ||
diff --git a/scripts/train_dic_creator.pl b/scripts/train_dic_creator.pl index a228044..0a9f931 100755 --- a/scripts/train_dic_creator.pl +++ b/scripts/train_dic_creator.pl | |||
@@ -33,7 +33,7 @@ use strict; | |||
33 | use warnings; | 33 | use warnings; |
34 | use List::Util qw(shuffle); | 34 | use List::Util qw(shuffle); |
35 | 35 | ||
36 | my ($source_lang, $target_lang, $cutoff, $dict_dir) = @ARGV; | 36 | my ($source_lang, $target_lang, $dict_dir, $cutoff) = @ARGV; |
37 | 37 | ||
38 | if (not defined $source_lang or not defined $target_lang) { | 38 | if (not defined $source_lang or not defined $target_lang) { |
39 | die "usage: ./train_dic_creator.pl <source_lang> <target_lang> (cutoff)"; | 39 | die "usage: ./train_dic_creator.pl <source_lang> <target_lang> (cutoff)"; |
@@ -44,7 +44,7 @@ if (not defined $cutoff && $cutoff ne '') { | |||
44 | } | 44 | } |
45 | 45 | ||
46 | if (not defined $dict_dir && $dict_dir ne '') { | 46 | if (not defined $dict_dir && $dict_dir ne '') { |
47 | $dict_dir = './dictionaries/'; | 47 | $dict_dir = '../dictionaries'; |
48 | } | 48 | } |
49 | 49 | ||
50 | my $flipped = 0; | 50 | my $flipped = 0; |
@@ -106,11 +106,11 @@ my $size = $cutoff / 2; | |||
106 | my @head = @result[0..$size - 1]; | 106 | my @head = @result[0..$size - 1]; |
107 | my @tail = @result[-$size..-1]; | 107 | my @tail = @result[-$size..-1]; |
108 | 108 | ||
109 | my $train_file_name = $source_lang . '_' . $target_lang . '.train'; | 109 | my $train_file_name = "$dict_dir/$source_lang_$target_lang.train'; |
110 | my $test_file_name = $source_lang . '_' . $target_lang . '.test'; | 110 | my $test_file_name = "$dict_dir/$source_lang_$target_lang.test'; |
111 | 111 | ||
112 | open my $train_fh, '>', $dict_dir . $train_file_name; | 112 | open my $train_fh, '>', $train_file_name; |
113 | open my $test_fh, '>', $dict_dir . $test_file_name; | 113 | open my $test_fh, '>', $test_file_name; |
114 | 114 | ||
115 | print $train_fh join("\n", @head); | 115 | print $train_fh join("\n", @head); |
116 | print $test_fh join("\n", @tail); | 116 | print $test_fh join("\n", @tail); |