/
DbCorpusReader.cpp
66 lines (51 loc) · 1.55 KB
/
DbCorpusReader.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
* Oracle Berkeley DB XML-based treebank reader.
* Written by Lars Buitinck.
*
* The basic format is explained in the header. An additional notes:
* - We use DBML_WELL_FORMED_ONLY to prevent having to read the DTD.
* This only works because the DTD does not define entities.
*/
#include <list>
#include <string>
#include <AlpinoCorpus/CorpusReader.hh>
#include <AlpinoCorpus/DbCorpusReader.hh>
#include "DbCorpusReaderPrivate.hh"
namespace alpinocorpus {
DbCorpusReader::DbCorpusReader(std::string const &name) :
d_private(new DbCorpusReaderPrivate(name))
{
}
DbCorpusReader::~DbCorpusReader()
{
delete d_private;
}
CorpusReader::EntryIterator DbCorpusReader::getEntries(SortOrder sortOrder) const
{
return d_private->getEntries(sortOrder);
}
std::string DbCorpusReader::getName() const
{
return d_private->getName();
}
size_t DbCorpusReader::getSize() const
{
return d_private->getSize();
}
Either<std::string, Empty> DbCorpusReader::validQuery(QueryDialect d, bool variables, std::string const &query) const
{
return d_private->isValidQuery(d, variables, query);
}
std::string DbCorpusReader::readEntry(std::string const &entry) const
{
return d_private->readEntry(entry);
}
CorpusReader::EntryIterator DbCorpusReader::runXPath(std::string const &query, SortOrder sortOrder) const
{
return d_private->runXPath(query, sortOrder);
}
CorpusReader::EntryIterator DbCorpusReader::runXQuery(std::string const &query, SortOrder sortOrder) const
{
return d_private->runXQuery(query, sortOrder);
}
} // namespace alpinocorpus