Module: Picky::API::Tokenizer::CharacterSubstituter

Included in:
Tokenizer
Defined in:
lib/picky/api/tokenizer/character_substituter.rb

Instance Method Summary collapse

Instance Method Details

#extract_character_substituter(thing) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/picky/api/tokenizer/character_substituter.rb', line 7

def extract_character_substituter thing
  if thing.respond_to? :substitute
    thing
  else
    raise ArgumentError.new <<-ERROR
The substitutes_characters_with option needs a character substituter,
which responds to #substitute(text) and returns substituted_text."
ERROR
  end
end