Sha256: febc62c9467829cd59c1e689d6b2af75a6c5d5afa05617f7246275e8b77b001c

Contents?: true

Size: 434 Bytes

Versions: 5

Compression:

Stored size: 434 Bytes

Contents

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

          if contains
            matches = contains.captures

            return if /^er(.*)$/.match(matches[2])

            return matches[0] << matches[1] << matches[2]
          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_rule2.rb
sastrawi-0.1.2 lib/sastrawi/morphology/disambiguator/disambiguator_prefix_rule2.rb
sastrawi-0.1.1 lib/sastrawi/morphology/disambiguator/disambiguator_prefix_rule2.rb
sastrawi-0.1.0 lib/sastrawi/morphology/disambiguator/disambiguator_prefix_rule2.rb
sastrawi-0.1.0.pre lib/sastrawi/morphology/disambiguator/disambiguator_prefix_rule2.rb