<commit_before>// Copyright 2014 Toggl Desktop developers.

#ifndef SRC_CONTEXT_H_
#define SRC_CONTEXT_H_

#include <string>
#include <vector>
#include <map>

#include "./types.h"
#include "./database.h"
#include "./websocket_client.h"
#include "./window_change_recorder.h"
#include "./timeline_uploader.h"
#include "./CustomErrorHandler.h"

// FIXME: don't use C API from C++ class
#include "./kopsik_api.h"

#include "Poco/Util/Timer.h"

namespace kopsik {

class AutocompleteItem {
 public:
  AutocompleteItem() {}
  ~AutocompleteItem() {}

  bool IsTimeEntry() { return KOPSIK_AUTOCOMPLETE_TE == Type; }
  bool IsTask() { return KOPSIK_AUTOCOMPLETE_TASK == Type; }
  bool IsProject() { return KOPSIK_AUTOCOMPLETE_PROJECT == Type; }

  std::string Text;
  std::string Description;
  std::string ProjectAndTaskLabel;
  std::string ProjectColor;
  Poco::UInt64 TaskID;
  Poco::UInt64 ProjectID;
  Poco::UInt64 Type;
};

bool CompareAutocompleteItems(AutocompleteItem a, AutocompleteItem b);

// FIXME: rename
class Context {
  public:
    Context(<commit_msg>Fix autocomplete item garbage IDs<commit_after>// Copyright 2014 Toggl Desktop developers.

#ifndef SRC_CONTEXT_H_
#define SRC_CONTEXT_H_

#include <string>
#include <vector>
#include <map>

#include "./types.h"
#include "./database.h"
#include "./websocket_client.h"
#include "./window_change_recorder.h"
#include "./timeline_uploader.h"
#include "./CustomErrorHandler.h"

// FIXME: don't use C API from C++ class
#include "./kopsik_api.h"

#include "Poco/Util/Timer.h"

namespace kopsik {

class AutocompleteItem {
 public:
  AutocompleteItem()
    : Text("")
    , Description("")
    , ProjectAndTaskLabel("")
    , ProjectColor("")
    , TaskID(0)
    , ProjectID(0)
    , Type(0) {}
  ~AutocompleteItem() {}

  bool IsTimeEntry() { return KOPSIK_AUTOCOMPLETE_TE == Type; }
  bool IsTask() { return KOPSIK_AUTOCOMPLETE_TASK == Type; }
  bool IsProject() { return KOPSIK_AUTOCOMPLETE_PROJECT == Type; }

  std::string Text;
  std::string Description;
  std::string ProjectAndTaskLabel;
  std::string ProjectColor;
  Poco::UInt64 TaskID;
  Poco::UInt64 ProjectID;
  Poco::UInt64 Type;
};

bool CompareAutocompleteItems(AutocompleteItem a, AutocompleteItem b);

// FIXME: rename
class Context {
  public:
    Context(
{'fraction_non_alphanumeric': 0.13295304958315052, 'fraction_numerical': 0.010092145677928916, 'mean_word_length': 4.714285714285714, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '5580181', 'n_tokens_mistral': 819, 'n_tokens_neox': 795, 'n_words': 184}