tex-hyphen 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,26 @@
1
+ == TeX::Hyphen 0.5.0
2
+ * No, really, *this* is the final release.
3
+ * TeX::Hyphen will now properly handle non-lowercase hyphenation.
4
+ * The debugging output has been enabled on TeX::Hyphen::DEBUG, not the global
5
+ $DEBUG variable.
6
+ * Renamed bin/hyphen to bin/texhyphen.
7
+
8
+ == TeX::Hyphen 0.4.0
9
+ * This is the final release of TeX::Hyphen for Ruby. The next version will be
10
+ called Text::Hyphen and will provide significant enhancement to the
11
+ capabilities of hyphenation as well as an API change.
12
+ * Added bin/hyphen -- a program to demonstrate hyphenation.
13
+
14
+ == TeX::Hyphen 0.3.1
15
+ * Created a gemspec. Removed some unnecessary scaffolding code.
16
+
17
+ == TeX::Hyphen 0.3
18
+ * Added caching capabilities to both #hyphenate and #visualise.
19
+
20
+ == TeX::Hyphen 0.2
21
+ * Added TeX::Hyphen#hyphenate_to(word, size). This is in preparation for a
22
+ change to Text::Format for hyphenation of words. Created Test::Unit unit
23
+ tests.
24
+
25
+ == TeX::Hyphen 0.1
26
+ * Initial Ruby version by Martin DeMello.
data/Changelog CHANGED
@@ -1,3 +1,10 @@
1
+ == TeX::Hyphen 0.5.0
2
+ * No, really, *this* is the final release.
3
+ * TeX::Hyphen will now properly handle non-lowercase hyphenation.
4
+ * The debugging output has been enabled on TeX::Hyphen::DEBUG, not the global
5
+ $DEBUG variable.
6
+ * Renamed bin/hyphen to bin/texhyphen.
7
+
1
8
  == TeX::Hyphen 0.4.0
2
9
  * This is the final release of TeX::Hyphen for Ruby. The next version will be
3
10
  called Text::Hyphen and will provide significant enhancement to the
data/INSTALL CHANGED
@@ -3,4 +3,4 @@ Installing this package is as simple as:
3
3
  % ruby install.rb
4
4
 
5
5
  Alternatively, you can use the RubyGem version of TeX::Hyphen available as
6
- tex-hyphen-0.4.0.gem from the usual sources.
6
+ tex-hyphen-0.5.0.gem from the usual sources.
data/README CHANGED
@@ -1,4 +1,4 @@
1
- TeX::Hyphen 0.4.0
1
+ TeX::Hyphen 0.5.0
2
2
  Copyright � 2003 - 2004 Martin DeMello and Austin Ziegler
3
3
 
4
4
  Hyphenates a word according to a TeX pattern file (defaults to Donald E.
@@ -11,4 +11,4 @@ will now return from a cache.
11
11
  TeX::Hyphen is licensed under the same terms as Ruby or under the GPL version
12
12
  2, or later.
13
13
 
14
- This is the last version of TeX::Hyphen.
14
+ This is the last version of TeX::Hyphen. (No, really.)
@@ -4,7 +4,7 @@
4
4
  #
5
5
  # Licensed under the same terms as Ruby.
6
6
  #
7
- # $Id: hyphen,v 1.1 2004/12/10 03:56:54 austin Exp $
7
+ # $Id: texhyphen,v 1.1 2004/12/20 07:26:35 austin Exp $
8
8
  #++
9
9
 
10
10
  require 'optparse'
@@ -51,6 +51,10 @@ ARGV.options do |opt|
51
51
  $stderr.puts opt
52
52
  exit 0
53
53
  }
54
+ opt.on_tail('-v', '--version', 'Display the program and library version.') {
55
+ $stderr.puts "#{File.basename($0)} and TeX::Hyphen version #{TeX::Hyphen::VERSION}"
56
+ exit 0
57
+ }
54
58
  opt.parse!
55
59
  end
56
60
 
@@ -1,7 +1,5 @@
1
1
  # :title: TeX::Hyphen
2
2
  # :main: TeX::Hyphen
3
- $DEBUG ||= false;
4
-
5
3
  module TeX #:nodoc:
6
4
  # = Introduction
7
5
  # TeX::Hyphen -- hyphenate words using TeX's patterns
@@ -25,14 +23,16 @@ module TeX #:nodoc:
25
23
  # is used instead.
26
24
  #
27
25
  # Copyright:: Copyright (c) 2003 - 2004 Martin DeMello and Austin Ziegler
28
- # Version:: 0.4.0
26
+ # Version:: 0.5.0
29
27
  # Based On:: Perl's <tt>TeX::Hyphen</tt>
30
28
  # [http://search.cpan.org/author/JANPAZ/TeX-Hyphen-0.140/lib/TeX/Hyphen.pm]
31
29
  # Copyright (c) 1997 - 2002 Jan Pazdziora
32
30
  # Licence:: Ruby's
33
31
  #
34
32
  class Hyphen
35
- VERSION = '0.4.0'
33
+ DEBUG = false;
34
+
35
+ VERSION = '0.5.0'
36
36
 
37
37
  DEFAULT_MIN_LEFT = 2
38
38
  DEFAULT_MIN_RIGHT = 2
@@ -152,7 +152,8 @@ module TeX #:nodoc:
152
152
  # returns [3, 5, 8, 10]. If the word has been hyphenated previously, it
153
153
  # will be returned from a per-instance cache.
154
154
  def hyphenate(word)
155
- STDERR.puts "Hyphenating #{word}" if $DEBUG
155
+ word = word.downcase
156
+ STDERR.puts "Hyphenating #{word}" if DEBUG
156
157
  return @cache[word] if @cache.has_key?(word)
157
158
  res = @exception[word]
158
159
  return @cache[word] = make_result_list(res) if res
@@ -229,12 +230,12 @@ module TeX #:nodoc:
229
230
 
230
231
  def updateresult(hash, str, pos) #:nodoc:
231
232
  if hash.has_key?(str)
232
- STDERR.print "#{pos}: #{str}: #{hash[str]}" if $DEBUG
233
+ STDERR.print "#{pos}: #{str}: #{hash[str]}" if DEBUG
233
234
  hash[str].split('').each_with_index do |c, i|
234
235
  c = c.to_i
235
236
  @result[i + pos] = c if c > @result[i + pos]
236
237
  end
237
- STDERR.puts ": #{@result}" if $DEBUG
238
+ STDERR.puts ": #{@result}" if DEBUG
238
239
  end
239
240
  end
240
241
 
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.1
3
3
  specification_version: 1
4
4
  name: tex-hyphen
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.4.0
7
- date: 2004-12-09
6
+ version: 0.5.0
7
+ date: 2004-12-20
8
8
  summary: Hyphenates a word according to a TeX pattern file.
9
9
  require_paths:
10
10
  - lib
@@ -33,17 +33,26 @@ files:
33
33
  - Rakefile
34
34
  - README
35
35
  - tests
36
- - bin/hyphen
36
+ - bin/texhyphen
37
37
  - lib/tex
38
38
  - lib/tex/hyphen
39
39
  - lib/tex/hyphen.rb
40
40
  - lib/tex/hyphen/czech.rb
41
41
  - lib/tex/hyphen/german.rb
42
42
  - tests/tc_tex_hyphen.rb
43
+ - ChangeLog
43
44
  test_files:
44
45
  - tests/tc_tex_hyphen.rb
45
- rdoc_options: []
46
- extra_rdoc_files: []
46
+ rdoc_options:
47
+ - "--title"
48
+ - TeX::Hyphen
49
+ - "--main"
50
+ - README
51
+ - "--line-numbers"
52
+ extra_rdoc_files:
53
+ - README
54
+ - INSTALL
55
+ - ChangeLog
47
56
  executables: []
48
57
  extensions: []
49
58
  requirements: []