<commit_before>/*
  Copyright:    © 2018 SIL International.
  Description:  Internal keyboard class and adaptor class for the API.
  Create Date:  2 Oct 2018
  Authors:      <NAME> (TSE)
  History:      2 Oct 2018 - TSE - Refactored out of km_kbp_keyboard_api.cpp
*/

#pragma once

#include <algorithm>
#include <string>

#include <keyman/keyboardprocessor.h>
#include <json.hpp>
#include <utfcodec.hpp>

// Forward declarations
class json;

namespace km {
namespace kbp
{
  class path
  {
  public:
    using char_type = std::remove_const_t<
                        std::remove_pointer_t<km_kbp_path_name>>;
    using string_type = std::basic_string<char_type>;
    static constexpr char_type const parent_separator = _KM_KBP_PATH_SEPARATOR,
                                     suffix_separator = _KM_KBP_EXT_SEPARATOR;
  private:
    string_type _path;

    void normalise() {
      #if '/' != _KM_KBP_PATH_SEPARATOR
      std::replace(_path.begin(), _path.end(), '/',_KM_KBP_PATH_SEPARATOR);
      #endif
    }

  public:
    template<class... Args>
    static path join(path const &start, Args&&... args) {
      auto r = start;
      for (auto & p: {args...})<commit_msg>Fix ambiguity during type deduction in normalise on Windows.<commit_after>/*
  Copyright:    © 2018 SIL International.
  Description:  Internal keyboard class and adaptor class for the API.
  Create Date:  2 Oct 2018
  Authors:      <NAME> (TSE)
  History:      2 Oct 2018 - TSE - Refactored out of km_kbp_keyboard_api.cpp
*/

#pragma once

#include <algorithm>
#include <string>

#include <keyman/keyboardprocessor.h>
#include <json.hpp>
#include <utfcodec.hpp>

// Forward declarations
class json;

namespace km {
namespace kbp
{
  class path
  {
  public:
    using char_type = std::remove_const_t<
                        std::remove_pointer_t<km_kbp_path_name>>;
    using string_type = std::basic_string<char_type>;
    static constexpr char_type const parent_separator = _KM_KBP_PATH_SEPARATOR,
                                     suffix_separator = _KM_KBP_EXT_SEPARATOR;
  private:
    string_type _path;

    void normalise() {
      #if '/' != _KM_KBP_PATH_SEPARATOR
      std::replace(_path.begin(), _path.end(), char_type('/'), _KM_KBP_PATH_SEPARATOR);
      #endif
    }

  public:
    template<class... Args>
    static path join(path const &start, Args&&... args) {
      auto r = start;
      for (auto & p: {args...})
{'fraction_non_alphanumeric': 0.10567757977621219, 'fraction_numerical': 0.011603812681309573, 'mean_word_length': 2.8624, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3510501', 'n_tokens_mistral': 831, 'n_tokens_neox': 782, 'n_words': 206}