<commit_before>// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "printing/backend/print_backend.h"

#include <algorithm>

#include "third_party/icu/public/common/unicode/uchar.h"
#include "ui/base/text/text_elider.h"

namespace {

const wchar_t kDefaultDocumentTitle[] = L"Untitled Document";
const int kMaxDocumentTitleLength = 50;

}  // namespace

namespace printing {

PrinterBasicInfo::PrinterBasicInfo()
    : printer_status(0),
      is_default(false) {}

PrinterBasicInfo::~PrinterBasicInfo() {}

PrinterSemanticCapsAndDefaults::PrinterSemanticCapsAndDefaults()
    : color_capable(false),
      duplex_capable(false),
      color_default(false),
      duplex_default(UNKNOWN_DUPLEX_MODE) {}

PrinterSemanticCapsAndDefaults::~PrinterSemanticCapsAndDefaults() {}

PrinterCapsAndDefaults::PrinterCapsAndDefaults() {}

PrinterCapsAndDefaults::~PrinterCapsAndDefaults() {}

PrintBackend::~PrintBackend() {}

string16 PrintBackend::SimplifyDocumentTitle(const string16& title) {
  string16 no_controls(title);
  no_controls.erase(
    std::remove_if(no_controls.begin(), no_controls.end(), &u_iscntrl),
    no_controls.end());
  string16 result;
  ui::ElideString(no_controls, kMaxDocumentTitleLength, &result);
  return result;
}

}  // namespace printing
<commit_msg>Linux: fix build with system ICU.<commit_after>// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "printing/backend/print_backend.h"

#include <algorithm>

#include "ui/base/text/text_elider.h"
#include "unicode/uchar.h"

namespace {

const wchar_t kDefaultDocumentTitle[] = L"Untitled Document";
const int kMaxDocumentTitleLength = 50;

}  // namespace

namespace printing {

PrinterBasicInfo::PrinterBasicInfo()
    : printer_status(0),
      is_default(false) {}

PrinterBasicInfo::~PrinterBasicInfo() {}

PrinterSemanticCapsAndDefaults::PrinterSemanticCapsAndDefaults()
    : color_capable(false),
      duplex_capable(false),
      color_default(false),
      duplex_default(UNKNOWN_DUPLEX_MODE) {}

PrinterSemanticCapsAndDefaults::~PrinterSemanticCapsAndDefaults() {}

PrinterCapsAndDefaults::PrinterCapsAndDefaults() {}

PrinterCapsAndDefaults::~PrinterCapsAndDefaults() {}

PrintBackend::~PrintBackend() {}

string16 PrintBackend::SimplifyDocumentTitle(const string16& title) {
  string16 no_controls(title);
  no_controls.erase(
    std::remove_if(no_controls.begin(), no_controls.end(), &u_iscntrl),
    no_controls.end());
  string16 result;
  ui::ElideString(no_controls, kMaxDocumentTitleLength, &result);
  return result;
}

}  // namespace printing

{'fraction_non_alphanumeric': 0.1145311381531854, 'fraction_numerical': 0.010737294201861132, 'mean_word_length': 5.833740831295843, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2343277', 'n_tokens_mistral': 926, 'n_tokens_neox': 895, 'n_words': 171}