Sha256: 5c9019937a209c71fbbf34fa974ffe3da83fcc3f2502cb8afd37d20e7083d0b8

Contents?: true

Size: 869 Bytes

Versions: 20

Compression:

Stored size: 869 Bytes

Contents

require 'spec_helper'

RSpec.describe PragmaticSegmenter::Languages::Persian, '(fa)' do

  context "Golden Rules" do
    it "Sentence ending punctuation #001" do
      ps = PragmaticSegmenter::Segmenter.new(text: "خوشبختم، آقای رضا. شما کجایی هستید؟ من از تهران هستم.", language: 'fa')
      expect(ps.segment).to eq(["خوشبختم، آقای رضا.", "شما کجایی هستید؟", "من از تهران هستم."])
    end
  end

  describe '#segment' do
    it 'correctly segments text #001' do
      ps = PragmaticSegmenter::Segmenter.new(text: "خوشبختم، آقای رضا. شما کجایی هستید؟ من از تهران هستم.", language: 'fa')
      expect(ps.segment).to eq(["خوشبختم، آقای رضا.", "شما کجایی هستید؟", "من از تهران هستم."])
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
pragmatic_segmenter-0.3.24 spec/pragmatic_segmenter/languages/persian_spec.rb
pragmatic_segmenter-0.3.23 spec/pragmatic_segmenter/languages/persian_spec.rb
pragmatic_segmenter-0.3.22 spec/pragmatic_segmenter/languages/persian_spec.rb
pragmatic_segmenter-0.3.21 spec/pragmatic_segmenter/languages/persian_spec.rb
pragmatic_segmenter-0.3.20 spec/pragmatic_segmenter/languages/persian_spec.rb
pragmatic_segmenter-0.3.19 spec/pragmatic_segmenter/languages/persian_spec.rb
pragmatic_segmenter-0.3.18 spec/pragmatic_segmenter/languages/persian_spec.rb
pragmatic_segmenter-0.3.17 spec/pragmatic_segmenter/languages/persian_spec.rb
pragmatic_segmenter-0.3.16 spec/pragmatic_segmenter/languages/persian_spec.rb
pragmatic_segmenter-0.3.15 spec/pragmatic_segmenter/languages/persian_spec.rb
pragmatic_segmenter-0.3.14 spec/pragmatic_segmenter/languages/persian_spec.rb
pragmatic_segmenter-0.3.13 spec/pragmatic_segmenter/languages/persian_spec.rb
pragmatic_segmenter-0.3.12 spec/pragmatic_segmenter/languages/persian_spec.rb
pragmatic_segmenter-0.3.10 spec/pragmatic_segmenter/languages/persian_spec.rb
pragmatic_segmenter-0.3.9 spec/pragmatic_segmenter/languages/persian_spec.rb
pragmatic_segmenter-0.3.8 spec/pragmatic_segmenter/languages/persian_spec.rb
pragmatic_segmenter-0.3.7 spec/pragmatic_segmenter/languages/persian_spec.rb
pragmatic_segmenter-0.3.6 spec/pragmatic_segmenter/languages/persian_spec.rb
pragmatic_segmenter-0.3.5 spec/pragmatic_segmenter/languages/persian_spec.rb
pragmatic_segmenter-0.3.4 spec/pragmatic_segmenter/languages/persian_spec.rb