<commit_before><?php

/**
 * Printer class used in AnsiDumper.
 */
class AnsiPrinter {

  private $_colors = array();
  private $_modus = '';
  private $_clearScreen = '';
  private $_tab = '';
  private $_rx = null;

  public function __construct() {
    $this->enableCliModus();
  }

  /**
   * Return current print mode.
   * @return string
   */
  public function getModus() {
    return $this->_modus;
  }

  /**
   * Enable CLI mode.
   * @return AnsiPrinter
   */
  public function enableCliModus() {
    $this->_colors = array(
      // styles
      'bold' => array("\033[1m", "\033[22m"),
      'italic' => array("\033[3m", "\033[23m"),
      'underline' => array("\033[4m", "\033[24m"),
      'inverse' => array("\033[7m", "\033[27m"),
      // colors
      'black' => array("\033[30m", "\033[39m"),
      'red' => array("\033[31m", "\033[39m"),
      'green' => array("\033[32m", "\033[39m"),
      'yellow' => array("\033[33m", "\033[39m"),
      'blue' => array("\033[34m", "\033[39m"),
      'magenta' => array("\033[35m", "\033[39m"),
      'cyan' => array("\033[36m", "\033[39m"),
      'white' => array("\033[37m", "\033[39m"),
      'grey' => array("\033[90m", "\033[3m9")
    );
    $this->_modus = 'cli';
    $this->_clearScreen = "\033c\033[2J";
    $this->_tab = '  ';
    $this->_rx = '/<(?:\{(' . implode('|', array_keys($this->_colors)) . ')|\})>/i';
    return $this;<commit_msg>Clear screen now works also on KDE's Konsole<commit_after><?php

/**
 * Printer class used in AnsiDumper.
 */
class AnsiPrinter {

  private $_colors = array();
  private $_modus = '';
  private $_clearScreen = '';
  private $_tab = '';
  private $_rx = null;

  public function __construct() {
    $this->enableCliModus();
  }

  /**
   * Return current print mode.
   * @return string
   */
  public function getModus() {
    return $this->_modus;
  }

  /**
   * Enable CLI mode.
   * @return AnsiPrinter
   */
  public function enableCliModus() {
    $this->_colors = array(
      // styles
      'bold' => array("\033[1m", "\033[22m"),
      'italic' => array("\033[3m", "\033[23m"),
      'underline' => array("\033[4m", "\033[24m"),
      'inverse' => array("\033[7m", "\033[27m"),
      // colors
      'black' => array("\033[30m", "\033[39m"),
      'red' => array("\033[31m", "\033[39m"),
      'green' => array("\033[32m", "\033[39m"),
      'yellow' => array("\033[33m", "\033[39m"),
      'blue' => array("\033[34m", "\033[39m"),
      'magenta' => array("\033[35m", "\033[39m"),
      'cyan' => array("\033[36m", "\033[39m"),
      'white' => array("\033[37m", "\033[39m"),
      'grey' => array("\033[90m", "\033[3m9")
    );
    $this->_modus = 'cli';
    $this->_clearScreen = "\033c\033[3J";
    $this->_tab = '  ';
    $this->_rx = '/<(?:\{(' . implode('|', array_keys($this->_colors)) . ')|\})>/i';
    return $this;
{'fraction_non_alphanumeric': 0.2509679690249912, 'fraction_numerical': 0.0936290038718761, 'mean_word_length': 2.7198952879581153, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 47, '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': '1832520', 'n_tokens_mistral': 1216, 'n_tokens_neox': 1038, 'n_words': 200}