Class: OmniCat::Configuration
- Inherits:
-
Object
- Object
- OmniCat::Configuration
- 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
-
#auto_train ⇒ Object
[:off, :continues, :unique].
-
#exclude_tokens ⇒ Object
Returns the value of attribute exclude_tokens.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#token_patterns ⇒ Object
Returns the value of attribute token_patterns.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
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_train ⇒ Object
- :off, :continues, :unique
9 10 11 |
# File 'lib/omnicat/configuration.rb', line 9 def auto_train @auto_train end |
#exclude_tokens ⇒ Object
Returns the value of attribute exclude_tokens.
10 11 12 |
# File 'lib/omnicat/configuration.rb', line 10 def exclude_tokens @exclude_tokens end |
#logger ⇒ Object
Returns the value of attribute logger.
10 11 12 |
# File 'lib/omnicat/configuration.rb', line 10 def logger @logger end |
#token_patterns ⇒ Object
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_logger ⇒ Object
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 |
.defaults ⇒ Object
28 29 30 |
# File 'lib/omnicat/configuration.rb', line 28 def self.defaults @@defaults end |