<commit_before>
part of webframe;



Map DEFAULT_OPTIONS = {
  'debug': true,
  'server_address': '0.0.0.0',
  'server_port': 9091,
};


class Config {

  final Map _options = {};

  dynamic get(String key) {
    return _options[key];
  }

  set(String key, dynamic value) {
    _options[key] = value;
  }

  Config() {
    update(DEFAULT_OPTIONS);
  }

  update(Map with) {
    with.forEach((k, v) => _options[k] = v);
  }

  String toString() {
    return _options.toString();
  }

}<commit_msg>Configuration loaders.<commit_after>
part of webframe;



Map DEFAULT_OPTIONS = {
  'debug': true,
  'server_address': '0.0.0.0',
  'server_port': 9091,
};


class Config {

  final Map _options = {};

  dynamic get(String key) {
    return _options[key];
  }

  set(String key, dynamic value) {
    _options[key] = value;
  }

  Config() {
    update(DEFAULT_OPTIONS);
  }

  update(Map with) {
    with.forEach((k, v) => _options[k] = v);
  }

  load(String filename) {
    loadFile(new File(filename));
  }

  loadFile(File file) {
    loadString(file.readAsStringSync());
  }

  loadString(String data) {
    update(JSON.parse(data));
  }

  String toString() {
    return _options.toString();
  }

}
{'fraction_non_alphanumeric': 0.15487094088259784, 'fraction_numerical': 0.013322231473771857, 'mean_word_length': 3.060810810810811, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '4576538', 'n_tokens_mistral': 461, 'n_tokens_neox': 436, 'n_words': 91}