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 <list>
00024 #include <limits>
00025 #include <vector>
00026 #include <string>
00027 #include <stdint.h>
00028
00029 #include <boost/shared_ptr.hpp>
00030 #include <boost/weak_ptr.hpp>
00031
00033
00034
00035 namespace Moses
00036 {
00037
00038 #define PROJECT_NAME "moses"
00039
00040 #ifndef BOS_
00041 #define BOS_ "<s>" //Beginning of sentence symbol
00042 #endif
00043 #ifndef EOS_
00044 #define EOS_ "</s>" //End of sentence symbol
00045 #endif
00046
00047 #define UNKNOWN_FACTOR "UNK"
00048 #define EPSILON "*EPS*"
00049
00050 #define NOT_FOUND std::numeric_limits<size_t>::max()
00051 #define MAX_NGRAM_SIZE 20
00052
00053 const size_t DEFAULT_CUBE_PRUNING_POP_LIMIT = 1000;
00054 const size_t DEFAULT_CUBE_PRUNING_DIVERSITY = 0;
00055 const size_t DEFAULT_MAX_HYPOSTACK_SIZE = 200;
00056 const size_t DEFAULT_MAX_TRANS_OPT_CACHE_SIZE = 10000;
00057 const size_t DEFAULT_MAX_TRANS_OPT_SIZE = 5000;
00058 const size_t DEFAULT_MAX_PART_TRANS_OPT_SIZE = 10000;
00059
00060
00061
00062
00063 const size_t DEFAULT_MAX_PHRASE_LENGTH = 20;
00064
00065 const size_t DEFAULT_MAX_CHART_SPAN = 20;
00066 const size_t ARRAY_SIZE_INCR = 10;
00067 const float LOWEST_SCORE = -100.0f;
00068 const float DEFAULT_BEAM_WIDTH = 0.00001f;
00069 const float DEFAULT_EARLY_DISCARDING_THRESHOLD = 0.0f;
00070 const float DEFAULT_TRANSLATION_OPTION_THRESHOLD = 0.0f;
00071 const size_t DEFAULT_VERBOSE_LEVEL = 1;
00072
00073
00074 static const size_t PRECISION = 3;
00075
00076
00077 const float FLOAT_EPSILON = 0.0001;
00078
00079
00080
00081
00082
00083 const int NUM_LANGUAGES = 2;
00084
00085
00086
00087 enum FactorDirection {
00088 Input,
00089 Output
00090 };
00091
00092 enum DecodeType {
00093 Translate,
00094 Generate
00095 };
00096
00097 namespace LexReorderType
00098 {
00099 enum LexReorderType {
00100 Backward,
00101 Forward,
00102 Bidirectional,
00103 Fe,
00104 F
00105 };
00106 }
00107
00108 namespace DistortionOrientationType
00109 {
00110 enum DistortionOrientationOptions {
00111 Monotone,
00112 Msd
00113 };
00114 }
00115
00116 enum InputTypeEnum {
00117 SentenceInput = 0,
00118 ConfusionNetworkInput = 1,
00119 WordLatticeInput = 2,
00120 TreeInputType = 3,
00121
00122 TabbedSentenceInput = 5,
00123 ForestInputType = 6
00124 };
00125
00126 enum XmlInputType {
00127 XmlPassThrough = 0,
00128 XmlIgnore = 1,
00129 XmlExclusive = 2,
00130 XmlInclusive = 3,
00131 XmlConstraint = 4
00132 };
00133
00134 enum DictionaryFind {
00135 Best = 0,
00136 All = 1
00137 };
00138
00139
00140
00141
00142 enum SearchAlgorithm {
00143 Normal = 0,
00144 CubePruning = 1,
00145
00146 CYKPlus = 3,
00147
00148 ChartIncremental = 5,
00149 SyntaxS2T = 6,
00150 SyntaxT2S = 7,
00151 SyntaxT2S_SCFG = 8,
00152 SyntaxF2S = 9,
00153 DefaultSearchAlgorithm = 777
00154 };
00155
00156 enum SourceLabelOverlap {
00157 SourceLabelOverlapAdd = 0,
00158 SourceLabelOverlapReplace = 1,
00159 SourceLabelOverlapDiscard = 2
00160 };
00161
00162 enum WordAlignmentSort {
00163 NoSort = 0,
00164 TargetOrder = 1
00165 };
00166
00167 enum FormatType {
00168 MosesFormat,
00169 HieroFormat
00170 };
00171
00172 enum S2TParsingAlgorithm {
00173 RecursiveCYKPlus,
00174 Scope3
00175 };
00176
00177
00178 typedef size_t FactorType;
00179
00180 typedef std::vector<float> Scores;
00181 typedef std::vector<std::string> WordAlignments;
00182
00183 typedef std::vector<FactorType> FactorList;
00184
00185 typedef std::pair<std::vector<std::string const*>,WordAlignments > StringWordAlignmentCand;
00186
00187 class TranslationTask;
00188 typedef boost::shared_ptr<TranslationTask> ttasksptr;
00189 typedef boost::weak_ptr<TranslationTask> ttaskwptr;
00190 }
00191
00192 #define SPTR boost::shared_ptr
00193 #define WPTR boost::weak_ptr