diasks2 / pragmatic_segmenter

Pragmatic Segmenter is a rule-based sentence boundary detection gem that works out-of-the-box across many languages.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pragmatic segmenter not installing

sevilaybayatli opened this issue · comments

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

I responded here before I saw this issue, please check it 👉 #69 (comment)

Is this solved with the newest version: #68 ?