Class: Sastrawi::Stemmer::Context::Visitor::DontStemShortWord

Inherits:
Object
  • Object
show all
Defined in:
lib/sastrawi/stemmer/context/visitor/dont_stem_short_word.rb

Instance Method Summary collapse

Instance Method Details

#short_word?(word) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/sastrawi/stemmer/context/visitor/dont_stem_short_word.rb', line 10

def short_word?(word)
  word.length <= 3
end

#visit(context) ⇒ Object



6
7
8
# File 'lib/sastrawi/stemmer/context/visitor/dont_stem_short_word.rb', line 6

def visit(context)
  context.stop_process if short_word?(context.current_word)
end