00001 // -*- mode: c++; indent-tabs-mode: nil; tab-width: 2 -*- 00002 #pragma once 00003 #include <string> 00004 #include "moses/Parameter.h" 00005 #include "OptionsBaseClass.h" 00006 namespace Moses 00007 { 00008 00009 bool is_syntax(SearchAlgorithm algo); 00010 00011 struct 00012 SearchOptions : public OptionsBaseClass 00013 { 00014 SearchAlgorithm algo; 00015 00016 // stack decoding 00017 size_t stack_size; // maxHypoStackSize; 00018 size_t stack_diversity; // minHypoStackDiversity; 00019 bool disable_discarding; 00020 // Disable discarding of bad hypotheses from HypothesisStackNormal 00021 size_t max_phrase_length; 00022 size_t max_trans_opt_per_cov; 00023 size_t max_partial_trans_opt; 00024 // beam search 00025 float beam_width; 00026 00027 int timeout; 00028 int segment_timeout; 00029 00030 bool consensus; 00031 00032 // reordering options 00033 // bool reorderingConstraint; //! use additional reordering constraints 00034 // bool useEarlyDistortionCost; 00035 00036 float early_discarding_threshold; 00037 float trans_opt_threshold; 00038 00039 bool init(Parameter const& param); 00040 SearchOptions(Parameter const& param); 00041 SearchOptions(); 00042 00043 bool 00044 UseEarlyDiscarding() const { 00045 return early_discarding_threshold != -std::numeric_limits<float>::infinity(); 00046 } 00047 00048 bool 00049 update(std::map<std::string,xmlrpc_c::value>const& params); 00050 00051 }; 00052 00053 }