daily automatic beautifier

This commit is contained in:
MosesAdmin 2016-02-13 00:02:04 +00:00
parent 1659d6b4c8
commit ca5178b684
6 changed files with 22 additions and 22 deletions

View File

@ -97,9 +97,9 @@ FFState* TargetConstituentAdjacencyFeature::EvaluateWhenApplied(
if (const PhraseProperty *property = currTarPhr.GetProperty("TargetConstituentBoundariesLeft")) {
const TargetConstituentBoundariesLeftPhraseProperty *targetConstituentBoundariesLeftPhraseProperty =
const TargetConstituentBoundariesLeftPhraseProperty *targetConstituentBoundariesLeftPhraseProperty =
static_cast<const TargetConstituentBoundariesLeftPhraseProperty*>(property);
const TargetConstituentBoundariesLeftCollection& leftConstituentCollection =
const TargetConstituentBoundariesLeftCollection& leftConstituentCollection =
targetConstituentBoundariesLeftPhraseProperty->GetCollection();
float prob = 0;
size_t numMatch = 0;
@ -111,7 +111,7 @@ FFState* TargetConstituentAdjacencyFeature::EvaluateWhenApplied(
++numOverall;
FactorCollection &factorCollection = FactorCollection::Instance();
const Factor* bosFactor = factorCollection.AddFactor("BOS_",false);
TargetConstituentBoundariesLeftCollection::const_iterator found =
TargetConstituentBoundariesLeftCollection::const_iterator found =
leftConstituentCollection.find(bosFactor);
if ( found != leftConstituentCollection.end() ) {
++numMatch;
@ -149,13 +149,13 @@ FFState* TargetConstituentAdjacencyFeature::EvaluateWhenApplied(
newScores[0] += TransformScore( (float)numMatch/numOverall );
}
}
} else {
// abort with error message if the phrase does not translate an unknown word
UTIL_THROW_IF2(!currTarPhr.GetWord(0).IsOOV(), GetScoreProducerDescription()
<< ": Missing TargetConstituentBoundariesLeft property.");
++newScores[1];
}
@ -164,7 +164,7 @@ FFState* TargetConstituentAdjacencyFeature::EvaluateWhenApplied(
if (const PhraseProperty *property = currTarPhr.GetProperty("TargetConstituentBoundariesRightAdjacent")) {
const TargetConstituentBoundariesRightAdjacentPhraseProperty *targetConstituentBoundariesRightAdjacentPhraseProperty =
const TargetConstituentBoundariesRightAdjacentPhraseProperty *targetConstituentBoundariesRightAdjacentPhraseProperty =
static_cast<const TargetConstituentBoundariesRightAdjacentPhraseProperty*>(property);
const TargetConstituentBoundariesLeftCollection& rightAdjacentConstituentCollection = targetConstituentBoundariesRightAdjacentPhraseProperty->GetCollection();

View File

@ -27,10 +27,10 @@ void TargetConstituentBoundariesLeftPhraseProperty::ProcessValue(const std::stri
for ( std::vector<std::string>::iterator constituentIter = constituents.begin();
constituentIter != constituents.end(); ++constituentIter ) {
const Factor* constituentFactor = factorCollection.AddFactor(*constituentIter,false);
std::pair< std::set<const Factor* >::iterator, bool > dedupIns =
std::pair< std::set<const Factor* >::iterator, bool > dedupIns =
dedup.insert(constituentFactor);
if ( dedupIns.second ) {

View File

@ -8,14 +8,14 @@
namespace Moses
{
typedef std::map<const Factor*, float> TargetConstituentBoundariesLeftCollection;
class TargetConstituentBoundariesLeftPhraseProperty : public PhraseProperty
{
public:
TargetConstituentBoundariesLeftPhraseProperty()
TargetConstituentBoundariesLeftPhraseProperty()
{};
virtual void ProcessValue(const std::string &value);

View File

@ -27,10 +27,10 @@ void TargetConstituentBoundariesRightAdjacentPhraseProperty::ProcessValue(const
for ( std::vector<std::string>::iterator constituentIter = constituents.begin();
constituentIter != constituents.end(); ++constituentIter ) {
const Factor* constituentFactor = factorCollection.AddFactor(*constituentIter,false);
std::pair< std::set<const Factor* >::iterator, bool > dedupIns =
std::pair< std::set<const Factor* >::iterator, bool > dedupIns =
dedup.insert(constituentFactor);
if ( dedupIns.second ) {

View File

@ -8,14 +8,14 @@
namespace Moses
{
typedef std::map<const Factor*, float> TargetConstituentBoundariesRightAdjacentCollection;
class TargetConstituentBoundariesRightAdjacentPhraseProperty : public PhraseProperty
{
public:
TargetConstituentBoundariesRightAdjacentPhraseProperty()
TargetConstituentBoundariesRightAdjacentPhraseProperty()
{};
virtual void ProcessValue(const std::string &value);

View File

@ -303,7 +303,7 @@ int main(int argc, char* argv[])
SentenceAlignmentWithSyntax sentence
(targetLabelCollection, sourceLabelCollection,
targetTopLabelCollection, sourceTopLabelCollection,
targetTopLabelCollection, sourceTopLabelCollection,
targetSyntax, false);
// cout << "read in: " << englishString << " & " << foreignString << " & " << alignmentString << endl;
//az: output src, tgt, and alingment line
@ -740,11 +740,11 @@ string getOrientString(REO_POS orient, REO_MODEL_TYPE modelType)
}
return "";
}
bool ExtractTask::checkTargetConstituentBoundaries( const SentenceAlignmentWithSyntax &sentence,
int startE, int endE, int startF, int endF,
std::string &phrasePropertiesString)
int startE, int endE, int startF, int endF,
std::string &phrasePropertiesString)
{
ostringstream outextractstrPhrasePropertyTargetConstituentBoundariesLeft;
@ -814,8 +814,8 @@ bool ExtractTask::checkTargetConstituentBoundaries( const SentenceAlignmentWithS
if ( (relaxedStartE != startE) || (relaxedEndE !=endE) ) {
const std::vector< SyntaxNode* >& startingNodes = sentence.targetTree.GetNodesByStartPosition(relaxedStartE);
for ( std::vector< SyntaxNode* >::const_reverse_iterator iter = startingNodes.rbegin();
(iter != startingNodes.rend() && !relaxedValidTargetConstituentBoundaries);
for ( std::vector< SyntaxNode* >::const_reverse_iterator iter = startingNodes.rbegin();
(iter != startingNodes.rend() && !relaxedValidTargetConstituentBoundaries);
++iter ) {
if ( (*iter)->end == relaxedEndE ) {
relaxedValidTargetConstituentBoundaries = true;
@ -868,8 +868,8 @@ bool ExtractTask::checkTargetConstituentBoundaries( const SentenceAlignmentWithS
}
void ExtractTask::addPhrase( const SentenceAlignmentWithSyntax &sentence,
int startE, int endE, int startF, int endF,
void ExtractTask::addPhrase( const SentenceAlignmentWithSyntax &sentence,
int startE, int endE, int startF, int endF,
const std::string &orientationInfo,
const std::string &phrasePropertiesString)
{