Closed pebbe closed 12 years ago
DbCorpusReader::contents() returns an empty string.
Simple file to test:
#include <AlpinoCorpus/CorpusReader.hh> #include <AlpinoCorpus/CorpusReaderFactory.hh> #include <iostream> int main(int argc, char *argv[]) { if (argc != 2) { std::cerr << "Usage: " << argv[0] << " corpusfile.dact" << std::endl; return 1; } alpinocorpus::CorpusReader *r = alpinocorpus::CorpusReaderFactory::open(argv[1]); for (alpinocorpus::CorpusReader::EntryIterator i = r->query(alpinocorpus::CorpusReader::XPATH, "//node[@root=\"fiets\"]"); i != r->end(); i++) std::cout << *i << "\t" << i.contents(*r) << std::endl; return 0; }
This is not a bug. A node does not have a string value. Use e.g. //node[@root=\"fiets\"]/@word .
DbCorpusReader::contents() returns an empty string.
Simple file to test: