Sha256: 3fc1b3a836b0dfa2d685edb8e5d8e5fee6e4c5ceecbda46cce943163af276125

Contents?: true

Size: 438 Bytes

Versions: 1

Compression:

Stored size: 438 Bytes

Contents

module Sastrawi
  module Morphology
    module Disambiguator
      class DisambiguatorPrefixRule23
        def disambiguate(word)
          contains = /^per([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

1 entries across 1 versions & 1 rubygems

Version Path
sastrawi-0.1.4 lib/sastrawi/morphology/disambiguator/disambiguator_prefix_rule23.rb