mosesdecoder/contrib/other-builds/moses2/MorphoTrie/utils.h
Hieu Hoang d163c37674 add LM
2015-10-30 10:41:55 +00:00

25 lines
567 B
C++

#include "MorphTrie.h"
#include <fstream>
#include <ostream>
#include <string>
#include <vector>
#include "moses/Util.h"
#include "moses/Factor.h"
#include "moses/InputFileStream.h"
using namespace std;
inline void ParseLineByChar(string& line, char c, vector<string>& substrings) {
size_t i = 0;
size_t j = line.find(c);
while (j != string::npos) {
substrings.push_back(line.substr(i, j-i));
i = ++j;
j = line.find(c, j);
if (j == string::npos)
substrings.push_back(line.substr(i, line.length()));
}
}