text-hyphen 1.0.2 → 1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. data/.gemtest +0 -0
  2. data/History.rdoc +54 -0
  3. data/License.rdoc +159 -0
  4. data/Manifest.txt +67 -5
  5. data/README.rdoc +69 -0
  6. data/Rakefile +8 -4
  7. data/bin/{hyphen → ruby-hyphen} +0 -0
  8. data/lib/text-hyphen.rb +1 -0
  9. data/lib/text/hyphen.rb +74 -111
  10. data/lib/text/hyphen/language.rb +90 -26
  11. data/lib/text/hyphen/language/1.8/ca.rb +171 -0
  12. data/lib/text/hyphen/language/1.8/cs.rb +360 -0
  13. data/lib/text/hyphen/language/1.8/da.rb +117 -0
  14. data/lib/text/hyphen/language/1.8/de1.rb +718 -0
  15. data/lib/text/hyphen/language/1.8/de2.rb +680 -0
  16. data/lib/text/hyphen/language/1.8/en_uk.rb +789 -0
  17. data/lib/text/hyphen/language/1.8/en_us.rb +490 -0
  18. data/lib/text/hyphen/language/1.8/es.rb +287 -0
  19. data/lib/text/hyphen/language/1.8/et.rb +335 -0
  20. data/lib/text/hyphen/language/1.8/eu.rb +112 -0
  21. data/lib/text/hyphen/language/1.8/fi.rb +112 -0
  22. data/lib/text/hyphen/language/1.8/fr.rb +389 -0
  23. data/lib/text/hyphen/language/1.8/ga.rb +606 -0
  24. data/lib/text/hyphen/language/1.8/hr.rb +122 -0
  25. data/lib/text/hyphen/language/1.8/hsb.rb +179 -0
  26. data/lib/text/hyphen/language/1.8/hu1.rb +380 -0
  27. data/lib/text/hyphen/language/1.8/hu2.rb +1278 -0
  28. data/lib/text/hyphen/language/1.8/ia.rb +71 -0
  29. data/lib/text/hyphen/language/1.8/id.rb +91 -0
  30. data/lib/text/hyphen/language/1.8/is.rb +387 -0
  31. data/lib/text/hyphen/language/1.8/it.rb +133 -0
  32. data/lib/text/hyphen/language/1.8/la.rb +132 -0
  33. data/lib/text/hyphen/language/1.8/mn.rb +101 -0
  34. data/lib/text/hyphen/language/1.8/nl.rb +1250 -0
  35. data/lib/text/hyphen/language/1.8/no1.rb +299 -0
  36. data/lib/text/hyphen/language/1.8/no2.rb +134 -0
  37. data/lib/text/hyphen/language/1.8/pl.rb +478 -0
  38. data/lib/text/hyphen/language/1.8/pt.rb +54 -0
  39. data/lib/text/hyphen/language/1.8/sv.rb +447 -0
  40. data/lib/text/hyphen/language/1.9/ca.rb +174 -0
  41. data/lib/text/hyphen/language/1.9/cs.rb +361 -0
  42. data/lib/text/hyphen/language/1.9/da.rb +117 -0
  43. data/lib/text/hyphen/language/1.9/de1.rb +719 -0
  44. data/lib/text/hyphen/language/1.9/de2.rb +682 -0
  45. data/lib/text/hyphen/language/1.9/en_uk.rb +791 -0
  46. data/lib/text/hyphen/language/1.9/en_us.rb +492 -0
  47. data/lib/text/hyphen/language/1.9/es.rb +289 -0
  48. data/lib/text/hyphen/language/1.9/et.rb +336 -0
  49. data/lib/text/hyphen/language/1.9/eu.rb +114 -0
  50. data/lib/text/hyphen/language/1.9/fi.rb +113 -0
  51. data/lib/text/hyphen/language/1.9/fr.rb +391 -0
  52. data/lib/text/hyphen/language/1.9/ga.rb +608 -0
  53. data/lib/text/hyphen/language/1.9/hr.rb +123 -0
  54. data/lib/text/hyphen/language/1.9/hsb.rb +180 -0
  55. data/lib/text/hyphen/language/1.9/hu1.rb +382 -0
  56. data/lib/text/hyphen/language/1.9/hu2.rb +1280 -0
  57. data/lib/text/hyphen/language/1.9/ia.rb +73 -0
  58. data/lib/text/hyphen/language/1.9/id.rb +93 -0
  59. data/lib/text/hyphen/language/1.9/is.rb +388 -0
  60. data/lib/text/hyphen/language/1.9/it.rb +134 -0
  61. data/lib/text/hyphen/language/1.9/la.rb +134 -0
  62. data/lib/text/hyphen/language/1.9/mn.rb +102 -0
  63. data/lib/text/hyphen/language/1.9/nl.rb +1252 -0
  64. data/lib/text/hyphen/language/1.9/no1.rb +301 -0
  65. data/lib/text/hyphen/language/1.9/no2.rb +136 -0
  66. data/lib/text/hyphen/language/1.9/pl.rb +479 -0
  67. data/lib/text/hyphen/language/1.9/pt.rb +55 -0
  68. data/lib/text/hyphen/language/1.9/sv.rb +449 -0
  69. data/lib/text/hyphen/language/ca.rb +3 -173
  70. data/lib/text/hyphen/language/cs.rb +3 -362
  71. data/lib/text/hyphen/language/da.rb +3 -117
  72. data/lib/text/hyphen/language/de.rb +1 -0
  73. data/lib/text/hyphen/language/de1.rb +3 -724
  74. data/lib/text/hyphen/language/de2.rb +3 -685
  75. data/lib/text/hyphen/language/en_uk.rb +3 -790
  76. data/lib/text/hyphen/language/en_us.rb +3 -492
  77. data/lib/text/hyphen/language/es.rb +3 -288
  78. data/lib/text/hyphen/language/et.rb +3 -336
  79. data/lib/text/hyphen/language/eu.rb +3 -114
  80. data/lib/text/hyphen/language/fi.rb +3 -112
  81. data/lib/text/hyphen/language/fr.rb +3 -391
  82. data/lib/text/hyphen/language/ga.rb +3 -607
  83. data/lib/text/hyphen/language/hr.rb +3 -123
  84. data/lib/text/hyphen/language/hsb.rb +2 -179
  85. data/lib/text/hyphen/language/hu.rb +1 -0
  86. data/lib/text/hyphen/language/hu1.rb +3 -384
  87. data/lib/text/hyphen/language/hu2.rb +3 -1282
  88. data/lib/text/hyphen/language/ia.rb +3 -72
  89. data/lib/text/hyphen/language/id.rb +3 -96
  90. data/lib/text/hyphen/language/is.rb +3 -389
  91. data/lib/text/hyphen/language/it.rb +3 -134
  92. data/lib/text/hyphen/language/la.rb +3 -133
  93. data/lib/text/hyphen/language/mn.rb +3 -102
  94. data/lib/text/hyphen/language/ms.rb +9 -0
  95. data/lib/text/hyphen/language/nl.rb +3 -1252
  96. data/lib/text/hyphen/language/no.rb +1 -0
  97. data/lib/text/hyphen/language/no1.rb +3 -302
  98. data/lib/text/hyphen/language/no2.rb +3 -137
  99. data/lib/text/hyphen/language/pl.rb +3 -479
  100. data/lib/text/hyphen/language/pt.rb +3 -55
  101. data/lib/text/hyphen/language/sv.rb +3 -448
  102. data/test/data/bug_9807_latin1.rb +10 -0
  103. data/test/data/bug_9807_utf-8.rb +10 -0
  104. data/test/test_bugs.rb +14 -4
  105. data/test/test_text_hyphen.rb +3 -3
  106. data/text-hyphen.gemspec +29 -29
  107. metadata +101 -40
  108. data/COPYING.txt +0 -339
  109. data/History.txt +0 -23
  110. data/LICENCE.txt +0 -47
  111. data/README.txt +0 -82
@@ -1,23 +0,0 @@
1
- == 1.0.2 / unreleased
2
- * Moved to 'hoe' and GitHub.
3
- * Preparing for 2.0 which will be Ruby 1.9-only for UTF-8.
4
- * Fixing German support (RubyForge 28498):
5
- * Choosing 'de' as a language will load 'de1'. Choosing 'de1' or 'de2' will
6
- load properly now, but they will be reported with an ISO language code of
7
- 'de' (new optional #isocode attribute on a language definition that will
8
- override the #iso_language setting of a Text::Hyphen instance if set).
9
- * Both 'de1' and 'de2' can be loaded simultaneously now, but the first one
10
- loaded will claim the Text::Hyphen::Language::DE constant.
11
- * Added test cases for bugs:
12
- * RubyForge 9807 (cannot reproduce)
13
- * RubyForge 28128 (cannot reproduce)
14
- * RubyForge 28498
15
-
16
- == 1.0.1
17
- * Minor modification to the RubyGem release of Text::Hyphen to enable the
18
- hyphen command-line program.
19
-
20
- == 1.0.0
21
- * Initial version based on TeX::Hyphen 0.4.0 (some changes have been
22
- backported to TeX::Hyphen 0.5.0).
23
- * Incorporated many hyphenation pattern files from CTAN.
@@ -1,47 +0,0 @@
1
- Text::Hyphen is copyright (c) 2004 - 2005 Austin Ziegler
2
-
3
- Licensing for Text::Hyphen is unfortunately complex because of the various
4
- copyrights and licences of the source hyphenation files. Some of these files
5
- are available only under the TeX licence and others are available only under
6
- the GNU GPL while others are public domain. Each language file has these
7
- licences embedded within the file. Please consult each file's licence to
8
- ensure that it is compatible with your application.
9
-
10
- The copyright on the Text::Hyphen application/library and the Ruby
11
- translations of hyphenation files belongs to Austin Ziegler. All other
12
- copyrights on original versions still stand; Text::Hyphen is a derivative work
13
- of these and other projects.
14
-
15
- Application and Compilation Licences
16
- ------------------------------------
17
- Text::Hyphen, the application/library is licensed under the same terms as
18
- Ruby. Note that this specifically refers to the contents of bin/hyphen,
19
- lib/text/hyphen.rb, and lib/text/hyphen/language.rb.
20
-
21
- Individual language hyphenation files are NOT licensed under these terms, but
22
- under the following MIT-style licence and the original hyphenation pattern
23
- licenses. The copyright for the original TeX hyphenation files is held by the
24
- original authors; any mistakes in conversion of these files to Ruby is
25
- attributable to the contributors to the Text::Hyphen package only.
26
-
27
- The compilation package Text::Hyphen is licensed under the same terms as Ruby.
28
-
29
- Blanket Language Hyphenation File Licence
30
- -----------------------------------------
31
- Permission is hereby granted, free of charge, to any person obtaining a copy
32
- of this software and associated documentation files (the "Software"), to deal
33
- in the Software without restriction, including without limitation the rights
34
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
35
- copies of the Software, and to permit persons to whom the Software is
36
- furnished to do so, subject to the following conditions:
37
-
38
- The above copyright notice and this permission notice shall be included in all
39
- copies or substantial portions of the Software.
40
-
41
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
42
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
43
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
44
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
45
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
46
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
47
- SOFTWARE.
data/README.txt DELETED
@@ -1,82 +0,0 @@
1
- == text-hyphen
2
-
3
- http://rubyforge.org/projects/text-format/
4
- http://github.com/halostatue/text-hyphen/
5
-
6
- == DESCRIPTION:
7
-
8
- Text::Hyphen will hyphenate words using modified versions of TeX hyphenation
9
- patterns.
10
-
11
- Text::Hyphen will properly hyphenate various words according to the rules of
12
- the language the word is written in. The algorithm is based on that of the TeX
13
- typesetting system by Donald E. Knuth. This is based on the Perl implementation
14
- of TeX::Hyphen[1] and the Ruby port[2]. The language hyphenation pattern files
15
- are based on the sources available from CTAN[3] as of 2004.12.19 and have been
16
- translated by Austin Ziegler.
17
-
18
- This release is 1.0.2. It is a minor bugfix for the RubyGem release of
19
- Text::Hyphen to enable the hyphen command-line program. Text::Hyphen represents
20
- a significant improvement over its predecessor, TeX::Hyphen.
21
-
22
- == SYNOPSIS:
23
-
24
- require 'text/hyphen'
25
- hh = Text::Hyphen.new(:language => 'en_us', :left => 2, :right => 2)
26
- # Defaults to the above
27
- hh = TeX::Hyphen.new
28
-
29
- word = "representation"
30
- points = hyp.hyphenate(word) #=> [3, 5, 8, 10]
31
- puts hyp.visualize(word) #=> rep-re-sen-ta-tion
32
-
33
- Text::Hyphen is truly multilingual[4]. As an example, consider the difference
34
- between the following:
35
-
36
- require 'text/hyphen'
37
- # Using left and right minimum values of 0 ensures that you will
38
- # see all possible hyphenation points, not just those that meet
39
- # the minimum width requirements.
40
- en = Text::Hyphen.new(:left => 0, :right => 0)
41
- fr = Text::Hyphen.new(:language = "fr", :left => 0, :right => 0)
42
-
43
- puts en.visualise("organiser") #=> or-gan-iser
44
- puts fr.visualise("organiser") #=> or-ga-ni-ser
45
-
46
- As you can see, the hyphenation is distinct between the two hyphenators.
47
- Additional improvements over TeX::Hyphen include thread safety (except for
48
- debug control) and (minimal) support for UTF-8.
49
-
50
- == FUTURE ENHANCEMENTS:
51
-
52
- * Ruby 1.9 compatibility.
53
-
54
- == INSTALL:
55
-
56
- * This release of text-hyphen is only installed with RubyGems.
57
-
58
- == DEVELOPERS:
59
-
60
- After checking out the source, run:
61
-
62
- $ rake newb
63
-
64
- This task will install any missing dependencies, run the tests/specs,
65
- and generate the RDoc.
66
-
67
- == LICENSE:
68
-
69
- The licensing for Text::Hyphen is complex and somewhat dependent upon the
70
- languages being used during hyphenation; some languages are held under a more
71
- strict licence than that granted in the LICENCE file.
72
-
73
- Copyright 2004 - 2005 Austin Ziegler <austin@rubyforge.org>
74
- See the LICENCE.txt file for more information.
75
-
76
- [1] <http://search.cpan.org/author/JANPAZ/TeX-Hyphen-0.140/lib/TeX/Hyphen.pm>
77
- Maintained by Jan Pazdziora.
78
- [2] Available at <http://rubyforge.org/projects/text-format>.
79
- [3] <http://www.ctan.org>
80
- [4] There are some bugs and design decisions in the original Perl
81
- implementation of TeX::Hyphen that make it unsuitable for most multilingual
82
- implementations that carried over to the Ruby port of TeX::Hyphen.