00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #pragma once
00022
00023 #include <string>
00024 #include <map>
00025 #include <vector>
00026
00027 #include "OutputFileStream.h"
00028
00029
00030 namespace MosesTraining
00031 {
00032
00033 class PropertiesConsolidator
00034 {
00035 public:
00036
00037 PropertiesConsolidator()
00038 : m_sourceLabelsFlag(false)
00039 , m_partsOfSpeechFlag(false)
00040 , m_targetSyntacticPreferencesFlag(false)
00041 {};
00042
00043 void ActivateSourceLabelsProcessing(const std::string &sourceLabelSetFile);
00044 void ActivatePartsOfSpeechProcessing(const std::string &partsOfSpeechFile);
00045 void ActivateTargetSyntacticPreferencesProcessing(const std::string &targetSyntacticPreferencesLabelSetFile);
00046
00047 bool GetPOSPropertyValueFromPropertiesString(const std::string &propertiesString, std::vector<std::string>& out) const;
00048
00049 void ProcessPropertiesString(const std::string &propertiesString, Moses::OutputFileStream& out) const;
00050
00051 protected:
00052
00053 void ProcessSourceLabelsPropertyValue(const std::string &value, Moses::OutputFileStream& out) const;
00054 void ProcessPOSPropertyValue(const std::string &value, Moses::OutputFileStream& out) const;
00055 void ProcessTargetSyntacticPreferencesPropertyValue(const std::string &value, Moses::OutputFileStream& out) const;
00056
00057 bool m_sourceLabelsFlag;
00058 std::map<std::string,size_t> m_sourceLabels;
00059 bool m_partsOfSpeechFlag;
00060 std::map<std::string,size_t> m_partsOfSpeechVocabulary;
00061 bool m_targetSyntacticPreferencesFlag;
00062 std::map<std::string,size_t> m_targetSyntacticPreferencesLabels;
00063
00064 };
00065
00066 }
00067