tex-hyphen 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog +19 -0
- data/INSTALL +6 -0
- data/README +14 -0
- data/Rakefile +116 -0
- data/bin/hyphen +99 -0
- data/lib/tex/hyphen/czech.rb +116 -0
- data/lib/tex/hyphen/german.rb +93 -0
- data/lib/tex/hyphen.rb +4717 -0
- data/tests/tc_tex_hyphen.rb +59 -0
- metadata +50 -0
@@ -0,0 +1,59 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# $Id: tc_tex_hyphen.rb,v 1.1 2004/11/29 21:26:42 austin Exp $
|
3
|
+
#++
|
4
|
+
|
5
|
+
$LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib") if __FILE__ == $0
|
6
|
+
|
7
|
+
require 'test/unit'
|
8
|
+
require 'tex/hyphen'
|
9
|
+
|
10
|
+
class TestTeX__Hyphen < Test::Unit::TestCase
|
11
|
+
WORDS = %w(additional declination going leaving maximizes multiple peter
|
12
|
+
playback presents programmable representation)
|
13
|
+
POINTS = [
|
14
|
+
[2, 4, 8], # additional
|
15
|
+
[], # declination
|
16
|
+
[2], # going
|
17
|
+
[4], # leaving
|
18
|
+
[3, 4], # maximize
|
19
|
+
[3, 5], # multiple
|
20
|
+
[2], # peter
|
21
|
+
[4], # playback
|
22
|
+
[], # presents
|
23
|
+
[3], # programmable
|
24
|
+
[3, 5, 8, 10] # representation
|
25
|
+
]
|
26
|
+
|
27
|
+
VISUAL = %w(ad-di-tion-al declination go-ing leav-ing max-i-mizes
|
28
|
+
mul-ti-ple pe-ter play-back presents pro-grammable
|
29
|
+
rep-re-sen-ta-tion)
|
30
|
+
|
31
|
+
HY_TO = [ %w(addi- tional), [nil, 'declination'], %w(go- ing),
|
32
|
+
%w(leav- ing), %w(maxi- mizes), %w(mul- tiple), %w(pe- ter),
|
33
|
+
%w(play- back), [nil, 'presents'], %w(pro- grammable),
|
34
|
+
%w(rep- resentation)]
|
35
|
+
|
36
|
+
def test_hyphenate
|
37
|
+
@r = []
|
38
|
+
a = TeX::Hyphen.new(:leftmin => 0, :rightmin => 0)
|
39
|
+
assert_nothing_raised { WORDS.each { |w| @r << a.hyphenate(w) } }
|
40
|
+
assert_equal(POINTS, @r)
|
41
|
+
WORDS.each { |w| assert_not_nil(a.instance_eval { @cache[w] }) }
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_visualise
|
45
|
+
@r = []
|
46
|
+
a = TeX::Hyphen.new { @min_left = 0; @min_right = 0 }
|
47
|
+
assert_nothing_raised { WORDS.each { |w| @r << a.visualise(w) } }
|
48
|
+
assert_equal(VISUAL, @r)
|
49
|
+
WORDS.each { |w| assert_not_nil(a.instance_eval { @vcache[w] }) }
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_hyphenate_to
|
53
|
+
@r = []
|
54
|
+
a = TeX::Hyphen.new(:min_left => 0, :min_right => 0)
|
55
|
+
assert_nothing_raised { WORDS.each { |w| @r << a.hyphenate_to(w, 5) } }
|
56
|
+
assert_equal(HY_TO, @r)
|
57
|
+
WORDS.each { |w| assert_not_nil(a.instance_eval { @cache[w] }) }
|
58
|
+
end
|
59
|
+
end
|
metadata
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
rubygems_version: 0.8.1
|
3
|
+
specification_version: 1
|
4
|
+
name: tex-hyphen
|
5
|
+
version: !ruby/object:Gem::Version
|
6
|
+
version: 0.4.0
|
7
|
+
date: 2004-12-09
|
8
|
+
summary: Hyphenates a word according to a TeX pattern file.
|
9
|
+
require_paths:
|
10
|
+
- lib
|
11
|
+
author: "Martin DeMello, Austin Ziegler"
|
12
|
+
email: text-format@halostatue.ca
|
13
|
+
homepage: http://rubyforge.org/projects/text-format/
|
14
|
+
rubyforge_project: text-format
|
15
|
+
description: ''
|
16
|
+
autorequire: tex/hyphen
|
17
|
+
default_executable:
|
18
|
+
bindir: bin
|
19
|
+
has_rdoc: true
|
20
|
+
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
21
|
+
requirements:
|
22
|
+
-
|
23
|
+
- ">"
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: 0.0.0
|
26
|
+
version:
|
27
|
+
platform: ruby
|
28
|
+
files:
|
29
|
+
- bin
|
30
|
+
- Changelog
|
31
|
+
- INSTALL
|
32
|
+
- lib
|
33
|
+
- Rakefile
|
34
|
+
- README
|
35
|
+
- tests
|
36
|
+
- bin/hyphen
|
37
|
+
- lib/tex
|
38
|
+
- lib/tex/hyphen
|
39
|
+
- lib/tex/hyphen.rb
|
40
|
+
- lib/tex/hyphen/czech.rb
|
41
|
+
- lib/tex/hyphen/german.rb
|
42
|
+
- tests/tc_tex_hyphen.rb
|
43
|
+
test_files:
|
44
|
+
- tests/tc_tex_hyphen.rb
|
45
|
+
rdoc_options: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
executables: []
|
48
|
+
extensions: []
|
49
|
+
requirements: []
|
50
|
+
dependencies: []
|