<commit_before>#if os(Linux)
	import CPostgreSQLLinux
#else
	import CPostgreSQLMac
#endif

public enum OID: Oid {
	case text = 25
	case varchar  = 1043
	case int2 = 21
	case int4 = 23
	case int8 = 20
	case float4 = 700
	case float8 = 701
	case numeric = 1700
	case bool = 16
	case char = 18
	case unknown = 705
}

extension Node {
	init(oid: Oid, value: String) {
		guard let type = OID(rawValue: oid) else {
			self = .null
			return
		}

		switch type {
		case .text, .varchar, .char:
			self = .string(value)
		case .int2, .int4, .int8:
			self = .number(.int(Int(value) ?? 0))
		case .float4, .float8, .numeric:
			self = .number(.double(Double(value) ?? 0))
		case .bool:
			self = .bool((value == "t") ? true : false)
		case .unknown:
			self = .null
		}
	}
}<commit_msg>Now falling back to string in case of unknown type.<commit_after>#if os(Linux)
	import CPostgreSQLLinux
#else
	import CPostgreSQLMac
#endif

public enum OID: Oid {
	case text = 25
	case varchar  = 1043
	case int2 = 21
	case int4 = 23
	case int8 = 20
	case float4 = 700
	case float8 = 701
	case numeric = 1700
	case bool = 16
	case char = 18
	case unknown = 705
}

extension Node {
	init(oid: Oid, value: String) {
		guard let type = OID(rawValue: oid) else {
            // Always fallback to string, allowing to use with custom types as strings
			self = .string(value)
			return
		}

		switch type {
		case .text, .varchar, .char:
			self = .string(value)
		case .int2, .int4, .int8:
			self = .number(.int(Int(value) ?? 0))
		case .float4, .float8, .numeric:
			self = .number(.double(Double(value) ?? 0))
		case .bool:
			self = .bool((value == "t") ? true : false)
		case .unknown:
            // Always fallback to string, allowing to use with custom types as strings
			self = .string(value)
		}
	}
}
{'fraction_non_alphanumeric': 0.12163677130044843, 'fraction_numerical': 0.04596412556053812, 'mean_word_length': 2.8059701492537314, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6697944', 'n_tokens_mistral': 774, 'n_tokens_neox': 656, 'n_words': 219}