[ANN] text-hyphen 1.0.2 Released

Discussion in 'Ruby' started by Austin Ziegler, Feb 9, 2011.

  1. text-hyphen version 1.0.2 has been released!

    * <http://rubyforge.org/projects/text-format/>
    * <http://github.com/halostatue/text-hyphen/>

    Text::Hyphen will hyphenate words using modified versions of TeX
    hyphenation patterns.

    NOTE:
    This version is NOT compatible with Ruby 1.9. Text::Hyphen version 2
    (which will be started soon) will be converting 100% to UTF-8 and will
    not have compatibility with Ruby 1.8.

    Text::Hyphen will properly hyphenate various words according to the
    rules of the language the word is written in. The algorithm is based on
    that of the TeX typesetting system by Donald E. Knuth. This is based on
    the Perl implementation of TeX::Hyphen[1] and the Ruby port[2]. The
    language hyphenation pattern files are based on the sources available
    from CTAN[3] as of 2004.12.19 and have been translated by Austin
    Ziegler.

    This release is 1.0.2. It is a minor bugfix for the RubyGem release of
    Text::Hyphen to enable the hyphen command-line program. Text::Hyphen
    represents a significant improvement over its predecessor, TeX::Hyphen.

    Synopsis:

    require 'text/hyphen'
    hh =3D Text::Hyphen.new:)language =3D> 'en_us', :left =3D> 2, :right =
    =3D> 2)
    # Defaults to the above
    hh =3D TeX::Hyphen.new

    word =3D "representation"
    points =3D hyp.hyphenate(word) #=3D> [3, 5, 8, 10]
    puts hyp.visualize(word) #=3D> rep-re-sen-ta-tion

    Text::Hyphen is truly multilingual[4]. As an example, consider the differen=
    ce
    between the following:

    require 'text/hyphen'
    # Using left and right minimum values of 0 ensures that you will
    # see all possible hyphenation points, not just those that meet
    # the minimum width requirements.
    en =3D Text::Hyphen.new:)left =3D> 0, :right =3D> 0)
    fr =3D Text::Hyphen.new:)language =3D "fr", :left =3D> 0, :right =3D> 0=
    )

    puts en.visualise("organiser") #=3D> or-gan-iser
    puts fr.visualise("organiser") #=3D> or-ga-ni-ser

    As you can see, the hyphenation is distinct between the two hyphenators.
    Additional improvements over TeX::Hyphen include thread safety (except for
    debug control) and (minimal) support for UTF-8.

    Bugs should be reported on the RubyForge project or on my GitHub repository=
    Austin Ziegler, Feb 9, 2011
    #1
    1. Advertising

  2. Very Nice! Is there anywhere a roadmap for 2.0?
    Rüdiger Brahns, Mar 5, 2011
    #2
    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. mm
    Replies:
    1
    Views:
    6,066
  2. Gilbert Saint-Flour

    non-breakable hyphen

    Gilbert Saint-Flour, May 17, 2004, in forum: HTML
    Replies:
    2
    Views:
    1,844
    Philipp Lenssen
    May 17, 2004
  3. Joe Stateson
    Replies:
    3
    Views:
    412
    Joe Stateson
    Oct 25, 2007
  4. Austin Ziegler

    [ANN] TeX::Hyphen 0.4.0

    Austin Ziegler, Dec 10, 2004, in forum: Ruby
    Replies:
    0
    Views:
    110
    Austin Ziegler
    Dec 10, 2004
  5. Patrick Gundlach

    text::hyphen german dictionary

    Patrick Gundlach, Apr 22, 2006, in forum: Ruby
    Replies:
    0
    Views:
    88
    Patrick Gundlach
    Apr 22, 2006
Loading...

Share This Page