Sha256: 5dedfeffff8cb43e7079da7b8469a70e7c0c2aa2984798e2af35d61e24be2a6c

Contents?: true

Size: 457 Bytes

Versions: 5

Compression:

Stored size: 457 Bytes

Contents

module Sastrawi
  module Morphology
    module Disambiguator
      class DisambiguatorPrefixRule24
        def disambiguate(word)
          contains = /^per([bcdfghjklmnpqrstvwxyz])([a-z])er([aiueo])(.*)$/.match(word)

          if contains
            matches = contains.captures

            return if matches[0] == 'r'

            return matches[0] << matches[1] << 'er' << matches[2] << matches[3]
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sastrawi-0.1.3 lib/sastrawi/morphology/disambiguator/disambiguator_prefix_rule24.rb
sastrawi-0.1.2 lib/sastrawi/morphology/disambiguator/disambiguator_prefix_rule24.rb
sastrawi-0.1.1 lib/sastrawi/morphology/disambiguator/disambiguator_prefix_rule24.rb
sastrawi-0.1.0 lib/sastrawi/morphology/disambiguator/disambiguator_prefix_rule24.rb
sastrawi-0.1.0.pre lib/sastrawi/morphology/disambiguator/disambiguator_prefix_rule24.rb