text/format loops on long words

Discussion in 'Ruby' started by Wybo Dekker, Jan 2, 2005.

  1. Wybo Dekker

    Wybo Dekker Guest

    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
    Wybo Dekker, Jan 2, 2005
    #1
    1. Advertising

  2. On Mon, 3 Jan 2005 03:21:09 +0900, Wybo Dekker <> 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 *
    * Alternate:
    Austin Ziegler, Jan 3, 2005
    #2
    1. Advertising

  3. Wybo Dekker

    Wybo Dekker Guest

    ---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 <> 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--
    Wybo Dekker, Jan 3, 2005
    #3
  4. On Tue, 4 Jan 2005 08:58:27 +0900, Wybo Dekker <> wrote:
    > On Mon, 3 Jan 2005, Austin Ziegler wrote:
    > > On Mon, 3 Jan 2005 03:21:09 +0900, Wybo Dekker <> 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 *
    * Alternate:
    Austin Ziegler, Jan 7, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. George Marsaglia

    Assigning unsigned long to unsigned long long

    George Marsaglia, Jul 8, 2003, in forum: C Programming
    Replies:
    1
    Views:
    661
    Eric Sosman
    Jul 8, 2003
  2. Daniel Rudy

    unsigned long long int to long double

    Daniel Rudy, Sep 19, 2005, in forum: C Programming
    Replies:
    5
    Views:
    1,179
    Peter Shaggy Haywood
    Sep 20, 2005
  3. Mathieu Dutour

    long long and long

    Mathieu Dutour, Jul 17, 2007, in forum: C Programming
    Replies:
    4
    Views:
    463
    santosh
    Jul 24, 2007
  4. Bart C

    Use of Long and Long Long

    Bart C, Jan 9, 2008, in forum: C Programming
    Replies:
    27
    Views:
    784
    Peter Nilsson
    Jan 15, 2008
  5. Me
    Replies:
    2
    Views:
    230
Loading...

Share This Page