Age | Commit message (Collapse) | Author | |
---|---|---|---|
2015-04-22 | Thread-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-22 | Support 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-22 | Add new files. | Jeroen Vermeulen | |
Oops. Forgot these in my previous commit. Sorry! | |||
2015-04-17 | Cross-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-17 | New 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-17 | Use 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-10 | Portability 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-28 | Modernize "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-25 | KenLM 240ea65a021574261a38d45eb68143f26ad177e5 | Kenneth Heafield | |
2015-01-22 | KenLM a6d57501dcac95a31719a8628f6cbd288f6741e2 including Marcin's fixed pruning | Kenneth Heafield | |
2014-11-20 | Merge branch 'master' of https://github.com/moses-smt/mosesdecoder | Ulrich Germann | |
Conflicts: moses-cmd/simulate-pe.cc | |||
2014-10-08 | KenLM 370f97fa549f02e162a3a0f17bf3ad6cce2c3813 | Kenneth Heafield | |
2014-09-10 | Fixed issues with ambiguity in typedef of uint64_t (conflict between boost ↵ | Ulrich Germann | |
typedef and stdint typedef). | |||
2014-07-22 | Fix fd leak noticed by Barry Haddow | Kenneth Heafield | |
2014-07-19 | D'ph forgot to copy util | Kenneth Heafield | |
2014-06-05 | KenLM f81d02792087a837ea17e6ce2b33f9b7aaecca68 should fix segfault with ↵ | Kenneth Heafield | |
ArrayTrie | |||
2014-06-02 | KenLM 5a7efd8fe1db88ee0a9f7e9479b24ac3ca348221 with Hieu's patch to exception.hh | Kenneth Heafield | |
2014-03-11 | Consolidated, consistent rt target fixes single-threaded build | Kenneth Heafield | |
2014-03-11 | Do not compile pcqueue_test for single-threaded builds | Kenneth Heafield | |
2014-01-31 | Fix progress bar for compressed files | Kenneth Heafield | |
2014-01-30 | Update read_compressed to support concatenated gzip | Kenneth Heafield | |
2014-01-28 | Fix C++11 compilation error / Chris Dyer | Kenneth Heafield | |
2014-01-28 | KenLM 5cc905bc2d214efa7de2db56a9a672b749a95591 | Kenneth 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-16 | SyntaxConstraintFeature (without any actual constraints; useful to ↵ | Rico Sennrich | |
build/output syntax tree from GHKM tree fragments) | |||
2014-01-15 | merged upstream with origin for mingw | jiejiang | |
2014-01-13 | get rid of all aborts | Hieu Hoang | |
2014-01-05 | delete check.hh | Hieu Hoang | |
2014-01-02 | KenLM 85c82bd, revamp Moses timer to have more precision | Kenneth Heafield | |
2013-12-19 | moses windows build, with some TODO list | jiejiang | |
2013-11-16 | replace CHECK with UTIL_THROW_IF. It's gonna be a fun week | Hieu Hoang | |
2013-11-15 | UTIL_THROW_IF2 with base Exception class | Hieu Hoang | |
2013-10-12 | Fix call_realloc double free | Kenneth Heafield | |
2013-09-09 | KenLM 6f7913cc7ca0f7672c6d899358365f047a742bbb | Kenneth Heafield | |
Mostly fixes from Tetsuo Kiso and Jonathan Graehl | |||
2013-06-24 | KenLM 6b4a1c7940a36026de1d96693ccb6ec0f16de8dc | Kenneth Heafield | |
2013-06-05 | librt only for single-threaded linux | Kenneth Heafield | |
2013-06-05 | librt for single threaded | Kenneth Heafield | |
2013-05-31 | request pulled in error | Hieu Hoang | |
2013-05-31 | Merge pull request #36 from lixiangnlp/patch-2 | Hieu Hoang | |
Swap for sized iterator | |||
2013-05-29 | beautify | Hieu Hoang | |
2013-05-29 | Tetsuo's two patches | Kenneth Heafield | |
2013-05-27 | delete slow version of FindStringPiece() \Ken | Hieu Hoang | |
2013-05-20 | rollback change 'cos Ken is hassling me | Hieu Hoang | |
2013-05-19 | compile 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-19 | Make 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-19 | KenLM 10ddf7d923355b35a7de9a5219673eca9e18be98 except Hieu's slow ↵ | Kenneth Heafield | |
string_piece_hash | |||
2013-05-17 | Swap for sized iterator | Xiang Li | |
2013-04-29 | merge | Hieu Hoang | |
2013-03-31 | OS X returns EINVAL for write > 2^31 | Kenneth Heafield | |
2013-03-19 | Accept concatenated bzip2 files | Kenneth Heafield | |
2013-01-24 | KenLM 31a6644 resizable probing hash table, build fixes | Kenneth Heafield | |