Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lm/arpa-file-parser-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ void TestableArpaFileParser::Validate(
// expect_ngrams.array, CompareNgrams);
// if (mpos.first != ngrams_.end())
// KALDI_ERR << "Maismatch at index " << mpos.first - ngrams_.begin();
//TODO:auto above requres C++11, and I cannot spell out the type!!!
// TODO: auto above requres C++11, and I cannot spell out the type!!!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there is need to change this file

KALDI_ASSERT(std::equal(ngrams_.begin(), ngrams_.end(),
expect_ngrams.array, CompareNgrams));
}
Expand Down
8 changes: 4 additions & 4 deletions src/lm/arpa-file-parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
#ifndef KALDI_LM_ARPA_FILE_PARSER_H_
#define KALDI_LM_ARPA_FILE_PARSER_H_

#include <fst/fst-decl.h>

#include <string>
#include <vector>

#include <fst/fst-decl.h>

#include "base/kaldi-types.h"
#include "itf/options-itf.h"

Expand All @@ -38,7 +38,7 @@ struct ArpaParseOptions {
enum OovHandling {
kRaiseError, ///< Abort on OOV words
kAddToSymbols, ///< Add novel words to the symbol table.
kReplaceWithUnk, ///< Replace OOV words with <unk>.
kReplaceWithUnk, ///< Replace OOV words with <unk>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not very sure about this, but I think there should be a space after the comment // thing?

//this is bad
// this is good

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just followed the rule "two spaces between code and comments". I'll modify it as what you suggested.

kSkipNGram ///< Skip n-gram with OOV word and continue.
};

Expand All @@ -59,7 +59,7 @@ struct ArpaParseOptions {
int32 eos_symbol; ///< Symbol for </s>, Required non-epsilon.
int32 unk_symbol; ///< Symbol for <unk>, Required for kReplaceWithUnk.
OovHandling oov_handling; ///< How to handle OOV words in the file.
int32 max_warnings; ///< Maximum warnings to report, <0 unlimited.
int32 max_warnings; ///< Maximum warnings to report, <0 unlimited.
};

/**
Expand Down
5 changes: 2 additions & 3 deletions src/lm/arpa-lm-compiler-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace kaldi {
enum {
kEps = 0,
kDisambig,
kBos,kEos,
kBos, kEos,
};

// Number of random sentences for coverage test.
Expand Down Expand Up @@ -227,8 +227,7 @@ int main(int argc, char *argv[]) {
if (ok) {
KALDI_LOG << "All tests passed";
return 0;
}
else {
} else {
KALDI_WARN << "Test FAILED";
return 1;
}
Expand Down
2 changes: 1 addition & 1 deletion src/lm/const-arpa-lm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class LmState {
// auxiliary class LmState above.
class ConstArpaLmBuilder : public ArpaFileParser {
public:
ConstArpaLmBuilder(ArpaParseOptions options)
explicit ConstArpaLmBuilder(ArpaParseOptions options)
: ArpaFileParser(options, NULL) {
ngram_order_ = 0;
num_words_ = 0;
Expand Down
Loading