Skip to content

Commit

Permalink
use astyle 2.01. It's on Edinburgh server and doesn't screw up enum
Browse files Browse the repository at this point in the history
  • Loading branch information
hieuhoang committed Jan 14, 2015
1 parent 05ead45 commit 6d61db2
Show file tree
Hide file tree
Showing 22 changed files with 59 additions and 59 deletions.
2 changes: 1 addition & 1 deletion mert/HopeFearDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class HopeFearDecoder

/** Max score decoding */
virtual void MaxModel(const AvgWeightVector& wv, std::vector<ValType>* stats)
= 0;
= 0;

/** Calculate bleu on training set */
ValType Evaluate(const AvgWeightVector& wv);
Expand Down
2 changes: 1 addition & 1 deletion misc/queryPhraseTableMin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ int main(int argc, char **argv)
sourcePhrase.CreateFromString(Input, input, line, NULL);

TargetPhraseVectorPtr decodedPhraseColl
= pdc.GetTargetPhraseCollectionRaw(sourcePhrase);
= pdc.GetTargetPhraseCollectionRaw(sourcePhrase);

if(decodedPhraseColl != NULL) {
if(reportCounts)
Expand Down
6 changes: 3 additions & 3 deletions moses/ConfusionNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,11 @@ ConfusionNet::
CreateTranslationOptionCollection() const
{
size_t maxNoTransOptPerCoverage
= StaticData::Instance().GetMaxNoTransOptPerCoverage();
= StaticData::Instance().GetMaxNoTransOptPerCoverage();
float translationOptionThreshold
= StaticData::Instance().GetTranslationOptionThreshold();
= StaticData::Instance().GetTranslationOptionThreshold();
TranslationOptionCollection *rv
= new TranslationOptionCollectionConfusionNet
= new TranslationOptionCollectionConfusionNet
(*this, maxNoTransOptPerCoverage, translationOptionThreshold);
assert(rv);
return rv;
Expand Down
2 changes: 1 addition & 1 deletion moses/DecodeStepTranslation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ void DecodeStepTranslation::ProcessLEGACY(const TranslationOption &inputPartialT
const size_t tableLimit = phraseDictionary->GetTableLimit();

const TargetPhraseCollectionWithSourcePhrase *phraseColl
= phraseDictionary->GetTargetPhraseCollectionLEGACY(toc->GetSource(),sourceWordsRange);
= phraseDictionary->GetTargetPhraseCollectionLEGACY(toc->GetSource(),sourceWordsRange);


if (phraseColl != NULL) {
Expand Down
2 changes: 1 addition & 1 deletion moses/FF/LexicalReordering/SparseReordering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ void SparseReordering::AddFeatures(
for (size_t id = 0; id < clusterMaps->size(); ++id) {
const ClusterMap& clusterMap = (*clusterMaps)[id];
boost::unordered_map<const Factor*, const Factor*>::const_iterator clusterIter
= clusterMap.second.find(wordFactor);
= clusterMap.second.find(wordFactor);
if (clusterIter != clusterMap.second.end()) {
SparseReorderingFeatureKey key(id, type, clusterIter->second, true, position, side, reoType);
FeatureMap::const_iterator fmi = m_featureMap.find(key);
Expand Down
4 changes: 2 additions & 2 deletions moses/FF/SoftSourceSyntacticConstraintsFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ void SoftSourceSyntacticConstraintsFeature::EvaluateWithSourceContext(const Inpu
prevTreeInputLabelsIt != prevTreeInputLabels.end(); ++prevTreeInputLabelsIt) {
if (*prevTreeInputLabelsIt != outputDefaultNonTerminal) {
boost::unordered_map<const Factor*,size_t>::const_iterator foundPrevTreeInputLabel
= m_sourceLabelIndexesByFactor.find((*prevTreeInputLabelsIt)[0]);
= m_sourceLabelIndexesByFactor.find((*prevTreeInputLabelsIt)[0]);
if (foundPrevTreeInputLabel != m_sourceLabelIndexesByFactor.end()) {
size_t prevTreeInputLabelIndex = foundPrevTreeInputLabel->second;
treeInputLabelsRHS[nonTerminalNumber].insert(prevTreeInputLabelIndex);
Expand All @@ -334,7 +334,7 @@ void SoftSourceSyntacticConstraintsFeature::EvaluateWithSourceContext(const Inpu
treeInputLabelsIt != treeInputLabels.end(); ++treeInputLabelsIt) {
if (*treeInputLabelsIt != outputDefaultNonTerminal) {
boost::unordered_map<const Factor*,size_t>::const_iterator foundTreeInputLabel
= m_sourceLabelIndexesByFactor.find((*treeInputLabelsIt)[0]);
= m_sourceLabelIndexesByFactor.find((*treeInputLabelsIt)[0]);
if (foundTreeInputLabel != m_sourceLabelIndexesByFactor.end()) {
size_t treeInputLabelIndex = foundTreeInputLabel->second;
treeInputLabelsLHS.insert(treeInputLabelIndex);
Expand Down
4 changes: 2 additions & 2 deletions moses/FF/VW/ThreadLocalByFeatureStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ThreadLocalByFeatureStorage
m_nameMap.reset(new NameValueMap());

typename NameValueMap::iterator it
= m_nameMap->find(m_ff->GetScoreProducerDescription());
= m_nameMap->find(m_ff->GetScoreProducerDescription());

if(it == m_nameMap->end()) {
std::pair<typename NameValueMap::iterator, bool> ret;
Expand All @@ -60,7 +60,7 @@ class ThreadLocalByFeatureStorage
<< m_ff->GetScoreProducerDescription());

typename NameValueMap::const_iterator it
= m_nameMap->find(m_ff->GetScoreProducerDescription());
= m_nameMap->find(m_ff->GetScoreProducerDescription());

UTIL_THROW_IF2(it == m_nameMap->end(),
"No features stored for: "
Expand Down
2 changes: 1 addition & 1 deletion moses/LVoc.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class LVoc
}
LabelId add(const Key& k) {
std::pair<typename M::iterator,bool> p
=m.insert(std::make_pair(k,data.size()));
=m.insert(std::make_pair(k,data.size()));
if(p.second) data.push_back(k);
assert(static_cast<size_t>(p.first->second)<data.size());
return p.first->second;
Expand Down
4 changes: 2 additions & 2 deletions moses/StaticData.h
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ class StaticData
return false;
}
std::map< std::string, std::set< std::string > >::const_iterator lookupIgnoreFF
= m_weightSettingIgnoreFF.find( m_currentWeightSetting );
= m_weightSettingIgnoreFF.find( m_currentWeightSetting );
if (lookupIgnoreFF == m_weightSettingIgnoreFF.end()) {
return false;
}
Expand All @@ -680,7 +680,7 @@ class StaticData
return false;
}
std::map< std::string, std::set< size_t > >::const_iterator lookupIgnoreDP
= m_weightSettingIgnoreDP.find( m_currentWeightSetting );
= m_weightSettingIgnoreDP.find( m_currentWeightSetting );
if (lookupIgnoreDP == m_weightSettingIgnoreDP.end()) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,12 @@ void ChartRuleLookupManagerOnDisk::GetChartRuleCollection(

std::vector<float> weightT = staticData.GetWeights(&m_dictionary);
targetPhraseCollection
= tpcollBerkeleyDb->ConvertToMoses(m_inputFactorsVec
,m_outputFactorsVec
,m_dictionary
,weightT
,m_dbWrapper.GetVocab()
,true);
= tpcollBerkeleyDb->ConvertToMoses(m_inputFactorsVec
,m_outputFactorsVec
,m_dictionary
,weightT
,m_dbWrapper.GetVocab()
,true);

delete tpcollBerkeleyDb;
m_cache[tpCollFilePos] = targetPhraseCollection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ void CompressionTaskReordering::operator()()
while(scoresNum < m_encodedScores.size()) {
std::string scores = m_encodedScores[scoresNum];
std::string compressedScores
= m_creator.CompressEncodedScores(scores);
= m_creator.CompressEncodedScores(scores);

std::string dummy;
PackedItem packedItem(scoresNum, dummy, compressedScores, 0);
Expand Down
6 changes: 3 additions & 3 deletions moses/TranslationModel/CompactPT/PhraseDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ PhraseDecoder::~PhraseDecoder()
inline unsigned PhraseDecoder::GetSourceSymbolId(std::string& symbol)
{
boost::unordered_map<std::string, unsigned>::iterator it
= m_sourceSymbolsMap.find(symbol);
= m_sourceSymbolsMap.find(symbol);
if(it != m_sourceSymbolsMap.end())
return it->second;

Expand Down Expand Up @@ -200,7 +200,7 @@ TargetPhraseVectorPtr PhraseDecoder::CreateTargetPhraseCollection(const Phrase &

if(m_coding == PREnc) {
std::pair<TargetPhraseVectorPtr, size_t> cachedPhraseColl
= m_decodingCache.Retrieve(sourcePhrase);
= m_decodingCache.Retrieve(sourcePhrase);

// Has been cached and is complete or does not need to be completed
if(cachedPhraseColl.first != NULL && (!topLevel || cachedPhraseColl.second == 0))
Expand Down Expand Up @@ -255,7 +255,7 @@ TargetPhraseVectorPtr PhraseDecoder::DecodeCollection(
if(m_coding == REnc) {
for(size_t i = 0; i < sourcePhrase.GetSize(); i++) {
std::string sourceWord
= sourcePhrase.GetWord(i).GetString(*m_input, false);
= sourcePhrase.GetWord(i).GetString(*m_input, false);
unsigned idx = GetSourceSymbolId(sourceWord);
sourceWords.push_back(idx);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ PhraseDictionaryCompact::GetTargetPhraseCollectionNonCacheLEGACY(const Phrase &s

// Retrieve target phrase collection from phrase table
TargetPhraseVectorPtr decodedPhraseColl
= m_phraseDecoder->CreateTargetPhraseCollection(sourcePhrase, true, true);
= m_phraseDecoder->CreateTargetPhraseCollection(sourcePhrase, true, true);

if(decodedPhraseColl != NULL && decodedPhraseColl->size()) {
TargetPhraseVectorPtr tpv(new TargetPhraseVector(*decodedPhraseColl));
Expand Down
8 changes: 4 additions & 4 deletions moses/TranslationModel/CompactPT/PhraseTableCreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ void PhraseTableCreator::AddTargetSymbolId(std::string& symbol)
unsigned PhraseTableCreator::GetSourceSymbolId(std::string& symbol)
{
boost::unordered_map<std::string, unsigned>::iterator it
= m_sourceSymbolsMap.find(symbol);
= m_sourceSymbolsMap.find(symbol);

if(it != m_sourceSymbolsMap.end())
return it->second;
Expand All @@ -437,7 +437,7 @@ unsigned PhraseTableCreator::GetSourceSymbolId(std::string& symbol)
unsigned PhraseTableCreator::GetTargetSymbolId(std::string& symbol)
{
boost::unordered_map<std::string, unsigned>::iterator it
= m_targetSymbolsMap.find(symbol);
= m_targetSymbolsMap.find(symbol);

if(it != m_targetSymbolsMap.end())
return it->second;
Expand All @@ -451,7 +451,7 @@ unsigned PhraseTableCreator::GetOrAddTargetSymbolId(std::string& symbol)
boost::mutex::scoped_lock lock(m_mutex);
#endif
boost::unordered_map<std::string, unsigned>::iterator it
= m_targetSymbolsMap.find(symbol);
= m_targetSymbolsMap.find(symbol);

if(it != m_targetSymbolsMap.end())
return it->second;
Expand Down Expand Up @@ -1218,7 +1218,7 @@ void CompressionTask::operator()()
while(collectionNum < m_encodedCollections.size()) {
std::string collection = m_encodedCollections[collectionNum];
std::string compressedCollection
= m_creator.CompressEncodedCollection(collection);
= m_creator.CompressEncodedCollection(collection);

std::string dummy;
PackedItem packedItem(collectionNum, dummy, compressedCollection, 0);
Expand Down
2 changes: 1 addition & 1 deletion moses/TranslationModel/CompactPT/PhraseTableCreator.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class Counter
return data;
else {
typename std::vector<DataType>::iterator it
= std::lower_bound(m_bestVec.begin(), m_bestVec.end(), data);
= std::lower_bound(m_bestVec.begin(), m_bestVec.end(), data);
if(it != m_bestVec.end())
return *it;
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ const TargetPhraseCollection *PhraseDictionaryOnDisk::GetTargetPhraseCollectionN

const OnDiskPt::TargetPhraseCollection *targetPhrasesOnDisk = ptNode->GetTargetPhraseCollection(m_tableLimit, wrapper);
TargetPhraseCollection *targetPhrases
= targetPhrasesOnDisk->ConvertToMoses(m_input, m_output, *this, weightT, vocab, false);
= targetPhrasesOnDisk->ConvertToMoses(m_input, m_output, *this, weightT, vocab, false);

delete targetPhrasesOnDisk;

Expand Down
28 changes: 14 additions & 14 deletions moses/TypeDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ enum DistortionOrientationOptions {

enum InputTypeEnum {
SentenceInput = 0
,ConfusionNetworkInput = 1
,WordLatticeInput = 2
,TreeInputType = 3
,WordLatticeInput2 = 4
, TabbedSentenceInput = 5
,ConfusionNetworkInput = 1
,WordLatticeInput = 2
,TreeInputType = 3
,WordLatticeInput2 = 4
, TabbedSentenceInput = 5

};

Expand All @@ -137,27 +137,27 @@ enum XmlInputType {

enum DictionaryFind {
Best = 0
,All = 1
,All = 1
};

enum SearchAlgorithm {
Normal = 0
,CubePruning = 1
//,CubeGrowing = 2
,CYKPlus = 3
,NormalBatch = 4
,ChartIncremental = 5
,CubePruning = 1
//,CubeGrowing = 2
,CYKPlus = 3
,NormalBatch = 4
,ChartIncremental = 5
};

enum SourceLabelOverlap {
SourceLabelOverlapAdd = 0
,SourceLabelOverlapReplace = 1
,SourceLabelOverlapDiscard = 2
,SourceLabelOverlapReplace = 1
,SourceLabelOverlapDiscard = 2
};

enum WordAlignmentSort {
NoSort = 0
,TargetOrder = 1
,TargetOrder = 1
};

enum FormatType {
Expand Down
4 changes: 2 additions & 2 deletions phrase-extract/extract-ghkm/PhraseOrientation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ void PhraseOrientation::InsertPhraseVertices(HSentenceVertices & topLeft,
const std::string PhraseOrientation::GetOrientationInfoString(int startF, int endF, REO_DIR direction) const
{
boost::unordered_map< std::pair<int,int> , std::pair<int,int> >::const_iterator foundMinMax
= m_minAndMaxAlignedToSourceSpan.find( std::pair<int,int>(startF,endF) );
= m_minAndMaxAlignedToSourceSpan.find( std::pair<int,int>(startF,endF) );

if ( foundMinMax != m_minAndMaxAlignedToSourceSpan.end() ) {
int startE = (foundMinMax->second).first;
Expand Down Expand Up @@ -261,7 +261,7 @@ const std::string PhraseOrientation::GetOrientationInfoString(int startF, int st
PhraseOrientation::REO_CLASS PhraseOrientation::GetOrientationInfo(int startF, int endF, REO_DIR direction) const
{
boost::unordered_map< std::pair<int,int> , std::pair<int,int> >::const_iterator foundMinMax
= m_minAndMaxAlignedToSourceSpan.find( std::pair<int,int>(startF,endF) );
= m_minAndMaxAlignedToSourceSpan.find( std::pair<int,int>(startF,endF) );

if ( foundMinMax != m_minAndMaxAlignedToSourceSpan.end() ) {
int startE = (foundMinMax->second).first;
Expand Down
6 changes: 3 additions & 3 deletions phrase-extract/extract-mixed-syntax/pugixml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2633,11 +2633,11 @@ class xml_buffered_writer
enum {
bufcapacitybytes =
#ifdef PUGIXML_MEMORY_OUTPUT_STACK
PUGIXML_MEMORY_OUTPUT_STACK
PUGIXML_MEMORY_OUTPUT_STACK
#else
10240
10240
#endif
,
,
bufcapacity = bufcapacitybytes / (sizeof(char_t) + 4)
};

Expand Down
4 changes: 2 additions & 2 deletions phrase-extract/relax-parse-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void LeftBinarize( SyntaxTree &tree, ParentNodes &parents )
const SplitPoints &point = *p;
if (point.size() > 3) {
const vector< SyntaxNode* >& topNodes
= tree.GetNodes( point[0], point[point.size()-1]-1);
= tree.GetNodes( point[0], point[point.size()-1]-1);
string topLabel = topNodes[0]->GetLabel();

for(size_t i=2; i<point.size()-1; i++) {
Expand All @@ -149,7 +149,7 @@ void RightBinarize( SyntaxTree &tree, ParentNodes &parents )
if (point.size() > 3) {
int endPoint = point[point.size()-1]-1;
const vector< SyntaxNode* >& topNodes
= tree.GetNodes( point[0], endPoint);
= tree.GetNodes( point[0], endPoint);
string topLabel = topNodes[0]->GetLabel();

for(size_t i=1; i<point.size()-2; i++) {
Expand Down
4 changes: 2 additions & 2 deletions scripts/other/beautify.perl
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
chomp($version);
print STDERR "version=$version";

if ($version ne "Artistic Style Version 2.03") {
print STDERR "\nMust be astyle version 2.03. Quitting\n";
if ($version ne "Artistic Style Version 2.01") {
print STDERR "\nMust be astyle version 2.01. Quitting\n";
exit(1);
}

Expand Down
10 changes: 5 additions & 5 deletions symal/cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ extern "C" {
#endif

#if defined(__STDC__)
int DeclareParams(char *, ...);
int DeclareParams(char *, ...);
#else
int DeclareParams();
int DeclareParams();
#endif

int GetParams(int *n, char ***a,char *CmdFileName),
SPrintParams(),
PrintParams();
int GetParams(int *n, char ***a,char *CmdFileName),
SPrintParams(),
PrintParams();

#ifdef __cplusplus
}
Expand Down

0 comments on commit 6d61db2

Please sign in to comment.