<commit_before>#if os(Linux)
  import Glibc
#else
  import Darwin
#endif

public struct NameBuilder {
  let praenomina, nomina, cognomina: [String]
  
  init() {
    print("Docendo nomina...")
    let praenominaObj = Praenomina(); praenomina = praenominaObj.list
    let nominaObj = Nomina(); nomina = nominaObj.list
    let cognominaObj = Cognomina(); cognomina = cognominaObj.list
    print("Praenomina sunt: \(praenomina)")
    print("Nomina sunt: \(nomina)")
    print("Cognomina sunt: \(cognomina)")
    print("Nomina docta sunt\n")
  }

  private func buildName (from praenomina: [String], and nomina: [String], and cognomina: [String]) -> String {
    #if os(Linux)
      let prae: Int = Int(random() % (praenomina.count + 1))
      let n: Int = Int(random() % (nomina.count + 1))
      let co: Int = Int(random() % (cognomina.count + 1))
    #else
      let prae: Int = Int(arc4random_uniform(UInt32(praenomina.count)))
      let n: Int = Int(arc4random_uniform(UInt32(nomina.count)))
      let co: Int = Int(arc4random_uniform(UInt32(cognomina.count)))
    #endif

    return (praenomina[prae] + " " + nomina[n] + " " + cognomina[co])
  }

  func next () -> String {
    return buildName(from: praenomina, and: nomina, and: cognomina)
  }
}<commit_msg>Incapsulate random Int choosing steps in proper function<commit_after>#if os(Linux)
  import Glibc
#else
  import Darwin
#endif

public struct NameBuilder {
  let praenomina, nomina, cognomina: [String]
  
  init() {
    print("Docendo nomina...")
    let praenominaObj = Praenomina(); praenomina = praenominaObj.list
    let nominaObj = Nomina(); nomina = nominaObj.list
    let cognominaObj = Cognomina(); cognomina = cognominaObj.list
    print("Praenomina sunt: \(praenomina)")
    print("Nomina sunt: \(nomina)")
    print("Cognomina sunt: \(cognomina)")
    print("Nomina docta sunt\n")
  }
  
  private func randomInt (min: Int, max: Int) -> Int {
    #if os(Linux)
      return Gblibc.random() % max
    #else
      return min + Int(arc4random_uniform(UInt32(max - min + 1)))
    #endif
  }

  private func buildName (from praenomina: [String], and nomina: [String], and cognomina: [String]) -> String {
    let prae: Int = randomInt(min: 0, max: praenomina.count)
    let n: Int = randomInt(min: 0, max: nomina.count)
    let co: Int = randomInt(min: 0, max: cognomina.count)

    return (praenomina[prae] + " " + nomina[n] + " " + cognomina[co])
  }

  func next () -> String {
    return buildName(from: praenomina, and: nomina, and: cognomina)
  }
}
{'fraction_non_alphanumeric': 0.14036478984932593, 'fraction_numerical': 0.00753370340999207, 'mean_word_length': 3.537769784172662, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '943334', 'n_tokens_mistral': 962, 'n_tokens_neox': 923, 'n_words': 228}