Class: Sastrawi::Stemmer::ConfixStripping::PrecedenceAdjustmentSpecification

Inherits:
Object
  • Object
show all
Defined in:
lib/sastrawi/stemmer/confix_stripping/precedence_adjustment_specification.rb

Instance Method Summary collapse

Instance Method Details

#satisfied_by?(value) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/sastrawi/stemmer/confix_stripping/precedence_adjustment_specification.rb', line 10

def satisfied_by?(value)
  regex_rules = [
    /^be(.*)lah$/, /^be(.*)an$/, /^me(.*)i$/,
    /^di(.*)i$/, /^pe(.*)i$/, /^ter(.*)i$/
  ]

  regex_rules.each do |rule|
    return true if rule.match(value)
  end

  false
end