diff options
author | Chris Dyer <redpony@gmail.com> | 2015-04-02 00:50:04 -0400 |
---|---|---|
committer | Chris Dyer <redpony@gmail.com> | 2015-04-02 00:50:04 -0400 |
commit | 5ee02ce1602f2fce6d5af5db93c2278fe6c9ede5 (patch) | |
tree | 7ebad8dd99e38d190c579f425c3eb959363e96e5 /utils/phmt.cc | |
parent | e7d77de8a9b9929b22fc6562f88f3668900f9662 (diff) | |
parent | 737ed7a7f932b1a7e40d2755bcdee6bc0aa2de63 (diff) |
Merge pull request #70 from redpony/cmake
Cmake
Diffstat (limited to 'utils/phmt.cc')
-rw-r--r-- | utils/phmt.cc | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/utils/phmt.cc b/utils/phmt.cc deleted file mode 100644 index b17febf6..00000000 --- a/utils/phmt.cc +++ /dev/null @@ -1,42 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifndef HAVE_CMPH -int main() { - return 0; -} -#else - -#include <iostream> -#include "weights.h" -#include "fdict.h" - -using namespace std; - -int main(int argc, char** argv) { - if (argc != 2) { cerr << "Usage: " << argv[0] << " file.mphf\n"; return 1; } - FD::EnableHash(argv[1]); - cerr << "Number of keys: " << FD::NumFeats() << endl; - cerr << "LexFE = " << FD::Convert("LexFE") << endl; - cerr << "LexEF = " << FD::Convert("LexEF") << endl; - { - vector<weight_t> v(FD::NumFeats()); - v[FD::Convert("LexFE")] = 1.0; - v[FD::Convert("LexEF")] = 0.5; - cerr << "Writing...\n"; - Weights::WriteToFile("weights.bin", v); - cerr << "Done.\n"; - } - { - vector<weight_t> v(FD::NumFeats()); - cerr << "Reading...\n"; - Weights::InitFromFile("weights.bin", &v); - cerr << "Done.\n"; - assert(v[FD::Convert("LexFE")] == 1.0); - assert(v[FD::Convert("LexEF")] == 0.5); - } -} - -#endif - |