本文整理汇总了C++中Sentence::ReadLine方法的典型用法代码示例。如果您正苦于以下问题:C++ Sentence::ReadLine方法的具体用法?C++ Sentence::ReadLine怎么用?C++ Sentence::ReadLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sentence
的用法示例。
在下文中一共展示了Sentence::ReadLine方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readWordFile
void readWordFile(string filePath)
{
ifstream in(filePath.c_str());
int sentenceId, wordNo, wordId;
SentenceLine sentenceline;
int lastSentenceId = 1;
while (in>>sentenceId>>wordNo>>wordId)
{
if (sentenceId!=lastSentenceId&&sentenceId>1)
{
Sentence s;
s.ReadLine(sentenceline);
if (sentenceId-lastSentenceId>1) // some files the sentenceId is not continous, treat it as zero length sentence
{
for (int i=0; i<sentenceId-lastSentenceId-1; i++)
{
Sentence tmp;
AppendSentence(tmp);
}
}
AppendSentence(s); //note that byte is zero, need to correct and Combine Step
sentenceline.clear();
lastSentenceId= sentenceId;
}
sentenceline.push_back(wordId);
}
Sentence s;
s.ReadLine(sentenceline);
AppendSentence(s);
in.close();
}