Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > [ANN] text-hyphen 1.0.2 Released

Thread Tools

[ANN] text-hyphen 1.0.2 Released

Austin Ziegler
Posts: n/a
text-hyphen version 1.0.2 has been released!

* <>
* <>

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

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

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.


require 'text/hyphen'
hh =3D =3D> 'en_us', :left =3D> 2, :right =
=3D> 2)
# Defaults to the above
hh =3D

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=
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 =3D> 0, :right =3D> 0)
fr =3D =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=
Reply With Quote
Rüdiger Brahns
Posts: n/a
Very Nice! Is there anywhere a roadmap for 2.0?
Reply With Quote

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
Win XP wireless network adapter gets released and then connects ba =?Utf-8?B?cGkyMmJ5Nw==?= Wireless Networking 1 08-01-2008 08:33 PM
Battlefield 2 New Patch Released (yet Again...) Silverstrand Front Page News 4 07-20-2005 04:33 PM
*Mozilla Firefox 1.0.4 Released* Roland Firefox 4 05-13-2005 03:05 PM
Firefox 1.0.1 released Z Firefox 2 02-26-2005 04:11 AM
ANN: Anyplace Control 2.6 released Yura Goncharuk Wireless Networking 0 09-28-2004 10:13 AM