Forum: Ruby Odd problem involving rubygems / classifier and Windows

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
67bb4df2775f6a6b603347dce7119571?d=identicon&s=25 unknown (Guest)
on 2006-05-03 19:08
(Received via mailing list)
Dear all,

I am experiencing a strange error when calling two Ruby programs
which work fine when called alone or from different *.rb files.

In a first Ruby method, I call the summarization method
script from _http://classifier.rufy.com/_ (http://classifier.rufy.com/)
to
summarize a text (or rather,
to reduce the number of sentences in it to some ratio), and later to
output
the result in an RTF file, while coloring those sentences in black which
are
kept, and coloring those sentences that are discarded in red.
This actually works fine.

Now, in the discarding process, the red and the black sentences
generally are not neatly separated, by there is, say, one sentence in
black,
followed
by three sentences in red, and then two sentences in red etc.
Now, for a reader who only gets the remaining, black sentences,
words like 'there','she','it', etc. may have no meaning if the place  or
person one is talking about is actually in one of the discarded
sentences
before that
sentence.

To fix this, I call a parts-of-speech tagger as an external program in
Windows
using the 'system' command. (A parts of speech tagger takes every
word form an English text file and decides whether it is a noun, a  verb
etc.)
I do this to find nouns that could be referred to as
'he','she','hers','it',
'there' etc.

Both scripts work on texts that are read in from files.
But when I combine them in one .rb file,

require "rubygems"
require 'classifier'

class String
   def text_summ
          # call summary from  classifier
   end
    def tag_it(language,output_file)  # call external  tagging program
tag_command='/c/axelhome/lang/mytagger/bin/tag-' + language + '.bat ' +
self
+ '  '  +                 output_file
system(tag_command)
end
end


#  color text for discarding
"a_too_long_text.txt".text_summ(30,'a_30_percent_as_long_text.rtf')
#  tag text for parts of speech
'a_30_percent_as_long_text.rtf'.tag_it('english','output_file.txt') ,

I get the following set of errors :

> 3 [main] ruby 3948 C:\cygwin\ur\local\bin\ruby.exe : *** fatal error:
unable to remap
> C:\cygwin\usr\local\lib\ruby\1.8\i-386-cygwin\opensll.so to same  address
as parent
> (0x2870000) != 0x28B0000
> 108726 [main] ruby 280: child_copy: loaded dll child copy failed
0x63096000...0x630A2E70,
> done 0, windows pid 5468565, Win32 error 5.

These lines keep returning, with some differences in the windows pid
numbers.

What is going on here? What could be done to fix it ?

Thank you very much,

Best regards,
Axel
This topic is locked and can not be replied to.