Module: NlpPure::Segmenting::DefaultWord

Defined in:
lib/nlp_pure/segmenting/default_word.rb

Constant Summary collapse

DEFAULT_OPTIONS =
{
  # hyphen, en dash, em dash, and string
  split: /[\-–—\s]/
}.freeze

Class Method Summary collapse

Class Method Details

.optionsObject

NOTE: exposed as a method for easy mock/stub



19
20
21
# File 'lib/nlp_pure/segmenting/default_word.rb', line 19

def self.options
  DEFAULT_OPTIONS
end

.parse(*args) ⇒ Object



11
12
13
14
15
16
# File 'lib/nlp_pure/segmenting/default_word.rb', line 11

def self.parse(*args)
  unless args.nil? || args.empty?
    input = args[0].to_s
    input.split(options[:split])
  end
end