Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pragmatic segmenter not installing #66

Open
sevilaybayatli opened this issue Jan 13, 2021 · 2 comments
Open

pragmatic segmenter not installing #66

sevilaybayatli opened this issue Jan 13, 2021 · 2 comments

Comments

@sevilaybayatli
Copy link

sevilaybayatli commented Jan 13, 2021

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
Copy link
Contributor

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

@diasks2
Copy link
Owner

diasks2 commented May 2, 2021

Is this solved with the newest version: #68 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants