diff options
author | Patrick Simianer <p@simianer.de> | 2011-08-03 01:29:52 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2011-09-23 19:13:57 +0200 |
commit | 2e605eb2745e56619b16fdbcb8095e0a6543ab27 (patch) | |
tree | 03c122c3add26365eb8f3f84aec2a533d7222cab /dtrain/util.cc | |
parent | b7568a8dad2720d5ea0418171e9b85229adbbcc5 (diff) |
refactoring, cleaning up
Diffstat (limited to 'dtrain/util.cc')
-rw-r--r-- | dtrain/util.cc | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/dtrain/util.cc b/dtrain/util.cc new file mode 100644 index 00000000..7b3bbe3d --- /dev/null +++ b/dtrain/util.cc @@ -0,0 +1,34 @@ +#include "util.h" + + +namespace dtrain +{ + + +/* + * register_and_convert + * + */ +void +register_and_convert(const vector<string>& strs, vector<WordID>& ids) +{ + vector<string>::const_iterator it; + for ( it = strs.begin(); it < strs.end(); it++ ) { + ids.push_back( TD::Convert( *it ) ); + } +} + + +/* + * print_FD + * + */ +void +print_FD() +{ + for ( size_t i = 0; i < FD::NumFeats(); i++ ) cout << FD::Convert(i)<< endl; +} + + +} // namespace + |