mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-08-17 07:20:48 +03:00
Fix a few compiler warnings (clang)
This commit is contained in:
parent
b0e7d30fc6
commit
7375d81e16
@ -57,8 +57,8 @@ private:
|
|||||||
public:
|
public:
|
||||||
HypothesisScoreOrdererWithDistortion(const Range* transOptRange,
|
HypothesisScoreOrdererWithDistortion(const Range* transOptRange,
|
||||||
const bool deterministic = false)
|
const bool deterministic = false)
|
||||||
: m_transOptRange(transOptRange)
|
: m_deterministic(deterministic)
|
||||||
, m_deterministic(deterministic) {
|
, m_transOptRange(transOptRange) {
|
||||||
m_totalWeightDistortion = 0;
|
m_totalWeightDistortion = 0;
|
||||||
const StaticData &staticData = StaticData::Instance();
|
const StaticData &staticData = StaticData::Instance();
|
||||||
|
|
||||||
@ -128,8 +128,8 @@ BackwardsEdge::BackwardsEdge(const BitmapContainer &prevBitmapContainer
|
|||||||
, m_parent(parent)
|
, m_parent(parent)
|
||||||
, m_translations(translations)
|
, m_translations(translations)
|
||||||
, m_estimatedScores(estimatedScores)
|
, m_estimatedScores(estimatedScores)
|
||||||
, m_seenPosition()
|
|
||||||
, m_deterministic(deterministic)
|
, m_deterministic(deterministic)
|
||||||
|
, m_seenPosition()
|
||||||
{
|
{
|
||||||
|
|
||||||
// If either dimension is empty, we haven't got anything to do.
|
// If either dimension is empty, we haven't got anything to do.
|
||||||
@ -294,8 +294,8 @@ BitmapContainer::BitmapContainer(const Bitmap &bitmap
|
|||||||
, bool deterministic)
|
, bool deterministic)
|
||||||
: m_bitmap(bitmap)
|
: m_bitmap(bitmap)
|
||||||
, m_stack(stack)
|
, m_stack(stack)
|
||||||
, m_deterministic(deterministic)
|
|
||||||
, m_numStackInsertions(0)
|
, m_numStackInsertions(0)
|
||||||
|
, m_deterministic(deterministic)
|
||||||
{
|
{
|
||||||
m_hypotheses = HypothesisSet();
|
m_hypotheses = HypothesisSet();
|
||||||
m_edges = BackwardsEdgeSet();
|
m_edges = BackwardsEdgeSet();
|
||||||
|
@ -257,7 +257,6 @@ void ChartHypothesis::CleanupArcList()
|
|||||||
* so we'll keep all of arc list if nedd distinct n-best list
|
* so we'll keep all of arc list if nedd distinct n-best list
|
||||||
*/
|
*/
|
||||||
AllOptions const& opts = StaticData::Instance().options();
|
AllOptions const& opts = StaticData::Instance().options();
|
||||||
const StaticData &staticData = StaticData::Instance();
|
|
||||||
size_t nBestSize = opts.nbest.nbest_size;
|
size_t nBestSize = opts.nbest.nbest_size;
|
||||||
bool distinctNBest = (opts.nbest.only_distinct
|
bool distinctNBest = (opts.nbest.only_distinct
|
||||||
|| opts.mbr.enabled
|
|| opts.mbr.enabled
|
||||||
|
@ -29,7 +29,7 @@ namespace Moses
|
|||||||
{
|
{
|
||||||
|
|
||||||
class ChartSearchGraphWriter;
|
class ChartSearchGraphWriter;
|
||||||
class AllOptions;
|
struct AllOptions;
|
||||||
|
|
||||||
//! functor to compare (chart) hypotheses by (descending) score
|
//! functor to compare (chart) hypotheses by (descending) score
|
||||||
class ChartHypothesisScoreOrderer
|
class ChartHypothesisScoreOrderer
|
||||||
|
@ -10,7 +10,7 @@ class FFState;
|
|||||||
|
|
||||||
namespace Syntax
|
namespace Syntax
|
||||||
{
|
{
|
||||||
class SHyperedge;
|
struct SHyperedge;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** base class for all stateful feature functions.
|
/** base class for all stateful feature functions.
|
||||||
|
@ -8,7 +8,7 @@ namespace Moses
|
|||||||
|
|
||||||
namespace Syntax
|
namespace Syntax
|
||||||
{
|
{
|
||||||
class SHyperedge;
|
struct SHyperedge;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** base class for all stateless feature functions.
|
/** base class for all stateless feature functions.
|
||||||
|
@ -50,7 +50,7 @@ class FFState;
|
|||||||
class StatelessFeatureFunction;
|
class StatelessFeatureFunction;
|
||||||
class StatefulFeatureFunction;
|
class StatefulFeatureFunction;
|
||||||
class Manager;
|
class Manager;
|
||||||
class ReportingOptions;
|
struct ReportingOptions;
|
||||||
|
|
||||||
typedef std::vector<Hypothesis*> ArcList;
|
typedef std::vector<Hypothesis*> ArcList;
|
||||||
|
|
||||||
|
@ -248,8 +248,6 @@ void BilingualLM::getAllAlignments(const ChartHypothesis& cur_hypo, size_t featu
|
|||||||
int source_word_mid_idx; //The word alignment
|
int source_word_mid_idx; //The word alignment
|
||||||
|
|
||||||
//Get source sent
|
//Get source sent
|
||||||
const ChartManager& manager = cur_hypo.GetManager();
|
|
||||||
const Sentence& source_sent = static_cast<const Sentence&>(manager.GetSource());
|
|
||||||
const AlignmentInfo& alignments = targetPhrase.GetAlignTerm();
|
const AlignmentInfo& alignments = targetPhrase.GetAlignTerm();
|
||||||
|
|
||||||
// get absolute position in source sentence for each source word in rule
|
// get absolute position in source sentence for each source word in rule
|
||||||
|
@ -10,11 +10,11 @@ namespace Moses
|
|||||||
Search::Search(Manager& manager, const InputType &source)
|
Search::Search(Manager& manager, const InputType &source)
|
||||||
: m_manager(manager)
|
: m_manager(manager)
|
||||||
, m_source(source)
|
, m_source(source)
|
||||||
|
, m_options(manager.options())
|
||||||
, m_inputPath()
|
, m_inputPath()
|
||||||
, m_initialTransOpt()
|
, m_initialTransOpt()
|
||||||
, m_options(manager.options())
|
|
||||||
, interrupted_flag(0)
|
|
||||||
, m_bitmaps(source.GetSize(), source.m_sourceCompleted)
|
, m_bitmaps(source.GetSize(), source.m_sourceCompleted)
|
||||||
|
, interrupted_flag(0)
|
||||||
{
|
{
|
||||||
m_initialTransOpt.SetInputPath(m_inputPath);
|
m_initialTransOpt.SetInputPath(m_inputPath);
|
||||||
}
|
}
|
||||||
|
@ -293,7 +293,6 @@ void SearchNormal::ExpandHypothesis(const Hypothesis &hypothesis,
|
|||||||
float estimatedScore,
|
float estimatedScore,
|
||||||
const Bitmap &bitmap)
|
const Bitmap &bitmap)
|
||||||
{
|
{
|
||||||
const StaticData &staticData = StaticData::Instance();
|
|
||||||
SentenceStats &stats = m_manager.GetSentenceStats();
|
SentenceStats &stats = m_manager.GetSentenceStats();
|
||||||
|
|
||||||
Hypothesis *newHypo;
|
Hypothesis *newHypo;
|
||||||
|
@ -324,7 +324,6 @@ std::vector <ChartTranslationOptions*>
|
|||||||
Sentence::
|
Sentence::
|
||||||
GetXmlChartTranslationOptions(AllOptions const& opts) const
|
GetXmlChartTranslationOptions(AllOptions const& opts) const
|
||||||
{
|
{
|
||||||
const StaticData &staticData = StaticData::Instance();
|
|
||||||
std::vector <ChartTranslationOptions*> ret;
|
std::vector <ChartTranslationOptions*> ret;
|
||||||
|
|
||||||
// XML Options
|
// XML Options
|
||||||
|
@ -9,13 +9,6 @@ namespace Syntax
|
|||||||
namespace F2S
|
namespace F2S
|
||||||
{
|
{
|
||||||
|
|
||||||
HyperPathLoader::HyperPathLoader(FactorDirection direction,
|
|
||||||
const std::vector<FactorType> &factorOrder)
|
|
||||||
: m_direction(direction)
|
|
||||||
, m_factorOrder(factorOrder)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void HyperPathLoader::Load(const StringPiece &s, HyperPath &path)
|
void HyperPathLoader::Load(const StringPiece &s, HyperPath &path)
|
||||||
{
|
{
|
||||||
path.nodeSeqs.clear();
|
path.nodeSeqs.clear();
|
||||||
|
@ -30,8 +30,6 @@ namespace F2S
|
|||||||
class HyperPathLoader
|
class HyperPathLoader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
HyperPathLoader(FactorDirection, const std::vector<FactorType> &);
|
|
||||||
|
|
||||||
void Load(const StringPiece &, HyperPath &);
|
void Load(const StringPiece &, HyperPath &);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -58,8 +56,6 @@ private:
|
|||||||
return FactorCollection::Instance().AddFactor(s, true);
|
return FactorCollection::Instance().AddFactor(s, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
FactorDirection m_direction;
|
|
||||||
const std::vector<FactorType> &m_factorOrder;
|
|
||||||
std::vector<TreeFragmentToken> m_tokenSeq;
|
std::vector<TreeFragmentToken> m_tokenSeq;
|
||||||
std::vector<NodeTuple> m_nodeTupleSeq;
|
std::vector<NodeTuple> m_nodeTupleSeq;
|
||||||
std::stack<int> m_parentStack;
|
std::stack<int> m_parentStack;
|
||||||
|
@ -60,7 +60,7 @@ bool HyperTreeLoader::Load(const std::vector<FactorType> &input,
|
|||||||
|
|
||||||
double_conversion::StringToDoubleConverter converter(double_conversion::StringToDoubleConverter::NO_FLAGS, NAN, NAN, "inf", "nan");
|
double_conversion::StringToDoubleConverter converter(double_conversion::StringToDoubleConverter::NO_FLAGS, NAN, NAN, "inf", "nan");
|
||||||
|
|
||||||
HyperPathLoader hyperPathLoader(Input, input);
|
HyperPathLoader hyperPathLoader;
|
||||||
|
|
||||||
Phrase dummySourcePhrase;
|
Phrase dummySourcePhrase;
|
||||||
{
|
{
|
||||||
@ -87,9 +87,7 @@ bool HyperTreeLoader::Load(const std::vector<FactorType> &input,
|
|||||||
alignString = temp;
|
alignString = temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (++pipes) {
|
++pipes; // counts
|
||||||
StringPiece str(*pipes); //counts
|
|
||||||
}
|
|
||||||
|
|
||||||
scoreVector.clear();
|
scoreVector.clear();
|
||||||
for (util::TokenIter<util::AnyCharacter, true> s(scoreString, " \t"); s; ++s) {
|
for (util::TokenIter<util::AnyCharacter, true> s(scoreString, " \t"); s; ++s) {
|
||||||
|
@ -77,9 +77,7 @@ bool RuleTrieLoader::Load(const std::vector<FactorType> &input,
|
|||||||
alignString = temp;
|
alignString = temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (++pipes) {
|
++pipes; // counts
|
||||||
StringPiece str(*pipes); //counts
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isLHSEmpty = (sourcePhraseString.find_first_not_of(" \t", 0) == std::string::npos);
|
bool isLHSEmpty = (sourcePhraseString.find_first_not_of(" \t", 0) == std::string::npos);
|
||||||
if (isLHSEmpty && !staticData.IsWordDeletionEnabled()) {
|
if (isLHSEmpty && !staticData.IsWordDeletionEnabled()) {
|
||||||
|
@ -135,8 +135,8 @@ TargetPhrase::TargetPhrase(const TargetPhrase ©)
|
|||||||
, m_scoreBreakdown(copy.m_scoreBreakdown)
|
, m_scoreBreakdown(copy.m_scoreBreakdown)
|
||||||
, m_alignTerm(copy.m_alignTerm)
|
, m_alignTerm(copy.m_alignTerm)
|
||||||
, m_alignNonTerm(copy.m_alignNonTerm)
|
, m_alignNonTerm(copy.m_alignNonTerm)
|
||||||
, m_properties(copy.m_properties)
|
|
||||||
, m_scope(copy.m_scope)
|
, m_scope(copy.m_scope)
|
||||||
|
, m_properties(copy.m_properties)
|
||||||
, m_container(copy.m_container)
|
, m_container(copy.m_container)
|
||||||
{
|
{
|
||||||
if (copy.m_lhsTarget) {
|
if (copy.m_lhsTarget) {
|
||||||
|
@ -173,7 +173,6 @@ TranslationOptionCollection::
|
|||||||
ProcessOneUnknownWord(const InputPath &inputPath, size_t sourcePos,
|
ProcessOneUnknownWord(const InputPath &inputPath, size_t sourcePos,
|
||||||
size_t length, const ScorePair *inputScores)
|
size_t length, const ScorePair *inputScores)
|
||||||
{
|
{
|
||||||
const StaticData &staticData = StaticData::Instance();
|
|
||||||
const UnknownWordPenaltyProducer&
|
const UnknownWordPenaltyProducer&
|
||||||
unknownWordPenaltyProducer = UnknownWordPenaltyProducer::Instance();
|
unknownWordPenaltyProducer = UnknownWordPenaltyProducer::Instance();
|
||||||
float unknownScore = FloorScore(TransformScore(0));
|
float unknownScore = FloorScore(TransformScore(0));
|
||||||
|
Loading…
Reference in New Issue
Block a user