Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lm
diff options
context:
space:
mode:
authorKenneth Heafield <github@kheafield.com>2013-01-20 17:43:19 +0400
committerKenneth Heafield <github@kheafield.com>2013-01-20 17:43:19 +0400
commitcfe7d00ea279717e730881b98795d510a9c30d26 (patch)
treef852cfeb7e39b1e1b9052fd30de340e4c2a5194d /lm
parenta52d97f99f743b81781d1106c9a17266b901ee6f (diff)
Compiler warnings, rename to ${binary}_main.cc
Diffstat (limited to 'lm')
-rw-r--r--lm/Jamfile16
-rw-r--r--lm/build_binary_main.cc (renamed from lm/build_binary.cc)0
-rw-r--r--lm/builder/Jamfile4
-rw-r--r--lm/builder/lmplz_main.cc (renamed from lm/builder/main.cc)0
-rw-r--r--lm/filter/Jamfile2
-rw-r--r--lm/filter/filter_main.cc (renamed from lm/filter/main.cc)19
-rw-r--r--lm/filter/phrase.hh1
-rw-r--r--lm/fragment_main.cc (renamed from lm/fragment.cc)0
-rw-r--r--lm/kenlm_max_order_main.cc (renamed from lm/max_order.cc)0
-rw-r--r--lm/query_main.cc (renamed from lm/ngram_query.cc)0
10 files changed, 21 insertions, 21 deletions
diff --git a/lm/Jamfile b/lm/Jamfile
index 0faea30f4..3f25d9ce4 100644
--- a/lm/Jamfile
+++ b/lm/Jamfile
@@ -13,17 +13,17 @@ update-if-changed $(ORDER-LOG) $(max-order) ;
max-order += <dependency>$(ORDER-LOG) ;
-fakelib kenlm : bhiksha.cc binary_format.cc config.cc lm_exception.cc model.cc quantize.cc read_arpa.cc search_hashed.cc search_trie.cc sizes.cc trie.cc trie_sort.cc value_build.cc virtual_interface.cc vocab.cc ../util//kenutil : <include>.. $(max-order) : : <include>.. $(max-order) ;
+fakelib kenlm : [ glob *.cc : *main.cc *test.cc ] ../util//kenutil : <include>.. $(max-order) : : <include>.. $(max-order) ;
import testing ;
-run left_test.cc ../util//kenutil kenlm /top//boost_unit_test_framework : : test.arpa ;
-run model_test.cc ../util//kenutil kenlm /top//boost_unit_test_framework : : test.arpa test_nounk.arpa ;
-run partial_test.cc ../util//kenutil kenlm /top//boost_unit_test_framework : : test.arpa ;
+run left_test.cc kenlm /top//boost_unit_test_framework : : test.arpa ;
+run model_test.cc kenlm /top//boost_unit_test_framework : : test.arpa test_nounk.arpa ;
+run partial_test.cc kenlm /top//boost_unit_test_framework : : test.arpa ;
-exe query : ngram_query.cc kenlm ../util//kenutil ;
-exe build_binary : build_binary.cc kenlm ../util//kenutil ;
-exe kenlm_max_order : max_order.cc : <include>.. $(max-order) ;
-exe fragment : fragment.cc kenlm ;
+exe query : query_main.cc kenlm ../util//kenutil ;
+exe build_binary : build_binary_main.cc kenlm ../util//kenutil ;
+exe kenlm_max_order : kenlm_max_order_main.cc : <include>.. $(max-order) ;
+exe fragment : fragment_main.cc kenlm ;
alias programs : query build_binary kenlm_max_order fragment filter//filter : <threading>multi:<source>builder//lmplz ;
diff --git a/lm/build_binary.cc b/lm/build_binary_main.cc
index ab2c0c320..ab2c0c320 100644
--- a/lm/build_binary.cc
+++ b/lm/build_binary_main.cc
diff --git a/lm/builder/Jamfile b/lm/builder/Jamfile
index 9b54911a0..b596e086a 100644
--- a/lm/builder/Jamfile
+++ b/lm/builder/Jamfile
@@ -1,8 +1,8 @@
-fakelib builder : corpus_count.cc adjust_counts.cc initial_probabilities.cc interpolate.cc pipeline.cc print.cc
+fakelib builder : [ glob *.cc : *test.cc *main.cc ]
../../util//kenutil ../../util/stream//stream ../../util/double-conversion//double-conversion ..//kenlm
: : : <library>/top//boost_thread $(timer-link) ;
-exe lmplz : main.cc builder /top//boost_program_options ;
+exe lmplz : lmplz_main.cc builder /top//boost_program_options ;
import testing ;
unit-test corpus_count_test : corpus_count_test.cc builder /top//boost_unit_test_framework ;
diff --git a/lm/builder/main.cc b/lm/builder/lmplz_main.cc
index 90b9dca2d..90b9dca2d 100644
--- a/lm/builder/main.cc
+++ b/lm/builder/lmplz_main.cc
diff --git a/lm/filter/Jamfile b/lm/filter/Jamfile
index 16e417261..adee3d233 100644
--- a/lm/filter/Jamfile
+++ b/lm/filter/Jamfile
@@ -1,5 +1,5 @@
fakelib lm_filter : phrase.cc vocab.cc arpa_io.cc ../../util//kenutil : <threading>multi:<library>/top//boost_thread ;
-obj main : main.cc : <threading>single:<define>NTHREAD <include>../.. ;
+obj main : filter_main.cc : <threading>single:<define>NTHREAD <include>../.. ;
exe filter : main lm_filter ../../util//kenutil ..//kenlm : <threading>multi:<library>/top//boost_thread ;
diff --git a/lm/filter/main.cc b/lm/filter/filter_main.cc
index c42243e2b..1a4ba84fe 100644
--- a/lm/filter/main.cc
+++ b/lm/filter/filter_main.cc
@@ -53,7 +53,7 @@ void DisplayHelp(const char *name) {
" stream i.e. /dev/stdout\n";
}
-typedef enum {MODE_COPY, MODE_SINGLE, MODE_MULTIPLE, MODE_UNION} FilterMode;
+typedef enum {MODE_COPY, MODE_SINGLE, MODE_MULTIPLE, MODE_UNION, MODE_UNSET} FilterMode;
typedef enum {FORMAT_ARPA, FORMAT_COUNT} Format;
struct Config {
@@ -162,19 +162,19 @@ int main(int argc, char *argv[]) {
return 1;
}
- // I used to have boost::program_options, but some users didn't want to compile boost.
+ // I used to have boost::program_options, but some users didn't want to compile boost.
lm::Config config;
- boost::optional<lm::FilterMode> mode;
+ config.mode = lm::MODE_UNSET;
for (int i = 1; i < argc - 2; ++i) {
const char *str = argv[i];
if (!std::strcmp(str, "copy")) {
- mode = lm::MODE_COPY;
+ config.mode = lm::MODE_COPY;
} else if (!std::strcmp(str, "single")) {
- mode = lm::MODE_SINGLE;
+ config.mode = lm::MODE_SINGLE;
} else if (!std::strcmp(str, "multiple")) {
- mode = lm::MODE_MULTIPLE;
+ config.mode = lm::MODE_MULTIPLE;
} else if (!std::strcmp(str, "union")) {
- mode = lm::MODE_UNION;
+ config.mode = lm::MODE_UNION;
} else if (!std::strcmp(str, "phrase")) {
config.phrase = true;
} else if (!std::strcmp(str, "context")) {
@@ -203,13 +203,12 @@ int main(int argc, char *argv[]) {
}
}
- if (!mode) {
+ if (config.mode == lm::MODE_UNSET) {
lm::DisplayHelp(argv[0]);
return 1;
}
- config.mode = *mode;
- if (config.phrase && config.mode != lm::MODE_UNION && mode != lm::MODE_MULTIPLE) {
+ if (config.phrase && config.mode != lm::MODE_UNION && config.mode != lm::MODE_MULTIPLE) {
std::cerr << "Phrase constraint currently only works in multiple or union mode. If you really need it for single, put everything on one line and use union." << std::endl;
return 1;
}
diff --git a/lm/filter/phrase.hh b/lm/filter/phrase.hh
index 07479dea6..b4edff418 100644
--- a/lm/filter/phrase.hh
+++ b/lm/filter/phrase.hh
@@ -57,6 +57,7 @@ class Substrings {
LM_FILTER_PHRASE_METHOD(Right, right)
LM_FILTER_PHRASE_METHOD(Phrase, phrase)
+#pragma GCC diagnostic ignored "-Wuninitialized" // end != finish so there's always an initialization
// sentence_id must be non-decreasing. Iterators are over words in the phrase.
template <class Iterator> void AddPhrase(unsigned int sentence_id, const Iterator &begin, const Iterator &end) {
// Iterate over all substrings.
diff --git a/lm/fragment.cc b/lm/fragment_main.cc
index 0267cd4eb..0267cd4eb 100644
--- a/lm/fragment.cc
+++ b/lm/fragment_main.cc
diff --git a/lm/max_order.cc b/lm/kenlm_max_order_main.cc
index 94221201c..94221201c 100644
--- a/lm/max_order.cc
+++ b/lm/kenlm_max_order_main.cc
diff --git a/lm/ngram_query.cc b/lm/query_main.cc
index 49757d9aa..49757d9aa 100644
--- a/lm/ngram_query.cc
+++ b/lm/query_main.cc