5 #ifndef JODA_ATTRIBUTEJACCARD_H
6 #define JODA_ATTRIBUTEJACCARD_H
9 #include <rapidjson/istreamwrapper.h>
10 #include "../../../../src/RJAttributeReader.h"
24 getAttributes(lhs, prefix, paths);
30 rapidjson::Reader reader;
31 rapidjson::StringStream stream(lhs.c_str());
32 reader.Parse(stream, handler);
38 rapidjson::IStreamWrapper &lhs) {
40 rapidjson::Reader reader;
41 reader.Parse(lhs, handler);
49 for (
const auto &m : doc.GetObject()) {
50 set.insert(m.name.GetString());
51 if (m.value.IsObject() || m.value.IsArray()) {
52 getAttributes(m.value, prefix, set);
55 }
else if (doc.IsArray()) {
56 for (
const auto &item : doc.GetArray()) {
57 if (item.IsObject() || item.IsArray()) {
58 getAttributes(item, prefix, set);
rapidjson::GenericDocument< RJChar, RJMemoryPoolAlloc, RJBaseAlloc > RJDocument
Definition: RJFwd.h:28
rapidjson::GenericValue< RJChar, RJMemoryPoolAlloc > RJValue
Definition: RJFwd.h:29
Definition: AttributeJaccard.h:69
double measure(const RJDocument &lhs, const RJDocument &rhs) override
Definition: AttributeJaccard.cpp:9
Definition: IJSONSimilarityMeasure.h:24
Definition: RJAttributeReader.h:15
const std::set< std::string > & getAttributes() const
Definition: RJAttributeReader.cpp:50
void clear()
Definition: RJAttributeReader.cpp:54
RJAttributeReader handler
Definition: AttributeJaccard.h:18
static void getAttributes(const RJValue &doc, std::string &prefix, Representation &set)
Definition: AttributeJaccard.h:46
const Representation getRepresentation(const RJDocument &lhs) const
Definition: AttributeJaccard.h:21
std::set< std::string > Representation
Definition: AttributeJaccard.h:19
const Representation getRepresentation(rapidjson::IStreamWrapper &lhs)
Definition: AttributeJaccard.h:37
const Representation getRepresentation(const std::string &lhs)
Definition: AttributeJaccard.h:28
Definition: IJSONSimilarityMeasure.h:36
bool is_implemented
Definition: IJSONSimilarityMeasure.h:56