diff options
author | philblunsom@gmail.com <philblunsom@gmail.com@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-06-28 15:01:17 +0000 |
---|---|---|
committer | philblunsom@gmail.com <philblunsom@gmail.com@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-06-28 15:01:17 +0000 |
commit | 1d089b02eff4fa8837faecf99021f624d8845e5d (patch) | |
tree | b6e3d20094514749c37485e154117871cdc8696f /gi/pyp-topics/src/corpus.cc | |
parent | 088725c4708e83343154d1bed9dee18286446eaf (diff) |
Added contexts_corpus for reading text data files.
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@36 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'gi/pyp-topics/src/corpus.cc')
-rw-r--r-- | gi/pyp-topics/src/corpus.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gi/pyp-topics/src/corpus.cc b/gi/pyp-topics/src/corpus.cc index 93910ea3..24b93a03 100644 --- a/gi/pyp-topics/src/corpus.cc +++ b/gi/pyp-topics/src/corpus.cc @@ -22,7 +22,7 @@ unsigned Corpus::read(const std::string &filename) { string buf; int token; - unsigned count=0; + unsigned doc_count=0; while (getline(in, buf)) { Document* doc(new Document()); istringstream ss(buf); @@ -39,14 +39,15 @@ unsigned Corpus::read(const std::string &filename) { } m_documents.push_back(doc); - count++; + doc_count++; } m_num_types = seen_types.size(); - return count; + return doc_count; } + ////////////////////////////////////////////////// // TestCorpus ////////////////////////////////////////////////// |