#include <string>
#include <fstream>
#include "gzfilebuf.h"
#include "n_gram.h"
Go to the source code of this file.
Classes | |
class | inputfilestream |
Defines | |
#define | MAX(a, b) (((a)>(b))?(a):(b)) |
#define | MIN(a, b) (((a)<(b))?(a):(b)) |
#define | UNUSED(x) { (void) x; } |
#define | _DEBUG_LEVEL 2 |
#define | VERBOSE(level, str) { } |
#define | IFVERBOSE(level) { } |
#define | LMTMAXLEV 20 |
#define | MAX_LINE 100000 |
#define | UPPER_SINGLE_PRECISION_OF_0 0.000001 |
#define | UPPER_DOUBLE_PRECISION_OF_0 0.000000000001 |
#define | UPPER_SINGLE_PRECISION_OF_1 1.000001 |
#define | LOWER_SINGLE_PRECISION_OF_1 0.999999 |
#define | UPPER_DOUBLE_PRECISION_OF_1 1.000000000001 |
#define | LOWER_DOUBLE_PRECISION_OF_1 0.999999999999 |
Functions | |
std::string | gettempfolder () |
std::string | createtempName () |
void | createtempfile (mfstream &fileStream, std::string &filePath, std::ios_base::openmode flags) |
void | removefile (const std::string &filePath) |
void * | MMap (int fd, int access, off_t offset, size_t len, off_t *gap) |
int | Munmap (void *p, size_t len, int sync) |
void | ResetUserTime () |
void | PrintUserTime (const std::string &message) |
double | GetUserTime () |
int | parseWords (char *, const char **, int) |
int | parseline (istream &inp, int Order, ngram &ng, float &prob, float &bow) |
#define LOWER_DOUBLE_PRECISION_OF_1 0.999999999999 |
#define LOWER_SINGLE_PRECISION_OF_1 0.999999 |
Definition at line 45 of file util.h.
Referenced by mdiadaptlm::saveARPA_per_level(), mdiadaptlm::saveARPA_per_word(), mdiadaptlm::saveBIN_per_level(), mdiadaptlm::saveBIN_per_word(), and plsa::train().
#define UNUSED | ( | x | ) | { (void) x; } |
Definition at line 15 of file util.h.
Referenced by lmtable::appendbin_level_mmap(), lmContainer::clprob(), lmtable::dictionary_incflag(), lmContainer::dictionary_incflag(), lmmacro::filter(), lmContainer::init_caches(), lmContainer::is_inverted(), lmContainer::is_OOV(), lmContainer::load(), lmContainer::savebin(), lmContainer::savetxt(), lmContainer::setlogOOVpenalty(), and lmContainer::stat().
#define UPPER_DOUBLE_PRECISION_OF_1 1.000000000001 |
#define UPPER_SINGLE_PRECISION_OF_0 0.000001 |
Definition at line 42 of file util.h.
Referenced by mdiadaptlm::saveARPA_per_level(), mdiadaptlm::saveARPA_per_word(), mdiadaptlm::saveBIN_per_level(), and mdiadaptlm::saveBIN_per_word().
#define UPPER_SINGLE_PRECISION_OF_1 1.000001 |
Definition at line 44 of file util.h.
Referenced by mdiadaptlm::prob(), mdiadaptlm::saveARPA_per_level(), mdiadaptlm::saveARPA_per_word(), mdiadaptlm::saveBIN_per_level(), mdiadaptlm::saveBIN_per_word(), and plsa::train().
#define VERBOSE | ( | level, | |||
str | ) | { } |
void createtempfile | ( | mfstream & | fileStream, | |
std::string & | filePath, | |||
std::ios_base::openmode | flags | |||
) |
std::string createtempName | ( | ) |
Definition at line 58 of file util.cpp.
References gettempfolder().
Referenced by createtempfile().
std::string gettempfolder | ( | ) |
Definition at line 39 of file util.cpp.
References str.
Referenced by createtempName().
double GetUserTime | ( | ) |
Total wall time that the global timer has been in the "running" state since it was first "started".
Definition at line 26 of file Timer.cpp.
References Moses::g_timer, MosesTuning::Timer::get_elapsed_cpu_time(), Moses::Timer::get_elapsed_time(), and Timer::get_elapsed_time().
Referenced by Moses::Search::out_of_time().
void* MMap | ( | int | fd, | |
int | access, | |||
off_t | offset, | |||
size_t | len, | |||
off_t * | gap | |||
) |
Definition at line 144 of file util.cpp.
Referenced by lmtable::expand_level_mmap(), lmtable::reset_mmap(), and lmtable::resize_level_mmap().
int Munmap | ( | void * | p, | |
size_t | len, | |||
int | sync | |||
) |
Definition at line 194 of file util.cpp.
Referenced by lmtable::delete_level_mmap(), lmtable::reset_mmap(), lmtable::resize_level_mmap(), and lmtable::~lmtable().
int parseline | ( | istream & | inp, | |
int | Order, | |||
ngram & | ng, | |||
float & | prob, | |||
float & | bow | |||
) |
Definition at line 272 of file util.cpp.
References ngram::dict, LMTMAXLEV, MAX_LINE, dictionary::OOV(), parseWords(), ngram::pushw(), and ngram::size.
void PrintUserTime | ( | const std::string & | message | ) |
Print out an optional message followed by the current global timer timing.
Definition at line 21 of file Timer.cpp.
References MosesTuning::Timer::check(), Moses::Timer::check(), Timer::check(), and Moses::g_timer.
Referenced by batch_run(), Moses::PhraseDictionaryFuzzyMatch::InitializeForInput(), Moses::RuleTableLoaderStandard::Load(), Moses::RuleTableLoaderCompact::Load(), Moses::Syntax::T2S::RuleTrieLoader::Load(), Moses::Syntax::S2T::RuleTrieLoader::Load(), Moses::Syntax::F2S::HyperTreeLoader::Load(), main(), Moses::Manager::OutputBest(), Moses::ChartManager::OutputNBest(), and Moses::TranslationTask::Run().
void removefile | ( | const std::string & | filePath | ) |
Definition at line 87 of file util.cpp.
Referenced by lmtable::checkbounds(), lmtable::compact_single_level(), main(), lmtable::remove_single_level(), mdiadaptlm::saveARPA_per_word(), and lmtable::savebin_level_nommap().
void ResetUserTime | ( | ) |
Start global timer.
Definition at line 16 of file Timer.cpp.
References Moses::g_timer, MosesTuning::Timer::start(), Moses::Timer::start(), and Timer::start().
Referenced by batch_run(), decoder_main(), and main().