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