[ANN] text-hyphen 1.0.2 Released

A

Austin Ziegler

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=
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top