Sha256: 9471fdb1a965ad132bb0cd9b0730307ef0a9f4fef7e8c68ace1535ec8f7a927d

Contents?: true

Size: 1.04 KB

Versions: 20

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'

RSpec.describe PragmaticSegmenter::Languages::Dutch, '(nl)' do

  context "Golden Rules" do
    it "Sentence starting with a number #001" do
      ps = PragmaticSegmenter::Segmenter.new(text: "Hij schoot op de JP8-brandstof toen de Surface-to-Air (sam)-missiles op hem af kwamen. 81 procent van de schoten was raak.", language: 'nl')
      expect(ps.segment).to eq(["Hij schoot op de JP8-brandstof toen de Surface-to-Air (sam)-missiles op hem af kwamen.", "81 procent van de schoten was raak."])
    end

    it "Sentence starting with an ellipsis #002" do
      ps = PragmaticSegmenter::Segmenter.new(text: "81 procent van de schoten was raak. ...en toen barste de hel los.", language: 'nl')
      expect(ps.segment).to eq(["81 procent van de schoten was raak.", "...en toen barste de hel los."])
    end
  end

  describe '#segment' do
    it 'correctly segments text #001' do
      ps = PragmaticSegmenter::Segmenter.new(text: "Afkorting aanw. vnw.", language: 'nl')
      expect(ps.segment).to eq(["Afkorting aanw. vnw."])
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

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