mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-26 05:14:36 +03:00
mira
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/branches/mira-mtm5@3435 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
parent
6b79f5ee6d
commit
6ee89748f6
@ -138,6 +138,11 @@ int main(int argc, char* argv[])
|
||||
while((line = ioWrapper->GetInput()) != "")
|
||||
{
|
||||
line += "\n";
|
||||
//if ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
ReadInput(*ioWrapper,staticData.GetInputType(),source, line);
|
||||
|
||||
StaticData &ss = StaticData::InstanceNonConst();
|
||||
|
@ -7,6 +7,8 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
1E059677123FB1E900D39289 /* OnlineCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E059675123FB1E900D39289 /* OnlineCommand.cpp */; };
|
||||
1E059678123FB1E900D39289 /* OnlineCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E059676123FB1E900D39289 /* OnlineCommand.h */; };
|
||||
1E5D8E0411F25F03000F027F /* PhraseDictionaryNodeSCFG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E5D8E0211F25F03000F027F /* PhraseDictionaryNodeSCFG.cpp */; };
|
||||
1E5D8E0511F25F03000F027F /* PhraseDictionaryNodeSCFG.h in Headers */ = {isa = PBXBuildFile; fileRef = 1E5D8E0311F25F03000F027F /* PhraseDictionaryNodeSCFG.h */; };
|
||||
1E5D8E0811F25F2F000F027F /* PhraseDictionarySCFG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E5D8E0611F25F2F000F027F /* PhraseDictionarySCFG.cpp */; };
|
||||
@ -224,6 +226,8 @@
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
1E059675123FB1E900D39289 /* OnlineCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OnlineCommand.cpp; path = src/OnlineCommand.cpp; sourceTree = "<group>"; };
|
||||
1E059676123FB1E900D39289 /* OnlineCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OnlineCommand.h; path = src/OnlineCommand.h; sourceTree = "<group>"; };
|
||||
1E5D8E0211F25F03000F027F /* PhraseDictionaryNodeSCFG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PhraseDictionaryNodeSCFG.cpp; path = src/PhraseDictionaryNodeSCFG.cpp; sourceTree = "<group>"; };
|
||||
1E5D8E0311F25F03000F027F /* PhraseDictionaryNodeSCFG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PhraseDictionaryNodeSCFG.h; path = src/PhraseDictionaryNodeSCFG.h; sourceTree = "<group>"; };
|
||||
1E5D8E0611F25F2F000F027F /* PhraseDictionarySCFG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PhraseDictionarySCFG.cpp; path = src/PhraseDictionarySCFG.cpp; sourceTree = "<group>"; };
|
||||
@ -467,6 +471,8 @@
|
||||
08FB7795FE84155DC02AAC07 /* Source */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1E059675123FB1E900D39289 /* OnlineCommand.cpp */,
|
||||
1E059676123FB1E900D39289 /* OnlineCommand.h */,
|
||||
1ED4FC5F11BDC0D2004E826A /* AlignmentInfo.cpp */,
|
||||
1ED4FC6011BDC0D2004E826A /* AlignmentInfo.h */,
|
||||
1ED4FC6111BDC0D2004E826A /* BilingualDynSuffixArray.cpp */,
|
||||
@ -830,6 +836,7 @@
|
||||
1EF549B612118A4A00C481EB /* LanguageModelDelegate.h in Headers */,
|
||||
1EF549BA12118A5D00C481EB /* TranslationSystem.h in Headers */,
|
||||
1E7739D1123F646800B88EB7 /* FeatureVector.h in Headers */,
|
||||
1E059678123FB1E900D39289 /* OnlineCommand.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -977,6 +984,7 @@
|
||||
1EF549B112118A0C00C481EB /* DecodeFeature.cpp in Sources */,
|
||||
1EF549B912118A5D00C481EB /* TranslationSystem.cpp in Sources */,
|
||||
1E7739D0123F646800B88EB7 /* FeatureVector.cpp in Sources */,
|
||||
1E059677123FB1E900D39289 /* OnlineCommand.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -82,7 +82,8 @@ void OnlineCommand::Execute() const
|
||||
{
|
||||
std::cerr << "void OnlineCommand::Execute() const" << std::endl;
|
||||
VERBOSE(3,"OnlineCommand::Execute() const" << std::endl);
|
||||
StaticData &staticData = (StaticData&) StaticData::Instance();
|
||||
|
||||
StaticData &staticData = StaticData::InstanceNonConst();
|
||||
|
||||
VERBOSE(1,"Handling online command: " << COMMAND_KEYWORD << " " << command_type << " " << command_value << std::endl);
|
||||
// weights
|
||||
|
@ -542,7 +542,11 @@ public:
|
||||
bool ContinuePartialTranslation() const { return m_continuePartialTranslation; }
|
||||
|
||||
void ReLoadParameter();
|
||||
|
||||
Parameter* GetParameter()
|
||||
{
|
||||
return m_parameter;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -350,6 +350,33 @@ double GetUserTime();
|
||||
// dump SGML parser for <seg> tags
|
||||
std::map<std::string, std::string> ProcessAndStripSGML(std::string &line);
|
||||
|
||||
/**
|
||||
* Returns the first string bounded by the delimiters (default delimiters are " " and "\t")i starting from position first_pos
|
||||
* and and stores the starting position of the next string (in first_str)
|
||||
*/
|
||||
inline std::string GetFirstString(const std::string& str, int& first_pos, const std::string& delimiters = " \t")
|
||||
{
|
||||
|
||||
std::string first_str;
|
||||
// Skip delimiters at beginning.
|
||||
std::string::size_type lastPos = str.find_first_not_of(delimiters, first_pos);
|
||||
|
||||
// Find first "non-delimiter".
|
||||
std::string::size_type pos = str.find_first_of(delimiters, lastPos);
|
||||
|
||||
if (std::string::npos != pos || std::string::npos != lastPos){
|
||||
|
||||
first_str = str.substr(lastPos, pos - lastPos);
|
||||
|
||||
// Skip delimiters. Note the "not_of"
|
||||
lastPos = str.find_first_not_of(delimiters, pos);
|
||||
|
||||
}
|
||||
|
||||
first_pos = lastPos;
|
||||
return first_str;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user