diff options
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 + |