|
|
|
#pragma once |
|
#include <string> |
|
#include <limits> |
|
#include "OptionsBaseClass.h" |
|
#include "../TypeDef.h" |
|
|
|
namespace Moses2 |
|
{ |
|
|
|
bool is_syntax(SearchAlgorithm algo); |
|
|
|
struct |
|
SearchOptions : public OptionsBaseClass { |
|
SearchAlgorithm algo; |
|
|
|
|
|
size_t stack_size; |
|
size_t stack_diversity; |
|
bool disable_discarding; |
|
|
|
size_t max_phrase_length; |
|
size_t max_trans_opt_per_cov; |
|
size_t max_partial_trans_opt; |
|
|
|
float beam_width; |
|
|
|
int timeout; |
|
|
|
bool consensus; |
|
|
|
|
|
|
|
|
|
|
|
float early_discarding_threshold; |
|
float trans_opt_threshold; |
|
|
|
bool init(Parameter const& param); |
|
SearchOptions(Parameter const& param); |
|
SearchOptions(); |
|
|
|
bool |
|
UseEarlyDiscarding() const { |
|
return early_discarding_threshold != -std::numeric_limits<float>::infinity(); |
|
} |
|
|
|
bool |
|
update(std::map<std::string,xmlrpc_c::value>const& params); |
|
|
|
}; |
|
|
|
} |
|
|