diasks2 / pragmatic_segmenter

Pragmatic Segmenter is a rule-based sentence boundary detection gem that works out-of-the-box across many languages.
MIT License
541 stars 54 forks source link

pragmatic segmenter not installing #66

Open sevilaybayatli opened 3 years ago

sevilaybayatli commented 3 years ago

Hello,

I have been using pragmatic segmenter by following the steps below: sudo apt-get install ruby-full gem install pragmatic_segmenter

And after install the pragmatic_segmenter I got this: Successfully installed pragmatic_segmenter-0.3.22 Parsing documentation for pragmatic_segmenter-0.3.22 Done installing documentation for pragmatic_segmenter after 0 seconds 1 gem installed

And using it to sengemet the sentences in a whole file by applying the code block below: require 'pragmatic_segmenter' if (ARGV.length < 3) puts "\nUsage : ruby2.5 sentenceTokenizer.rb 639-1ISOlangCode textFilePath sentencesFilePath" exit end File.open(ARGV[1]).each do |line1| line1.delete! ('()[]{}<>|$/'"') ps = PragmaticSegmenter::Segmenter.new(text: line1, language: ARGV[0], doc_type: 'txt') sentences = ps.segment File.open(ARGV[2], "a") do |line2| sentences.each { |sentence| line2.puts sentence } end end

But the problem now I got the error below: Traceback (most recent call last): 2: from sentenceTokenizer.rb:1:in

' 1: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in require' /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- pragmatic_segmenter (LoadError) Could you point me please? the same code and same steps have been used before and worked? I am curious, why I got this error now. Help

alextsui05 commented 3 years ago

I responded here before I saw this issue, please check it 👉 https://github.com/diasks2/pragmatic_segmenter/issues/69#issuecomment-763074625

diasks2 commented 3 years ago

Is this solved with the newest version: https://github.com/diasks2/pragmatic_segmenter/pull/68 ?