<commit_before><?php
namespace Witti\FileConverter\Configuration;

class ConfigurationDefaults extends ConfigurationBase {
  public function getAllConverters() {
    return $this->converters;
  }

  public function __construct(&$settings) {
    $settings = array(
      // Ubuntu 12.04 LTS:
      //   /tmp
      //   Linux
      //   3.2.0-57-virtual
      // Windows 2008 R2 Standard
      //   C:\Users\USERNA~1\AppData\Local\Temp\3\
      //   Windows NT
      //   6.1
      'temp_dir' => sys_get_temp_dir(),
      'operating_system' => php_uname('s'),
      'operating_system_version' => php_uname('r'),
    );

    // Attempt to get better OS information.
    // lsb_release is available on Ubun
    if ($settings['operating_system'] === 'Linux') {
      $lsb = trim(`which lsb_release`);
      if ($lsb !== '') {
        $lsb = escapeshellarg($lsb);
        $settings['operating_system'] = trim(`$lsb   -is`);
        $settings['operating_system_version'] = trim(`$lsb   -rs`);
      }
    }
    elseif ($settings['operating_system'] === 'Windows') {
      // Differentiate based on 32/64-bit but NOT based on build number.
      if (preg_match('@^build (\d+) \((.*?)\) (.*)$@', php_uname('v'), $arr)) {
        $settings['operating_system'] = preg_replace('@\s@s', '', $arr[2]);
        $settings['operating_system_version'] = $arr[3];
      }
    }<commit_msg>Improve the windows version detection for human readability.<commit_after><?php
namespace Witti\FileConverter\Configuration;

class ConfigurationDefaults extends ConfigurationBase {
  public function getAllConverters() {
    return $this->converters;
  }

  public function __construct(&$settings) {
    $settings = array(
      // Ubuntu 12.04 LTS:
      //   /tmp
      //   Linux
      //   3.2.0-57-virtual
      // Windows 2008 R2 Standard
      //   C:\Users\USERNA~1\AppData\Local\Temp\3\
      //   Windows NT
      //   6.1
      'temp_dir' => sys_get_temp_dir(),
      'operating_system' => php_uname('s'),
      'operating_system_version' => php_uname('r'),
    );

    // Attempt to get better OS information.
    // lsb_release is available on Ubun
    if ($settings['operating_system'] === 'Linux') {
      $lsb = trim(`which lsb_release`);
      if ($lsb !== '') {
        $lsb = escapeshellarg($lsb);
        $settings['operating_system'] = trim(`$lsb   -is`);
        $settings['operating_system_version'] = trim(`$lsb   -rs`);
      }
    }
    elseif ($settings['operating_system'] === 'Windows NT') {
      // Differentiate based on 32/64-bit but NOT based on build number.
      if (preg_match('@^build (\d+) \((Windows [^ ]+ )(.*?)\)$@', php_uname('v'), $arr)) {
		$settings['operating_system'] = preg_replace('@\s@s', '', $arr[2]);
        $settings['operating_system_version'] = preg_replace('@\s@s', '', $arr[3] . php_uname('m'));
		$settings['operating_system_version'] = strtr($settings['operating_system_version'], array(
		  'Edition' => '',
		  'ServicePack' => 'SP',
		));
      }
    }
{'fraction_non_alphanumeric': 0.1767659859390693, 'fraction_numerical': 0.016069635085369936, 'mean_word_length': 2.7537688442211055, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '4153042', 'n_tokens_mistral': 1037, 'n_tokens_neox': 977, 'n_words': 191}