<commit_before>import Foundation

public final class Envoy {
  private let runner: EnvoyRunner

  public var isRunning: Bool {
    return runner.isExecuting
  }

  public var isTerminated: Bool {
    return runner.isFinished
  }

  public init(config: String, logLevel: String) {
    runner = EnvoyRunner(config: config, logLevel: logLevel)
    runner.start()
  }

  public convenience init(config: String) {
    self.init(config: config, logLevel: "info")
  }

  private final class EnvoyRunner: Thread {
    private let config: String
    private let logLevel: String

    init(config: String, logLevel: String) {
      self.config = config
      self.logLevel = logLevel
    }

    override func main() {
      EnvoyEngine.run(withConfig: config, logLevel: logLevel)
    }
  }
}
<commit_msg>swift: make Envoy visible to Objective-C (#243)<commit_after>import Foundation

@objcMembers
public final class Envoy: NSObject {
  private let runner: EnvoyRunner

  public var isRunning: Bool {
    return runner.isExecuting
  }

  public var isTerminated: Bool {
    return runner.isFinished
  }

  public init(config: String, logLevel: String) {
    runner = EnvoyRunner(config: config, logLevel: logLevel)
    runner.start()
  }

  public convenience init(config: String) {
    self.init(config: config, logLevel: "info")
  }

  private final class EnvoyRunner: Thread {
    private let config: String
    private let logLevel: String

    init(config: String, logLevel: String) {
      self.config = config
      self.logLevel = logLevel
    }

    override func main() {
      EnvoyEngine.run(withConfig: config, logLevel: logLevel)
    }
  }
}

{'fraction_non_alphanumeric': 0.08814589665653495, 'fraction_numerical': 0.00182370820668693, 'mean_word_length': 3.2864583333333335, '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': '7454813', 'n_tokens_mistral': 512, 'n_tokens_neox': 487, 'n_words': 146}