Skip to content
Snippets Groups Projects
Commit 708b5372 authored by Paweł Kędzia's avatar Paweł Kędzia
Browse files

Fix poliqarpcorpusreader/poliqarpdocumentreader

parent 8d39b84d
Branches
No related merge requests found
...@@ -17,7 +17,10 @@ boost::shared_ptr<Corpus> PoliqarpCorpusReader::read(const std::string& corpus_f ...@@ -17,7 +17,10 @@ boost::shared_ptr<Corpus> PoliqarpCorpusReader::read(const std::string& corpus_f
this->pq_doc_reader_ = boost::shared_ptr<PoliqarpDocumentReader>( this->pq_doc_reader_ = boost::shared_ptr<PoliqarpDocumentReader>(
new PoliqarpDocumentReader(tagset_, corpus_file)); new PoliqarpDocumentReader(tagset_, corpus_file));
while ((doc = this->pq_doc_reader_->read())) { while (1) {
if (!(doc = this->pq_doc_reader_->read())) {
break;
}
corpus->add_document(doc); corpus->add_document(doc);
} }
......
...@@ -12,9 +12,11 @@ PoliqarpDocumentReader::PoliqarpDocumentReader(const Tagset& tagset, const std:: ...@@ -12,9 +12,11 @@ PoliqarpDocumentReader::PoliqarpDocumentReader(const Tagset& tagset, const std::
boost::shared_ptr<Document> PoliqarpDocumentReader::read() boost::shared_ptr<Document> PoliqarpDocumentReader::read()
{ {
boost::shared_ptr<Document> document = boost::make_shared<Document>(); boost::shared_ptr<Document> document;
boost::shared_ptr<Chunk> chunk = this->pqr_->get_next_chunk(); boost::shared_ptr<Chunk> chunk = this->pqr_->get_next_chunk();
if (chunk) { if (chunk) {
document = boost::make_shared<Document>();
document->add_paragraph(chunk); document->add_paragraph(chunk);
} }
return document; return document;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment