Class: OmniCat::Configuration

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/omnicat/configuration.rb

Constant Summary collapse

@@defaults =
{
  auto_train: :off,
  exclude_tokens: ['a','about','across','after','all','almost','also','am','among','an','and','are','as','at','be','because','been','by','did','do','does','else','ever','every','for','from','get','got','had','has','have','he','her','hers','him','his','how','however','i','if','in','into','is','it','its','just','least','let','may','me','might','most','must','my','of','often','on','only','or','other','our','own','rather','said','say','says','she','should','since','so','some','than','that','the','their','them','then','there','these','they','this','tis','to','too','twas','us','wants','was','we','were','what','when','where','which','while','who','whom','will','with','would','yet','you','your'],
  logger: default_logger,
  token_patterns: {
    minus: [/[\s\t\n\r]+/, /(@[\w\d]+)/],
    plus: [/[\p{L}\-0-9]{2,}/, /[\!\?]/, /[\:\)\(\;\-\|]{2,3}/]
  }
}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



32
33
34
# File 'lib/omnicat/configuration.rb', line 32

def initialize
  @@defaults.each_pair{|k,v| self.send("#{k}=",v)}
end

Instance Attribute Details

#auto_trainObject

:off, :continues, :unique


9
10
11
# File 'lib/omnicat/configuration.rb', line 9

def auto_train
  @auto_train
end

#exclude_tokensObject

Returns the value of attribute exclude_tokens.



10
11
12
# File 'lib/omnicat/configuration.rb', line 10

def exclude_tokens
  @exclude_tokens
end

#loggerObject

Returns the value of attribute logger.



10
11
12
# File 'lib/omnicat/configuration.rb', line 10

def logger
  @logger
end

#token_patternsObject

Returns the value of attribute token_patterns.



10
11
12
# File 'lib/omnicat/configuration.rb', line 10

def token_patterns
  @token_patterns
end

Class Method Details

.default_loggerObject



12
13
14
15
16
# File 'lib/omnicat/configuration.rb', line 12

def self.default_logger
  logger = Logger.new(STDOUT)
  logger.progname = 'omnicat'
  logger
end

.defaultsObject



28
29
30
# File 'lib/omnicat/configuration.rb', line 28

def self.defaults
  @@defaults
end