00001 #pragma once
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include <string>
00023 #include <vector>
00024
00025 namespace MosesTraining
00026 {
00027 enum REO_MODEL_TYPE {REO_MSD, REO_MSLR, REO_MONO};
00028 enum REO_POS {LEFT, RIGHT, DLEFT, DRIGHT, UNKNOWN};
00029
00030
00031 class PhraseExtractionOptions
00032 {
00033
00034 public:
00035 int maxPhraseLength;
00036 int minPhraseLength;
00037 std::string separator;
00038
00039 private:
00040 bool allModelsOutputFlag;
00041 bool wordModel;
00042 REO_MODEL_TYPE wordType;
00043 bool phraseModel;
00044 REO_MODEL_TYPE phraseType;
00045 bool hierModel;
00046 REO_MODEL_TYPE hierType;
00047 bool orientationFlag;
00048 bool translationFlag;
00049 bool includeSentenceIdFlag;
00050 bool onlyOutputSpanInfo;
00051 bool gzOutput;
00052 std::string instanceWeightsFile;
00053 bool targetConstituentConstrainedFlag;
00054 bool targetConstituentBoundariesFlag;
00055 bool flexScoreFlag;
00056 bool singleWordHeuristicFlag;
00057
00058 public:
00059 std::vector<std::string> placeholders;
00060 bool debug;
00061
00062 PhraseExtractionOptions(const int initmaxPhraseLength):
00063 maxPhraseLength(initmaxPhraseLength),
00064 minPhraseLength(3),
00065 separator("|||"),
00066 allModelsOutputFlag(false),
00067 wordModel(false),
00068 wordType(REO_MSD),
00069 phraseModel(false),
00070 phraseType(REO_MSD),
00071 hierModel(false),
00072 hierType(REO_MSD),
00073 orientationFlag(false),
00074 translationFlag(true),
00075 includeSentenceIdFlag(false),
00076 onlyOutputSpanInfo(false),
00077 gzOutput(false),
00078 targetConstituentConstrainedFlag(false),
00079 targetConstituentBoundariesFlag(false),
00080 flexScoreFlag(false),
00081 singleWordHeuristicFlag(false),
00082 debug(false) {
00083 }
00084
00085
00086 void initAllModelsOutputFlag(const bool initallModelsOutputFlag) {
00087 allModelsOutputFlag=initallModelsOutputFlag;
00088 }
00089 void initWordModel(const bool initwordModel) {
00090 wordModel=initwordModel;
00091 }
00092 void initWordType(REO_MODEL_TYPE initwordType ) {
00093 wordType=initwordType;
00094 }
00095 void initPhraseModel(const bool initphraseModel ) {
00096 phraseModel=initphraseModel;
00097 }
00098 void initPhraseType(REO_MODEL_TYPE initphraseType) {
00099 phraseType=initphraseType;
00100 }
00101 void initHierModel(const bool inithierModel) {
00102 hierModel=inithierModel;
00103 }
00104 void initHierType(REO_MODEL_TYPE inithierType) {
00105 hierType=inithierType;
00106 }
00107 void initOrientationFlag(const bool initorientationFlag) {
00108 orientationFlag=initorientationFlag;
00109 }
00110 void initTranslationFlag(const bool inittranslationFlag) {
00111 translationFlag=inittranslationFlag;
00112 }
00113 void initIncludeSentenceIdFlag(const bool initincludeSentenceIdFlag) {
00114 includeSentenceIdFlag=initincludeSentenceIdFlag;
00115 }
00116 void initOnlyOutputSpanInfo(const bool initonlyOutputSpanInfo) {
00117 onlyOutputSpanInfo= initonlyOutputSpanInfo;
00118 }
00119 void initGzOutput (const bool initgzOutput) {
00120 gzOutput= initgzOutput;
00121 }
00122 void initInstanceWeightsFile(const char* initInstanceWeightsFile) {
00123 instanceWeightsFile = std::string(initInstanceWeightsFile);
00124 }
00125 void initTargetConstituentConstrainedFlag(const bool initTargetConstituentConstrainedFlag) {
00126 targetConstituentConstrainedFlag = initTargetConstituentConstrainedFlag;
00127 }
00128 void initTargetConstituentBoundariesFlag(const bool initTargetConstituentBoundariesFlag) {
00129 targetConstituentBoundariesFlag = initTargetConstituentBoundariesFlag;
00130 }
00131 void initFlexScoreFlag(const bool initflexScoreFlag) {
00132 flexScoreFlag=initflexScoreFlag;
00133 }
00134 void initSingleWordHeuristicFlag(const bool initSingleWordHeuristicFlag) {
00135 singleWordHeuristicFlag = initSingleWordHeuristicFlag;
00136 }
00137
00138
00139 bool isAllModelsOutputFlag() const {
00140 return allModelsOutputFlag;
00141 }
00142 bool isWordModel() const {
00143 return wordModel;
00144 }
00145 REO_MODEL_TYPE isWordType() const {
00146 return wordType;
00147 }
00148 bool isPhraseModel() const {
00149 return phraseModel;
00150 }
00151 REO_MODEL_TYPE isPhraseType() const {
00152 return phraseType;
00153 }
00154 bool isHierModel() const {
00155 return hierModel;
00156 }
00157 REO_MODEL_TYPE isHierType() const {
00158 return hierType;
00159 }
00160 bool isOrientationFlag() const {
00161 return orientationFlag;
00162 }
00163 bool isTranslationFlag() const {
00164 return translationFlag;
00165 }
00166 bool isIncludeSentenceIdFlag() const {
00167 return includeSentenceIdFlag;
00168 }
00169 bool isOnlyOutputSpanInfo() const {
00170 return onlyOutputSpanInfo;
00171 }
00172 bool isGzOutput () const {
00173 return gzOutput;
00174 }
00175 std::string getInstanceWeightsFile() const {
00176 return instanceWeightsFile;
00177 }
00178 bool isTargetConstituentConstrainedFlag() const {
00179 return targetConstituentConstrainedFlag;
00180 }
00181 bool isTargetConstituentBoundariesFlag() const {
00182 return targetConstituentBoundariesFlag;
00183 }
00184 bool isFlexScoreFlag() const {
00185 return flexScoreFlag;
00186 }
00187 bool isSingleWordHeuristicFlag() const {
00188 return singleWordHeuristicFlag;
00189 }
00190 };
00191
00192 }
00193