<commit_before>/** Copyright 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 <NAME> et al.
 *
 * This file is part of Overpass_API.
 *
 * Overpass_API is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * Overpass_API is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with Overpass_API.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef DE__OSM3S___OVERPASS_API__STATEMENTS__PRINT_H
#define DE__OSM3S___OVERPASS_API__STATEMENTS__PRINT_H

#include <map>
#include <string>
#include <vector>
#include "../data/collect_members.h"
#include "../data/utils.h"
#include "../frontend/output_handler.h"
#include "statement.h"


class Set_Comparison;


class Print_Statement : public Statement
{
  public:
    Print_Statement(int line_number_, const std::map< std::string, std::string >& attributes, Parsed_Query& global_settings);
    virtual std::string get_name() const { return "print"; }
    virtual std::string get_result_name() const { return ""; }
    virtual void execute(Resource_Manager& rman);
    virtual ~Print_Statement();

    static Generic_Statement_Maker< Print_Statement > statement_maker;

    static std::string mode_string_xml(Output_Mode mode)
    {
      if ((mode & (Output_Mode::VERSION | Output_Mode::META)) == (Output_Mode::VERSION | Output_Mode::META))
        return " mode=\"meta\"";
      else if ((mode & (Output_Mode::MEMBERS | Output_Mode::TAGS)) == (Output_Mode::MEMBERS | Output_Mode::TAGS))
        return "";
      else if ((mode & Output_Mode::TAGS) == Output_Mode::TAGS)
        return " mode=\"tags\"";
      else if ((mode & Output_Mode::MEMBERS) == Output_Mode::MEMBERS)
        return " mode=\"skeleton\"";
      else if ((mode & Output_Mode::COUNT) == Output_Mode::COUNT)
        return " mode=\"count\"";

      return " mode=\"ids_only\"";
    }

    static std::string mode_string_ql(Output_Mode mode)
    {
      if ((mode & (Output_Mode::VERSION | Output_Mode::META)) == (Output_Mode::VERSION | Output_Mode::META))
        return " meta";
      else if ((mode & (Output_Mode::MEMBERS | Output_Mode::TAGS)) == (Output_Mode::MEMBERS | Output_Mode::TAGS))
        return "";
      else if ((mode & Output_Mode::TAGS) == Output_Mode::TAGS)
        return " tags";
      else if ((mode & Output_Mode::MEMBERS) == Output_Mode::MEMBERS)
        return " skel";
      else if ((mode & Output_Mode::COUNT) == Output_Mode::COUNT)
        return " count";

      return " ids";
    }

    static std::string geometry_string_xml(Output_Mode mode)
    {
      if ((mode & (Output_Mode::GEOMETRY | Output_Mode::BOUNDS | Output_Mode::CENTER))
          == (Output_Mode::GEOMETRY | Output_Mode::BOUNDS | Output_Mode::CENTER))
        return " geometry=\"full\"";
      else if ((mode & (Output_Mode::GEOMETRY | Output_Mode::BOUNDS | Output_Mode::CENTER))
          == (Output_Mode::BOUNDS | Output_Mode::CENTER))
        return " geometry=\"bounds\"";
      else if ((mode & (Output_Mode::GEOMETRY | Output_Mode::BOUNDS | Output_Mode::CENTER))
          == Output_Mode::CENTER)
        return " geometry=\"center\"";

      return "";
    }

    static std::string geometry_string_ql(Output_Mode mode)
    {
      if ((mode & (Output_Mode::GEOMETRY | Output_Mode::BOUNDS | Output_Mode::CENTER))
          == (Output_Mode::GEOMETRY | Output_Mode::BOUNDS | Output_Mode::CENTER))
        return " geom";
      else if ((mode & (Output_Mode::GEOMETRY | Output_Mode::BOUNDS | Output_Mode::CENTER))
          == (Output_Mode::BOUNDS | Output_Mode::CENTER))
        return " bb";
      else if ((mode & (Output_Mode::GEOMETRY | Output_Mode::BOUNDS | Output_Mode::CENTER))
          == Output_Mode::CENTER)
        return " center";

      return "";
    }<commit_msg>Fixed QL dump for print<commit_after>/** Copyright 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 <NAME> et al.
 *
 * This file is part of Overpass_API.
 *
 * Overpass_API is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * Overpass_API is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with Overpass_API.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef DE__OSM3S___OVERPASS_API__STATEMENTS__PRINT_H
#define DE__OSM3S___OVERPASS_API__STATEMENTS__PRINT_H

#include <map>
#include <string>
#include <vector>
#include "../data/collect_members.h"
#include "../data/utils.h"
#include "../frontend/output_handler.h"
#include "statement.h"


class Set_Comparison;


class Print_Statement : public Statement
{
  public:
    Print_Statement(int line_number_, const std::map< std::string, std::string >& attributes, Parsed_Query& global_settings);
    virtual std::string get_name() const { return "print"; }
    virtual std::string get_result_name() const { return ""; }
    virtual void execute(Resource_Manager& rman);
    virtual ~Print_Statement();

    static Generic_Statement_Maker< Print_Statement > statement_maker;

    static std::string mode_string_xml(Output_Mode mode)
    {
      if ((mode & (Output_Mode::VERSION | Output_Mode::META)) == (Output_Mode::VERSION | Output_Mode::META))
        return " mode=\"meta\"";
      else if ((mode & (Output_Mode::MEMBERS | Output_Mode::TAGS)) == (Output_Mode::MEMBERS | Output_Mode::TAGS))
        return "";
      else if ((mode & Output_Mode::TAGS) == Output_Mode::TAGS)
        return " mode=\"tags\"";
      else if ((mode & Output_Mode::MEMBERS) == Output_Mode::MEMBERS)
        return " mode=\"skeleton\"";
      else if ((mode & Output_Mode::COUNT) == Output_Mode::COUNT)
        return " mode=\"count\"";

      return " mode=\"ids_only\"";
    }

    static std::string mode_string_ql(Output_Mode mode)
    {
      if ((mode & (Output_Mode::VERSION | Output_Mode::META)) == (Output_Mode::VERSION | Output_Mode::META))
        return " meta";
      else if ((mode & (Output_Mode::MEMBERS | Output_Mode::TAGS)) == (Output_Mode::MEMBERS | Output_Mode::TAGS))
        return "";
      else if ((mode & Output_Mode::TAGS) == Output_Mode::TAGS)
        return " tags";
      else if ((mode & Output_Mode::MEMBERS) == Output_Mode::MEMBERS)
        return " skel";
      else if ((mode & Output_Mode::COUNT) == Output_Mode::COUNT)
        return " count";

      return " ids";
    }

    static std::string geometry_string_xml(Output_Mode mode)
    {
      if ((mode & (Output_Mode::GEOMETRY | Output_Mode::BOUNDS | Output_Mode::CENTER))
          == (Output_Mode::GEOMETRY | Output_Mode::BOUNDS | Output_Mode::CENTER))
        return " geometry=\"full\"";
      else if ((mode & (Output_Mode::GEOMETRY | Output_Mode::BOUNDS | Output_Mode::CENTER))
          == (Output_Mode::BOUNDS | Output_Mode::CENTER))
        return " geometry=\"bounds\"";
      else if ((mode & (Output_Mode::GEOMETRY | Output_Mode::BOUNDS | Output_Mode::CENTER))
          == Output_Mode::CENTER)
        return " geometry=\"center\"";

      return "";
    }

    static std::string geometry_string_ql(Output_Mode mode)
    {
      if ((mode & (Output_Mode::GEOMETRY | Output_Mode::BOUNDS | Output_Mode::CENTER))
          == (Output_Mode::GEOMETRY | Output_Mode::BOUNDS))
        return " geom";
      else if ((mode & (Output_Mode::GEOMETRY | Output_Mode::BOUNDS | Output_Mode::CENTER))
          == (Output_Mode::BOUNDS))
        return " bb";
      else if ((mode & (Output_Mode::GEOMETRY | Output_Mode::BOUNDS | Output_Mode::CENTER))
          == Output_Mode::CENTER)
        return " center";

      return "";
    }
{'fraction_non_alphanumeric': 0.1344111969111969, 'fraction_numerical': 0.009411196911196911, 'mean_word_length': 3.6024430871737922, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, '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': '4651477', 'n_tokens_mistral': 2630, 'n_tokens_neox': 2522, 'n_words': 656}