text/format loops on long words

W

Wybo Dekker

This hangs, and it has to do with the last two words in the text to be
too long (make columns 1 larger or body_indent 1 less and it works):

#!/usr/bin/env ruby
require 'text/format'
require 'tex/hyphen'

puts Text::Format.new(
:body_indent => 15,
:columns => 30,
:hyphenator => TeX::Hyphen.new,
:split_rules => Text::Format::SPLIT_HYPHENATION,
:hard_margins => true,
:text => "something pancakes electroencephalogram"
).paragraphs

I hope Austin Ziegler is looking...
 
A

Austin Ziegler

This hangs, and it has to do with the last two words in the text to be
too long (make columns 1 larger or body_indent 1 less and it works):

#!/usr/bin/env ruby
require 'text/format'
require 'tex/hyphen'

puts Text::Format.new(
:body_indent => 15,
:columns => 30,
:hyphenator => TeX::Hyphen.new,
:split_rules => Text::Format::SPLIT_HYPHENATION,
:hard_margins => true,
:text => "something pancakes electroencephalogram"
).paragraphs

I hope Austin Ziegler is looking...

I will look at this later this week. I am just back from a wonderful
vacation on the beaches of Cuba (got my hair braided and a wonderful
New Year's tan, thanks :) and still have to finish rebuilding my main
development computer after a catastrophic hard drive crash (I haven't
yet installed Ruby on the machine, but it has finally been downloaded;
I just need to get the Windows build environment(s) set up that I will
be using).

My plan as I get back into the swing of things is to address
Text::Format. In the interim, can you test with Text::Hyphen instead
of TeX::Hyphen? The hyphenation rules in Text::Hyphen for English are
a little more up-to-date, although this may not help. I will try to
figure this out and form it into a test case and fix the problem as I
put Text::Format 1.0.0 together.

For those people who are using Text::Format, I have a very important
question -- more people are using it than I had realised ;) I want to
change the initialisation idiom from the current "anything goes" to
either the form you presented or the currently-preferred
initialisation block that yields self (rather than using
instance_eval).

Are you okay if I make this change in Text::Format, or should I follow
the concepts of TeX::Hyphen » Text::Hyphen and make this Text::Format
» Text::Formatter?

-austin
 
W

Wybo Dekker

---1463811840-1518821199-1104796584=:17375
Content-Type: MULTIPART/MIXED; BOUNDARY="-1463811840-1518821199-1104796584=:17375"

This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.

---1463811840-1518821199-1104796584=:17375
Content-Type: TEXT/PLAIN; charset=X-UNKNOWN
Content-Transfer-Encoding: QUOTED-PRINTABLE

=20
I will look at this later this week. I am just back from a wonderful
vacation on the beaches of Cuba (got my hair braided and a wonderful
New Year's tan, thanks :)

missed your picture attached ;-((
and still have to finish rebuilding my main
development computer after a catastrophic hard drive crash (I haven't
yet installed Ruby on the machine, but it has finally been downloaded;
I just need to get the Windows build environment(s) set up that I will
be using).
=20
My plan as I get back into the swing of things is to address
Text::Format. In the interim, can you test with Text::Hyphen instead
of TeX::Hyphen? The hyphenation rules in Text::Hyphen for English are
a little more up-to-date, although this may not help. I will try to
figure this out and form it into a test case and fix the problem as I
put Text::Format 1.0.0 together.

Text::Hyphen has the same problem. But I don't think it has to do with
the hyphenation algorithm. It's independent of the words used, only on
their lengths.=20
=20
For those people who are using Text::Format, I have a very important
question -- more people are using it than I had realised ;) I want to
change the initialisation idiom from the current "anything goes" to
either the form you presented or the currently-preferred
initialisation block that yields self (rather than using
instance_eval).
=20
Are you okay if I make this change in Text::Format, or should I follow
the concepts of TeX::Hyphen =BB Text::Hyphen and make this Text::Format
=BB Text::Formatter?
=20
-austin
=20

--=20
Wybo
---1463811840-1518821199-1104796584=:17375--
---1463811840-1518821199-1104796584=:17375--
 
A

Austin Ziegler

I have fixed this, I think, but it's not yet in CVS. I am making more
extensive changes as part of Text::Format 1.0.0 that this will be a
part of.

-austin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
474,262
Messages
2,571,056
Members
48,769
Latest member
Clifft

Latest Threads

Top