Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/util
AgeCommit message (Collapse)Author
2015-04-22Thread-safe, platform-agnostic randomizer.Jeroen Vermeulen
Some places in mert use srandom()/random(), but these are POSIX-specific. The standard alternative, srand()/rand(), is not thread-safe. This module wraps srand()/rand() in mutexes (very short-lived, so should not cost much) so that it relies on just Boost and the C standard library, not on a Unix-like environment. This may reduce the width of the random numbers on some platforms: it goes from "long int" to just "int". If that is a problem, we may have to use Boost's randomizer utilities, or eventually, the C++ ones.
2015-04-22Support tokenize(const std::string &) as well.Jeroen Vermeulen
Convenience wrapper: the actual function takes a const char[], but many of the call sites want to pass a string and have to call its c_str() first.
2015-04-22Add new files.Jeroen Vermeulen
Oops. Forgot these in my previous commit. Sorry!
2015-04-17Cross-platform tempfile implementation.Jeroen Vermeulen
This makes temp_file and temp_dir work both on POSIX-like platforms and on Windows. It also fixes a bug where the temporary files/directories were created in the current working directory, instead of in the system's standard location for temporary files. Unfortunately the Windows and POSIX code diverge quite a bit on that point.
2015-04-17New helper classes: temp_dir & temp_file.Jeroen Vermeulen
I'm adding these because boost::filesystem::unique_path introduces encoding issues: on Windows the path is in wchar_t, breaking use of those strings in various places! Encoding the strings is just too much work. It's still possible that the current temp_file implementation won't build on Windows (it uses POSIX mkstemp() and close()) but that can be fixed underneath the API.
2015-04-17Use cross-platform mmap() wrapper in CompactPT.Jeroen Vermeulen
The MmapAllocator header made use of sys/mman.h and mmap(), which are Unix-specific. But util has a wrapper which also works on Windows. This also fixes the error handling: when mmap() failed, the old code would return an invalid (but non-NULL!) pointer — leading to a crash. The wrapper will throw an exception with a helpful error message.
2015-04-10Portability and include fixes.Jeroen Vermeulen
Add <cstdlib> include for srand()/rand(), and <unistd.h> for open() etc. Include <unistd.h> on Windows if using MinGW. Disable MeteorScorer on Windows, since it doesn't have fork() and pipe().
2015-03-28Modernize "C" includes in util.Jeroen Vermeulen
This is one of those little chores in managing a long-lived C++ project: standard C headers like stdio.h and math.h now have their own place in the C++ standard as resp. cstdio, cmath, and so on. In this branch the #include names are updated for the util/ subdirectory; more branches to follow. C++11 adds cstdint, but to support compilation with the previous standard, that change is left for later.
2015-03-25KenLM 240ea65a021574261a38d45eb68143f26ad177e5Kenneth Heafield
2015-01-22KenLM a6d57501dcac95a31719a8628f6cbd288f6741e2 including Marcin's fixed pruningKenneth Heafield
2014-11-20Merge branch 'master' of https://github.com/moses-smt/mosesdecoderUlrich Germann
Conflicts: moses-cmd/simulate-pe.cc
2014-10-08KenLM 370f97fa549f02e162a3a0f17bf3ad6cce2c3813Kenneth Heafield
2014-09-10Fixed issues with ambiguity in typedef of uint64_t (conflict between boost ↵Ulrich Germann
typedef and stdint typedef).
2014-07-22Fix fd leak noticed by Barry HaddowKenneth Heafield
2014-07-19D'ph forgot to copy utilKenneth Heafield
2014-06-05KenLM f81d02792087a837ea17e6ce2b33f9b7aaecca68 should fix segfault with ↵Kenneth Heafield
ArrayTrie
2014-06-02KenLM 5a7efd8fe1db88ee0a9f7e9479b24ac3ca348221 with Hieu's patch to exception.hhKenneth Heafield
2014-03-11Consolidated, consistent rt target fixes single-threaded buildKenneth Heafield
2014-03-11Do not compile pcqueue_test for single-threaded buildsKenneth Heafield
2014-01-31Fix progress bar for compressed filesKenneth Heafield
2014-01-30Update read_compressed to support concatenated gzipKenneth Heafield
2014-01-28Fix C++11 compilation error / Chris DyerKenneth Heafield
2014-01-28KenLM 5cc905bc2d214efa7de2db56a9a672b749a95591Kenneth Heafield
Avoid unspecified behavior of mmap when a file is resized reported by Christian Hardmeier Fixes for Mavericks and a workaround for Boost's broken semaphore Clean clang compile (of kenlm) Merged some of 744376b3fbebc41c4a270bf549826d5eb9219ae0 but also undid some of it because it was just masking a fundaemntal problem with pread rather than working around windows limitations
2014-01-16SyntaxConstraintFeature (without any actual constraints; useful to ↵Rico Sennrich
build/output syntax tree from GHKM tree fragments)
2014-01-15merged upstream with origin for mingwjiejiang
2014-01-13get rid of all abortsHieu Hoang
2014-01-05delete check.hhHieu Hoang
2014-01-02KenLM 85c82bd, revamp Moses timer to have more precisionKenneth Heafield
2013-12-19moses windows build, with some TODO listjiejiang
2013-11-16replace CHECK with UTIL_THROW_IF. It's gonna be a fun weekHieu Hoang
2013-11-15UTIL_THROW_IF2 with base Exception classHieu Hoang
2013-10-12Fix call_realloc double freeKenneth Heafield
2013-09-09KenLM 6f7913cc7ca0f7672c6d899358365f047a742bbbKenneth Heafield
Mostly fixes from Tetsuo Kiso and Jonathan Graehl
2013-06-24KenLM 6b4a1c7940a36026de1d96693ccb6ec0f16de8dcKenneth Heafield
2013-06-05librt only for single-threaded linuxKenneth Heafield
2013-06-05librt for single threadedKenneth Heafield
2013-05-31request pulled in errorHieu Hoang
2013-05-31Merge pull request #36 from lixiangnlp/patch-2Hieu Hoang
Swap for sized iterator
2013-05-29beautifyHieu Hoang
2013-05-29Tetsuo's two patchesKenneth Heafield
2013-05-27delete slow version of FindStringPiece() \KenHieu Hoang
2013-05-20rollback change 'cos Ken is hassling meHieu Hoang
2013-05-19compile error on mac osx. Just #ifdef for now, but should use Boost or ↵Hieu Hoang
something to make it cross-platform. It keeps happening
2013-05-19Make a slow code path for std::set FindStringPiece. I had fixed sparse ↵Kenneth Heafield
features to use hash tables. But Hieu reverted this and kludged FindStringPiece to be slow. This change returns my code to being fast and leaves the performance problem to Hieu/Eva.
2013-05-19KenLM 10ddf7d923355b35a7de9a5219673eca9e18be98 except Hieu's slow ↵Kenneth Heafield
string_piece_hash
2013-05-17Swap for sized iteratorXiang Li
2013-04-29mergeHieu Hoang
2013-03-31OS X returns EINVAL for write > 2^31Kenneth Heafield
2013-03-19Accept concatenated bzip2 filesKenneth Heafield
2013-01-24KenLM 31a6644 resizable probing hash table, build fixesKenneth Heafield