Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > text/format loops on long words

Reply
Thread Tools

text/format loops on long words

 
 
Wybo Dekker
Guest
Posts: n/a
 
      01-02-2005
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...
--
Wybo


 
Reply With Quote
 
 
 
 
Austin Ziegler
Guest
Posts: n/a
 
      01-03-2005
On Mon, 3 Jan 2005 03:21:09 +0900, Wybo Dekker <(E-Mail Removed)> wrote:
> 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
--
Austin Ziegler * http://www.velocityreviews.com/forums/(E-Mail Removed)
* Alternate: (E-Mail Removed)



 
Reply With Quote
 
 
 
 
Wybo Dekker
Guest
Posts: n/a
 
      01-03-2005
---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

On Mon, 3 Jan 2005, Austin Ziegler wrote:

> On Mon, 3 Jan 2005 03:21:09 +0900, Wybo Dekker <(E-Mail Removed)> wrote:
> > 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):
> >=20
> > #!/usr/bin/env ruby
> > require 'text/format'
> > require 'tex/hyphen'
> >=20
> > puts Text::Format.new(
> > :body_indent =3D> 15,
> > :columns =3D> 30,
> > :hyphenator =3D> TeX::Hyphen.new,
> > :split_rules =3D> Text::Format::SPLIT_HYPHENATION,
> > :hard_margins =3D> true,
> > :text =3D> "something pancakes electroencephalogram"
> > ).paragraphs
> >=20
> > I hope Austin Ziegler is looking...

>=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--


 
Reply With Quote
 
Austin Ziegler
Guest
Posts: n/a
 
      01-07-2005
On Tue, 4 Jan 2005 08:58:27 +0900, Wybo Dekker <(E-Mail Removed)> wrote:
> On Mon, 3 Jan 2005, Austin Ziegler wrote:
> > On Mon, 3 Jan 2005 03:21:09 +0900, Wybo Dekker <(E-Mail Removed)> wrote:
> > > 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):


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
--
Austin Ziegler * (E-Mail Removed)
* Alternate: (E-Mail Removed)


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Having compilation error: no match for call to ‘(const __gnu_cxx::hash<long long int>) (const long long int&)’ veryhotsausage C++ 1 07-04-2008 05:41 PM
Words Words utab C++ 6 02-16-2006 07:00 PM
Loops with loops using html-template Me Perl Misc 2 01-12-2006 05:07 PM
Non-noise words are incorrectly recognised as noise words. Peter Strøiman ASP .Net 1 08-23-2005 01:26 PM
Re: A little bit of help regarding my linked list program required. - "words.c" - "words.c" Richard Heathfield C Programming 7 10-05-2003 02:38 PM



Advertisments