Sha256: 7bd5a5cfbc60d50e00fda08afcf4e98c8e7e44c243c92da9703041af2b790d53

Contents?: true

Size: 801 Bytes

Versions: 3

Compression:

Stored size: 801 Bytes

Contents

module PragmaticSegmenter
  module Languages
    class Armenian
      class Process < PragmaticSegmenter::Process
        private

        def sentence_boundary_punctuation(txt)
          PragmaticSegmenter::Languages::Armenian::SentenceBoundaryPunctuation.new(text: txt).split
        end

        def punctuation_array
          PragmaticSegmenter::Languages::Armenian::Punctuation.new.punct
        end
      end

      class SentenceBoundaryPunctuation < PragmaticSegmenter::SentenceBoundaryPunctuation
        SENTENCE_BOUNDARY = /.*?[։՜:]|.*?$/

        def split
          text.scan(SENTENCE_BOUNDARY)
        end
      end

      class Punctuation < PragmaticSegmenter::Punctuation
        PUNCT = ['։', '՜', ':']

        def punct
          PUNCT
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pragmatic_segmenter-0.0.3 lib/pragmatic_segmenter/languages/armenian.rb
pragmatic_segmenter-0.0.2 lib/pragmatic_segmenter/languages/armenian.rb
pragmatic_segmenter-0.0.1 lib/pragmatic_segmenter/languages/armenian.rb