00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef moses_TypeDef_h
00021 #define moses_TypeDef_h
00022
00023 #include <list>
00024 #include <limits>
00025 #include <vector>
00026 #include <string>
00027
00028 #ifdef WIN32
00029 #include <BaseTsd.h>
00030 #else
00031 #include <stdint.h>
00032 typedef uint32_t UINT32;
00033 typedef uint64_t UINT64;
00034 #endif
00035
00036 namespace Moses
00037 {
00038
00039 #define PROJECT_NAME "moses"
00040
00041 #ifndef BOS_
00042 #define BOS_ "<s>" //Beginning of sentence symbol
00043 #endif
00044 #ifndef EOS_
00045 #define EOS_ "</s>" //End of sentence symbol
00046 #endif
00047
00048 #define UNKNOWN_FACTOR "UNK"
00049 #define EPSILON "*EPS*"
00050
00051 #define NOT_FOUND std::numeric_limits<size_t>::max()
00052 #define MAX_NGRAM_SIZE 20
00053
00054 const size_t DEFAULT_CUBE_PRUNING_POP_LIMIT = 1000;
00055 const size_t DEFAULT_CUBE_PRUNING_DIVERSITY = 0;
00056 const size_t DEFAULT_MAX_HYPOSTACK_SIZE = 200;
00057 const size_t DEFAULT_MAX_TRANS_OPT_CACHE_SIZE = 10000;
00058 const size_t DEFAULT_MAX_TRANS_OPT_SIZE = 5000;
00059 const size_t DEFAULT_MAX_PART_TRANS_OPT_SIZE = 10000;
00060 const size_t DEFAULT_MAX_PHRASE_LENGTH = 20;
00061 const size_t DEFAULT_MAX_CHART_SPAN = 10;
00062 const size_t ARRAY_SIZE_INCR = 10;
00063 const float LOWEST_SCORE = -100.0f;
00064 const float DEFAULT_BEAM_WIDTH = 0.00001f;
00065 const float DEFAULT_EARLY_DISCARDING_THRESHOLD = 0.0f;
00066 const float DEFAULT_TRANSLATION_OPTION_THRESHOLD = 0.0f;
00067 const size_t DEFAULT_VERBOSE_LEVEL = 1;
00068
00069
00070
00071
00072
00073 const int NUM_LANGUAGES = 2;
00074
00075 const size_t MAX_NUM_FACTORS = 4;
00076
00077 enum FactorDirection {
00078 Input,
00079 Output
00080 };
00081
00082 enum DecodeType {
00083 Translate
00084 ,Generate
00085 ,InsertNullFertilityWord
00086 };
00087
00088 namespace LexReorderType
00089 {
00090 enum LexReorderType {
00091 Backward
00092 ,Forward
00093 ,Bidirectional
00094 ,Fe
00095 ,F
00096 };
00097 }
00098
00099 namespace DistortionOrientationType
00100 {
00101 enum DistortionOrientationOptions {
00102 Monotone,
00103 Msd
00104 };
00105 }
00106
00107 enum LMType {
00108 SingleFactor
00109 ,MultiFactor
00110 };
00111 enum LMImplementation {
00112 SRI = 0
00113 ,IRST = 1
00114
00115 ,Joint = 3
00116
00117 ,RandLM = 5
00118 ,Remote = 6
00119 ,ParallelBackoff = 7
00120 ,Ken = 8
00121 ,LazyKen = 9
00122 ,ORLM = 10
00123 ,DMapLM = 11
00124 };
00125
00126 enum PhraseTableImplementation {
00127 Memory = 0
00128 ,Binary = 1
00129 ,OnDisk = 2
00130
00131
00132
00133 ,SCFG = 6
00134
00135 ,SuffixArray = 8
00136 ,Hiero = 9
00137 ,ALSuffixArray = 10
00138 };
00139
00140 enum InputTypeEnum {
00141 SentenceInput = 0
00142 ,ConfusionNetworkInput = 1
00143 ,WordLatticeInput = 2
00144 ,TreeInputType = 3
00145 ,WordLatticeInput2 = 4
00146
00147 };
00148
00149 enum XmlInputType {
00150 XmlPassThrough = 0,
00151 XmlIgnore = 1,
00152 XmlExclusive = 2,
00153 XmlInclusive = 3
00154 };
00155
00156 enum DictionaryFind {
00157 Best = 0
00158 ,All = 1
00159 };
00160
00161 enum ParsingAlgorithm {
00162 ParseCYKPlus = 0,
00163 ParseScope3 = 1
00164 };
00165
00166 enum SearchAlgorithm {
00167 Normal = 0
00168 ,CubePruning = 1
00169 ,CubeGrowing = 2
00170 ,ChartDecoding= 3
00171 };
00172
00173 enum SourceLabelOverlap {
00174 SourceLabelOverlapAdd = 0
00175 ,SourceLabelOverlapReplace = 1
00176 ,SourceLabelOverlapDiscard = 2
00177 };
00178
00179 enum WordAlignmentSort {
00180 NoSort = 0
00181 ,TargetOrder = 1
00182 };
00183
00184
00185 typedef size_t FactorType;
00186
00187 typedef std::vector<float> Scores;
00188 typedef std::vector<std::string> WordAlignments;
00189
00190 typedef std::vector<FactorType> FactorList;
00191
00192 typedef std::pair<std::vector<std::string const*>,Scores > StringTgtCand;
00193 typedef std::pair<std::vector<std::string const*>,WordAlignments > StringWordAlignmentCand;
00194
00195 }
00196 #endif