<commit_before>// Copyright (c) 2017 <NAME>
// Licensed under MIT License
//
// See LICENSE for license information

import Foundation

extension DataWithPointer {

    func getZipStringField(_ length: Int, _ useUtf8: Bool) -> String? {
        guard length > 0
            else { return "" }
        let bytes = self.bytes(count: length)
        let bytesAreUtf8 = ZipString.needsUtf8(bytes)
        if !useUtf8 && ZipString.cp437Available && !bytesAreUtf8 {
            return String(data: Data(bytes: bytes), encoding: String.Encoding(rawValue:
                CFStringConvertEncodingToNSStringEncoding(ZipString.cp437Encoding)))
        } else {
            return String(data: Data(bytes: bytes), encoding: .utf8)<commit_msg>Fix build problem on linux<commit_after>// Copyright (c) 2017 <NAME>
// Licensed under MIT License
//
// See LICENSE for license information

import Foundation

#if os(Linux)
    import CoreFoundation
#endif

extension DataWithPointer {

    func getZipStringField(_ length: Int, _ useUtf8: Bool) -> String? {
        guard length > 0
            else { return "" }
        let bytes = self.bytes(count: length)
        let bytesAreUtf8 = ZipString.needsUtf8(bytes)
        if !useUtf8 && ZipString.cp437Available && !bytesAreUtf8 {
            return String(data: Data(bytes: bytes), encoding: String.Encoding(rawValue:
                CFStringConvertEncodingToNSStringEncoding(ZipString.cp437Encoding)))
        } else {
            return String(data: Data(bytes: bytes), encoding: .utf8)
{'fraction_non_alphanumeric': 0.09861932938856016, 'fraction_numerical': 0.022353714661406968, 'mean_word_length': 2.9328165374677004, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6027234', 'n_tokens_mistral': 455, 'n_tokens_neox': 415, 'n_words': 118}