Sha256: 881443d70e997c949ed30c091e5287761af1dc6a302a82fbb7def80b4944532e

Contents?: true

Size: 558 Bytes

Versions: 2

Compression:

Stored size: 558 Bytes

Contents

module Sastrawi
  module Morphology
    class InvalidAffixPairSpecification
      def satisfied_by?(word)
        return false if /^me(.*)kan$/.match(word)

        return false if word == 'ketahui'

        invalid_affixes = [
          /^ber(.*)i$/, /^di(.*)an$/, /^ke(.*)i$/, /^ke(.*)an$/,
          /^me(.*)an$/, /^me(.*)an$/, /^ter(.*)an$/, /^per(.*)an$/
        ]

        matches = false

        invalid_affixes.each do |invalid_affix|
          matches = matches || !!(word =~ invalid_affix)
        end

        matches
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sastrawi-0.1.0 lib/sastrawi/morphology/invalid_affix_pair_specification.rb
sastrawi-0.1.0.pre lib/sastrawi/morphology/invalid_affix_pair_specification.rb