00001 #include "moses/PP/OrientationPhraseProperty.h" 00002 #include <iostream> 00003 00004 00005 namespace Moses 00006 { 00007 00008 void OrientationPhraseProperty::ProcessValue(const std::string &value) 00009 { 00010 // bidirectional MSLR phrase orientation with 2x4 orientation classes: 00011 // mono swap dleft dright 00012 00013 std::istringstream tokenizer(value); 00014 00015 try { 00016 if (! (tokenizer >> m_l2rMonoProbability >> m_l2rSwapProbability >> m_l2rDleftProbability >> m_l2rDrightProbability 00017 >> m_r2lMonoProbability >> m_r2lSwapProbability >> m_r2lDleftProbability >> m_r2lDrightProbability)) { 00018 UTIL_THROW2("OrientationPhraseProperty: Not able to read value. Flawed property?"); 00019 } 00020 } catch (const std::exception &e) { 00021 UTIL_THROW2("OrientationPhraseProperty: Read error. Flawed property?"); 00022 } 00023 }; 00024 00025 } // namespace Moses 00026