From 06f1b6aedbd96d652d5337cf1b93b51e4dd9a620 Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Wed, 4 Mar 2015 21:36:51 -0500 Subject: remove perfect hash function stuff, add zip option to extract.cc --- utils/phmt.cc | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 utils/phmt.cc (limited to 'utils/phmt.cc') 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 -#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 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 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 - -- cgit v1.2.3