<commit_before>#include "linearedgedb.h"
#include "../dfs.h"
#include "../annotationsearch.h"

#include <fstream>
#include <set>
#include <limits>

#include <boost/archive/binary_oarchive.hpp>
#include <boost/archive/binary_iarchive.hpp>
#include <boost/serialization/map.hpp>
#include <boost/serialization/string.hpp>
#include <boost/serialization/vector.hpp>

#include <boost/format.hpp>
#include <humblelogging/api.h>

HUMBLE_LOGGER(logger, "annis4");

using namespace annis;
using namespace std;

LinearEdgeDB::LinearEdgeDB(StringStorage& strings, const Component& component)
{
}

void LinearEdgeDB::clear()
{
  edgeAnno.clear();
  node2pos.clear();
  nodeChains.clear();
}

void LinearEdgeDB::copy(const DB& db, const ReadableGraphStorage& orig)
{
  // find all root nodes
  set<nodeid_t> roots;

  // add all nodes to root list
  AnnotationNameSearch nodes(db, annis_ns, annis_node_name);

  while(nodes.hasNext())
  {
    nodeid_t n = nodes.next().node;
    roots.insert(n);
  }

  nodes.reset();
  while(nodes.hasNext())
  {
    nodeid_t source = nodes.next().node;


    std::vector<nodeid_t> outEdges = orig.getOutgoingEdges(source);
    for(auto target : outEdges)<commit_msg>only add the nodes as root candidate which are part of the component<commit_after>#include "linearedgedb.h"
#include "../dfs.h"
#include "../annotationsearch.h"

#include <fstream>
#include <set>
#include <limits>

#include <boost/archive/binary_oarchive.hpp>
#include <boost/archive/binary_iarchive.hpp>
#include <boost/serialization/map.hpp>
#include <boost/serialization/string.hpp>
#include <boost/serialization/vector.hpp>

#include <boost/format.hpp>
#include <humblelogging/api.h>

HUMBLE_LOGGER(logger, "annis4");

using namespace annis;
using namespace std;

LinearEdgeDB::LinearEdgeDB(StringStorage& strings, const Component& component)
{
}

void LinearEdgeDB::clear()
{
  edgeAnno.clear();
  node2pos.clear();
  nodeChains.clear();
}

void LinearEdgeDB::copy(const DB& db, const ReadableGraphStorage& orig)
{
  // find all root nodes
  set<nodeid_t> roots;

  // add all nodes to root list
  AnnotationNameSearch nodes(db, annis_ns, annis_node_name);

  while(nodes.hasNext())
  {
    nodeid_t n = nodes.next().node;
    // insert all nodes to the root candidate list which are part of this component
    if(!orig.getOutgoingEdges(n).empty())
    {
      roots.insert(n);
    }
  }

  nodes.reset();
  while(nodes.hasNext())
  {
    nodeid_t source = nodes.next().node;

    std::vector<nodeid_t> outEdges = orig.getOutgoingEdges(source);
    for(auto target : outEdges)
{'fraction_non_alphanumeric': 0.13746105919003115, 'fraction_numerical': 0.001557632398753894, 'mean_word_length': 4.708888888888889, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1859675', 'n_tokens_mistral': 899, 'n_tokens_neox': 882, 'n_words': 192}