Sha256: ac3275ad25af94a9f0661fb786f59ac587d83a3ee11be6335adc89724cdaec2a

Contents?: true

Size: 643 Bytes

Versions: 4

Compression:

Stored size: 643 Bytes

Contents

##
# Confix Stripping Rule Precendence Adjustment Specification
# Asian J. (2007) "Effective Techniques for Indonesian Text Retrieval" page 78-79
# http://researchbank.rmit.edu.au/eserv/rmit:6312/Asian.pdf

module Sastrawi
  module Stemmer
    module ConfixStripping
      class PrecedenceAdjustmentSpecification
        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
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sastrawi-0.1.4 lib/sastrawi/stemmer/confix_stripping/precedence_adjustment_specification.rb
sastrawi-0.1.3 lib/sastrawi/stemmer/confix_stripping/precedence_adjustment_specification.rb
sastrawi-0.1.2 lib/sastrawi/stemmer/confix_stripping/precedence_adjustment_specification.rb
sastrawi-0.1.1 lib/sastrawi/stemmer/confix_stripping/precedence_adjustment_specification.rb