<commit_before>#Copyright (c) 2014, IDEO

require 'logging'
require 'socket'

CONFIG = {}
CONFIG[:room_name] = ""
CONFIG[:web_server_port] = 8081
CONFIG[:broadcast_port] = 1030
CONFIG[:listen_port] = 7733
CONFIG[:web_socket_port] = 8089

# Web Server Config
CONFIG[:web_server] = {
	:time_to_timeout => 10
}

# Persistor Types
# CONFIG[:persistor_class] = :riak
# CONFIG[:persistor_class] = :memory
# CONFIG[:persistor_class] = :mongodb

# Riak Settings
# NOTE: when using riak, you can point it at a single host:
# CONFIG[:riak] = {:host => '1.1.1.1'}
CONFIG[:riak] = {:host => 'localhost'}
# or point it at a set of nodes that will be round-robin retried on failure:
# CONFIG[:riak] = {:nodes => [{:host => '172.16.31.10'}, {:host => '192.168.3.11'}, {:host => '172.16.31.10'}]}

# MongoDB Settings
CONFIG[:mongodb] = { :ip => 'localhost', :port => 27017, :db => 'noam-server-data' }


# Noam Logging Configurations

CONFIG[:logging] = { }

# Level of logging to use by default
CONFIG[:logging][:level] = :info

# Pattern to use for all logging messages
#    %d - date
#    %c - calling class
#    %l - message level
#    %m - message string
#
#    For full list of options, see:
#		https://github.com/TwP/logging/blob/master/lib/logging/layouts/pattern.rb
#
CONFIG[:logging][:pattern] = '[%d] [%-15c] [%-5l] %m\n'

# Appenders to use for Logging
CONFIG[:logging][:appenders] = [
  Logging.appenders.stdout(
    :layout => Logging.layouts.pattern(
      :pattern => CONFIG[:logging][:pattern],
      :color_scheme => :default
    )
  ),

  # Log Messages to a single file
  Logging.appenders.file(
    '/tmp/noam.log',
    :layout => Logging.layouts.pattern(:pattern => CONFIG[:logging][:pattern])
  ),

  # Log messages to a rolling file based on size
  #   Set to a max of 100KB and keep up to 3 files at a time
  #
  # Logging.appenders.rolling_file(
  #	'noam.log',
  #	:layout => Logging.layouts.pattern(:pattern => CONFIG[:logging][:pattern]),
  #   :size => 1024 * 100,
  #   :keep => 3,
  #   :roll_by => 'number'
  # ),
]
<commit_msg>Changes default location of path to current directory. Prevents some user permission errors on some systems when writing to /tmp directory.<commit_after>#Copyright (c) 2014, IDEO

require 'logging'
require 'socket'

CONFIG = {}
CONFIG[:room_name] = ""
CONFIG[:web_server_port] = 8081
CONFIG[:broadcast_port] = 1030
CONFIG[:listen_port] = 7733
CONFIG[:web_socket_port] = 8089

# Web Server Config
CONFIG[:web_server] = {
	:time_to_timeout => 10
}

# Persistor Types
# CONFIG[:persistor_class] = :riak
# CONFIG[:persistor_class] = :memory
# CONFIG[:persistor_class] = :mongodb

# Riak Settings
# NOTE: when using riak, you can point it at a single host:
# CONFIG[:riak] = {:host => '1.1.1.1'}
CONFIG[:riak] = {:host => 'localhost'}
# or point it at a set of nodes that will be round-robin retried on failure:
# CONFIG[:riak] = {:nodes => [{:host => '172.16.31.10'}, {:host => '192.168.3.11'}, {:host => '172.16.31.10'}]}

# MongoDB Settings
CONFIG[:mongodb] = { :ip => 'localhost', :port => 27017, :db => 'noam-server-data' }


# Noam Logging Configurations

CONFIG[:logging] = { }

# Level of logging to use by default
CONFIG[:logging][:level] = :info

# Pattern to use for all logging messages
#    %d - date
#    %c - calling class
#    %l - message level
#    %m - message string
#
#    For full list of options, see:
#		https://github.com/TwP/logging/blob/master/lib/logging/layouts/pattern.rb
#
CONFIG[:logging][:pattern] = '[%d] [%-15c] [%-5l] %m\n'

# Appenders to use for Logging
CONFIG[:logging][:appenders] = [
  Logging.appenders.stdout(
    :layout => Logging.layouts.pattern(
      :pattern => CONFIG[:logging][:pattern],
      :color_scheme => :default
    )
  ),

  # Log Messages to a single file
  Logging.appenders.file(
    File.join(Dir.pwd, 'noam.log'),
    :layout => Logging.layouts.pattern(:pattern => CONFIG[:logging][:pattern])
  ),

  # Log messages to a rolling file based on size
  #   Set to a max of 100KB and keep up to 3 files at a time
  #
  # Logging.appenders.rolling_file(
  #	'noam.log',
  #	:layout => Logging.layouts.pattern(:pattern => CONFIG[:logging][:pattern]),
  #   :size => 1024 * 100,
  #   :keep => 3,
  #   :roll_by => 'number'
  # ),
]

{'fraction_non_alphanumeric': 0.1673363271094304, 'fraction_numerical': 0.034507208697707396, 'mean_word_length': 3.8365714285714287, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 43, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 8, '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': '3256293', 'n_tokens_mistral': 1618, 'n_tokens_neox': 1478, 'n_words': 395}