text-hyphen 1.4.1 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +7 -0
  2. data/.standard.yml +5 -0
  3. data/Code-of-Conduct.md +73 -0
  4. data/Contributing.md +68 -0
  5. data/History.md +139 -0
  6. data/Licence.md +159 -0
  7. data/Manifest.txt +12 -5
  8. data/README.md +81 -0
  9. data/Rakefile +68 -19
  10. data/bin/ruby-hyphen +0 -0
  11. data/lib/text/hyphen/language/1.8/de1.rb +1307 -571
  12. data/lib/text/hyphen/language/1.8/en_us.rb +412 -453
  13. data/lib/text/hyphen/language/1.8/fr.rb +128 -334
  14. data/lib/text/hyphen/language/1.8/la.rb +1 -0
  15. data/lib/text/hyphen/language/1.8/lt.rb +115 -0
  16. data/lib/text/hyphen/language/1.8/pt.rb +2 -1
  17. data/lib/text/hyphen/language/1.8/sk.rb +277 -0
  18. data/lib/text/hyphen/language/1.9/ca.rb +2 -1
  19. data/lib/text/hyphen/language/1.9/cs.rb +2 -1
  20. data/lib/text/hyphen/language/1.9/da.rb +2 -1
  21. data/lib/text/hyphen/language/1.9/de1.rb +1382 -646
  22. data/lib/text/hyphen/language/1.9/de2.rb +110 -109
  23. data/lib/text/hyphen/language/1.9/en_uk.rb +2 -1
  24. data/lib/text/hyphen/language/1.9/en_us.rb +412 -454
  25. data/lib/text/hyphen/language/1.9/es.rb +2 -1
  26. data/lib/text/hyphen/language/1.9/et.rb +6 -5
  27. data/lib/text/hyphen/language/1.9/eu.rb +4 -3
  28. data/lib/text/hyphen/language/1.9/fi.rb +3 -2
  29. data/lib/text/hyphen/language/1.9/fr.rb +136 -343
  30. data/lib/text/hyphen/language/1.9/ga.rb +27 -26
  31. data/lib/text/hyphen/language/1.9/hr.rb +6 -5
  32. data/lib/text/hyphen/language/1.9/hsb.rb +3 -2
  33. data/lib/text/hyphen/language/1.9/hu1.rb +3 -2
  34. data/lib/text/hyphen/language/1.9/hu2.rb +5 -4
  35. data/lib/text/hyphen/language/1.9/ia.rb +2 -1
  36. data/lib/text/hyphen/language/1.9/id.rb +8 -7
  37. data/lib/text/hyphen/language/1.9/is.rb +2 -1
  38. data/lib/text/hyphen/language/1.9/it.rb +74 -74
  39. data/lib/text/hyphen/language/1.9/la.rb +54 -53
  40. data/lib/text/hyphen/language/1.9/lt.rb +116 -0
  41. data/lib/text/hyphen/language/1.9/mn.rb +7 -6
  42. data/lib/text/hyphen/language/1.9/nl.rb +2 -1
  43. data/lib/text/hyphen/language/1.9/no1.rb +3 -2
  44. data/lib/text/hyphen/language/1.9/no2.rb +3 -2
  45. data/lib/text/hyphen/language/1.9/pl.rb +2 -1
  46. data/lib/text/hyphen/language/1.9/pt.rb +3 -2
  47. data/lib/text/hyphen/language/1.9/ru.rb +2 -1
  48. data/lib/text/hyphen/language/1.9/sk.rb +280 -0
  49. data/lib/text/hyphen/language/1.9/sv.rb +4 -3
  50. data/lib/text/hyphen/language/cs.rb +1 -1
  51. data/lib/text/hyphen/language/de.rb +2 -1
  52. data/lib/text/hyphen/language/de1.rb +1 -1
  53. data/lib/text/hyphen/language/de2.rb +1 -1
  54. data/lib/text/hyphen/language/en_us.rb +1 -1
  55. data/lib/text/hyphen/language/eu.rb +1 -1
  56. data/lib/text/hyphen/language/fr.rb +1 -1
  57. data/lib/text/hyphen/language/hu.rb +1 -1
  58. data/lib/text/hyphen/language/hu1.rb +1 -1
  59. data/lib/text/hyphen/language/hu2.rb +1 -1
  60. data/lib/text/hyphen/language/is.rb +1 -1
  61. data/lib/text/hyphen/language/lt.rb +4 -0
  62. data/lib/text/hyphen/language/ms.rb +3 -3
  63. data/lib/text/hyphen/language/nl.rb +1 -1
  64. data/lib/text/hyphen/language/no.rb +1 -1
  65. data/lib/text/hyphen/language/sk.rb +4 -0
  66. data/lib/text/hyphen/language.rb +45 -45
  67. data/lib/text/hyphen.rb +139 -97
  68. data/lib/text-hyphen.rb +1 -1
  69. data/test/data/bug_9807_latin1.rb +2 -2
  70. data/test/data/bug_9807_utf-8.rb +1 -1
  71. data/test/test_bugs.rb +14 -13
  72. data/test/test_text_hyphen.rb +31 -21
  73. metadata +146 -96
  74. data/.autotest +0 -23
  75. data/.gemtest +0 -0
  76. data/History.rdoc +0 -99
  77. data/License.rdoc +0 -159
  78. data/README.rdoc +0 -95
  79. data/text-hyphen.gemspec +0 -51
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 6691be16764f973315c67ddd1da98d90bfe79921546b519d2d0eeac65ec4b9c2
4
+ data.tar.gz: b5c789b5d5e18db0e1408f7de1c24b5ad2431594edd8311a263b0ae093ef96ad
5
+ SHA512:
6
+ metadata.gz: b921231d274be4e5c614ddf038edd6f701d4693853eaf72a572827f3052cab456f98e6416ad751b8266b8eb59e92f298c00659f875e267ab0968b1ecab6fa3ba
7
+ data.tar.gz: 4608df3088f90f42af612eb01b947d28cd98be40eb393d64d812f3044c5026257066290efe46423351d3fe2688c11895f343280541a02efc04aadacbfd8a10ef
data/.standard.yml ADDED
@@ -0,0 +1,5 @@
1
+ parallel: true
2
+ ruby_version: 1.8
3
+ ignore:
4
+ - '*.gemspec'
5
+ - 'lib/text/hyphen/language/1.8/*.rb'
@@ -0,0 +1,73 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, sex characteristics, gender identity and expression,
9
+ level of experience, education, socio-economic status, nationality, personal
10
+ appearance, race, religion, or sexual identity and orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ - Using welcoming and inclusive language
18
+ - Being respectful of differing viewpoints and experiences
19
+ - Gracefully accepting constructive criticism
20
+ - Focusing on what is best for the community
21
+ - Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ - The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ - Trolling, insulting/derogatory comments, and personal or political attacks
28
+ - Public or private harassment
29
+ - Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ - Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72
+
73
+ [homepage]: https://www.contributor-covenant.org
data/Contributing.md ADDED
@@ -0,0 +1,68 @@
1
+ # Contributing
2
+
3
+ I value any contribution to text-hyphen you can provide: a bug report, a feature
4
+ request, or code contributions.
5
+
6
+ There are a few guidelines for contributing to text-hyphen:
7
+
8
+ - Code changes _will_ _not_ be accepted without tests. The test suite is
9
+ written with test/unit and will be eventually moved to [minitest][].
10
+ - Match my coding style.
11
+ - Use a thoughtfully-named topic branch that contains your change. Rebase your
12
+ commits into logical chunks as necessary.
13
+ - Use [quality commit messages][].
14
+ - Do not change the version number; when your patch is accepted and a release
15
+ is made, the version will be updated at that point.
16
+ - Submit a GitHub pull request with your changes.
17
+ - New or changed behaviours require new or updated documentation.
18
+
19
+ ### Test Dependencies
20
+
21
+ text-hyphen uses Ryan Davis’s [Hoe][] to manage the release process, and it adds
22
+ a number of rake tasks. You will mostly be interested in `rake`, which runs the
23
+ tests the same way that `rake test` will do.
24
+
25
+ To assist with the installation of the development dependencies for text-hyphen,
26
+ I have provided the simplest possible Gemfile pointing to the (generated)
27
+ `text-hyphen.gemspec` file. This will permit you to do `bundle install` to get
28
+ the development dependencies. If you already have `hoe` installed, you can
29
+ accomplish the same thing with `rake newb`.
30
+
31
+ This task will install any missing dependencies, run the tests/specs, and
32
+ generate the RDoc.
33
+
34
+ You can run tests with code coverage analysis by running `rake test:coverage`.
35
+
36
+ ## Workflow
37
+
38
+ Here's the most direct way to get your work merged into the project:
39
+
40
+ - Fork the project.
41
+ - Clone down your fork (`git clone git://github.com/<username>/text-hyphen.git`).
42
+ - Create a topic branch to contain your change (`git checkout -b my_awesome_feature`).
43
+ - Hack away, add tests. Not necessarily in that order.
44
+ - Make sure everything still passes by running `rake`.
45
+ - If necessary, rebase your commits into logical chunks, without errors.
46
+ - Push the branch up (`git push origin my_awesome_feature`).
47
+ - Create a pull request against halostatue/text-hyphen and describe what
48
+ your change does and the why you think it should be merged.
49
+
50
+ ## Contributors
51
+
52
+ - Austin Ziegler created text-hyphen based on TeX::Hyphen by Martin DeMello.
53
+
54
+ Thanks to everyone else who has contributed to text-hyphen over the years:
55
+
56
+ - anes hodza
57
+ - Cezary Baginsky
58
+ - Dmitry Lihachev
59
+ - Kirill Maksimov
60
+ - @hadmut
61
+ - Markus (@doits)
62
+ - Martin DeMello
63
+ - Pavol Sopko
64
+ - Petras Kudaras
65
+
66
+ [minitest]: https://github.com/seattlerb/minitest
67
+ [quality commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
68
+ [hoe]: https://github.com/seattlerb/hoe
data/History.md ADDED
@@ -0,0 +1,139 @@
1
+ # Changelog
2
+
3
+ ## 1.5.0 / 2023-03-18
4
+
5
+ - 1 new feature:
6
+
7
+ - anes hodza added support for phrase hyphenation in [#20][].
8
+
9
+ - New hyphenation patterns:
10
+
11
+ - Pavol Sopko added Slovak hyphenation in [#12][] in 2014.
12
+
13
+ - Petras Kudaras added Lithuanian hyphenation in [#14][] in 2015.
14
+
15
+ - Updated hyphenation patterns:
16
+
17
+ - Markus (@doits) updated German, English (US), and French hyphenations in 2016.
18
+
19
+ - minor updates:
20
+
21
+ - Removed unused private methods
22
+
23
+ - Governance changes:
24
+
25
+ - Added Contributor Covenant 1.4.
26
+
27
+ - Switched to GitHub Actions.
28
+
29
+ - Switched to Standard Ruby.
30
+
31
+ - Development changes:
32
+
33
+ - The gem should install on all older version of Ruby, but as I am building
34
+ with Ruby 2.7, I cannot guarantee full compatibility.
35
+
36
+ ## 1.4.1 / 2012.08.27
37
+
38
+ - 1 bug fix:
39
+
40
+ - Evgeny Lapin (<https://github.com/jenkek>) pointed out that I forgot to
41
+ include the new Russian-language hyphenation files, breaking the gem for use
42
+ with Russian. Oops.
43
+
44
+ ## 1.4 / 2012.08.25
45
+
46
+ - 1 enhancement:
47
+
48
+ - Kirill Maksimov (<https://github.com/netoneko>) added Russian-language
49
+ hyphenation, complete with test. Thanks! In Ruby 1.8, the encoding is
50
+ KOI8-R. Also submitted by Dmitry Lihachev (<https://github.com/lda>).
51
+
52
+ - 1 bug fix:
53
+
54
+ - Visualization with hyphens larger than one character (such as the HTML
55
+ soft-hyphen entity) would not be correct; this has been resolved. Thanks to
56
+ hadmut (<https://github.com/hadmut>) for reporting this issue.
57
+
58
+ ## 1.3 / 2012.06.20
59
+
60
+ - 2 enhancements:
61
+
62
+ - Cezary Baginsky (https://github.com/e2) added the ability to specify a
63
+ hyphen character (such as the HTML soft-hyphen entity) instead of always
64
+ using the dash-hyphen.
65
+
66
+ - Added a new option to bin/ruby-hyphen to support the new feature.
67
+
68
+ - 1 bug fix:
69
+
70
+ - `bin/ruby-hyphen` didn't work when visualizing to a size. Fixed.
71
+
72
+ ## 1.2.1 / 2012.04.05
73
+
74
+ - 1 documentation update:
75
+
76
+ - Fixed some typos in the README
77
+
78
+ - Versions tested previously should continue to work. Versions not currently
79
+ tested were not installed on the test system.
80
+
81
+ ## 1.2 / 2011.07.17
82
+
83
+ - 1 major enhancement:
84
+
85
+ - This release supports Ruby 1.9 with UTF-8 encodings. The language files are
86
+ duplicated for both Ruby 1.8 and 1.9 and the correct version is loaded based
87
+ on RUBY_VERSION.
88
+
89
+ - 3 minor enhancements:
90
+
91
+ - Making Hungarian and Norwegian language files act like the German language
92
+ files (both of these languages have two alternative hyphenation tables).
93
+
94
+ - Added a Malasy language file that should work correctly.
95
+
96
+ - Cleaned up the documentation.
97
+
98
+ - 1 bug fix:
99
+
100
+ - Fixed 9807 and 28128 (previously noted as not reproducible; quality
101
+ reproduction cases were found).
102
+
103
+ - Governance changes:
104
+
105
+ - Relicensing the core library to the MIT license and attempting to clarify
106
+ the license situation.
107
+
108
+ - Renaming hyphen to ruby-hyphen.
109
+
110
+ - This is the final release compatible with Ruby 1.8, first release
111
+ compatible with Ruby 1.9.
112
+
113
+ ## 1.0.2 / 2011.02.09
114
+
115
+ - Moved to 'hoe' and GitHub.
116
+
117
+ - Preparing for 2.0 which will be Ruby 1.9-only for UTF-8.
118
+
119
+ - Fixing German support (RubyForge 28498):
120
+
121
+ - Choosing 'de' as a language will load 'de1'. Choosing 'de1' or 'de2' will
122
+ load properly now, but they will be reported with an ISO language code of
123
+ 'de' (new optional #isocode attribute on a language definition that will
124
+ override the #iso_language setting of a Text::Hyphen instance if set).
125
+
126
+ - Both 'de1' and 'de2' can be loaded simultaneously now, but the first one
127
+ loaded will claim the Text::Hyphen::Language::DE constant.
128
+
129
+ ## 1.0.1
130
+
131
+ - Minor modification to the RubyGem release of Text::Hyphen to enable the
132
+ hyphen command-line program.
133
+
134
+ ## 1.0.0
135
+
136
+ - Initial version based on TeX::Hyphen 0.4.0 (some changes have been
137
+ backported to TeX::Hyphen 0.5.0).
138
+
139
+ - Incorporated many hyphenation pattern files from CTAN.
data/Licence.md ADDED
@@ -0,0 +1,159 @@
1
+ # Licence
2
+
3
+ Licensing for Text::Hyphen is unfortunately complex because of the various
4
+ copyrights and licenses of the source hyphenation files that have been converted
5
+ to Ruby format. Some of these files are available only under the TeX license and
6
+ others are available only under the GNU GPL while others are public domain. Each
7
+ language file has these licenses embedded within the file. Please consult each
8
+ file's license to ensure that it is compatible with your application.
9
+
10
+ The Text::Hyphen library software, the application ruby-hyphen, and the library
11
+ (gem) as a compilation is licensed under the terms of the MIT license. The files
12
+ in this distribution covered by this license are in the list below called
13
+ "Library Files".
14
+
15
+ Individual language hyphenation files (in the list called "Language Files") are
16
+ maintained under the license described in the language file itself; the
17
+ copyright for these original files is held by the original authors; any mistakes
18
+ made in conversion of these files to Ruby is attributable to the contributors of
19
+ the Text::Hyphen package only. If license information is not present in a given
20
+ Language File, it should be considered under the terms of TeX.
21
+
22
+ ## Library License
23
+
24
+ - Copyright Austin Ziegler, 2004–2023
25
+
26
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
27
+ this software and associated documentation files (the "Software"), to deal in
28
+ the Software without restriction, including without limitation the rights to
29
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
30
+ the Software, and to permit persons to whom the Software is furnished to do so,
31
+ subject to the following conditions:
32
+
33
+ The above copyright notice and this permission notice shall be included in all
34
+ copies or substantial portions of the Software.
35
+
36
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
37
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
38
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
39
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
40
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
41
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
42
+
43
+ The copyright on the Text::Hyphen application/library and the Ruby translations
44
+ of hyphenation files belongs to Austin Ziegler. All other copyrights on original
45
+ versions still stand; Text::Hyphen is a derivative work of these and other
46
+ projects.
47
+
48
+ ## Library Files
49
+
50
+ Note that while this list appears to include language files, these are "loader"
51
+ files only and do not contain the hyphenation patterns themselves.
52
+
53
+ - `lib/text-hyphen.rb`
54
+ - `lib/text/hyphen.rb`
55
+ - `lib/text/hyphen/language.rb`
56
+ - `lib/text/hyphen/language/ca.rb`
57
+ - `lib/text/hyphen/language/cs.rb`
58
+ - `lib/text/hyphen/language/da.rb`
59
+ - `lib/text/hyphen/language/de.rb`
60
+ - `lib/text/hyphen/language/de1.rb`
61
+ - `lib/text/hyphen/language/de2.rb`
62
+ - `lib/text/hyphen/language/en_uk.rb`
63
+ - `lib/text/hyphen/language/en_us.rb`
64
+ - `lib/text/hyphen/language/es.rb`
65
+ - `lib/text/hyphen/language/et.rb`
66
+ - `lib/text/hyphen/language/eu.rb`
67
+ - `lib/text/hyphen/language/fi.rb`
68
+ - `lib/text/hyphen/language/fr.rb`
69
+ - `lib/text/hyphen/language/ga.rb`
70
+ - `lib/text/hyphen/language/hr.rb`
71
+ - `lib/text/hyphen/language/hsb.rb`
72
+ - `lib/text/hyphen/language/hu.rb`
73
+ - `lib/text/hyphen/language/hu1.rb`
74
+ - `lib/text/hyphen/language/hu2.rb`
75
+ - `lib/text/hyphen/language/ia.rb`
76
+ - `lib/text/hyphen/language/id.rb`
77
+ - `lib/text/hyphen/language/is.rb`
78
+ - `lib/text/hyphen/language/it.rb`
79
+ - `lib/text/hyphen/language/la.rb`
80
+ - `lib/text/hyphen/language/mn.rb`
81
+ - `lib/text/hyphen/language/ms.rb`
82
+ - `lib/text/hyphen/language/nl.rb`
83
+ - `lib/text/hyphen/language/no.rb`
84
+ - `lib/text/hyphen/language/no1.rb`
85
+ - `lib/text/hyphen/language/no2.rb`
86
+ - `lib/text/hyphen/language/pl.rb`
87
+ - `lib/text/hyphen/language/pt.rb`
88
+ - `lib/text/hyphen/language/sv.rb`
89
+ - `test/data/bug_9807_latin1.rb`
90
+ - `test/data/bug_9807_utf-8.rb`
91
+ - `test/test_bugs.rb`
92
+ - `test/test_text_hyphen.rb`
93
+ - `text-hyphen.gemspec`
94
+ - `History.rdoc`
95
+ - `License.rdoc`
96
+ - `README.rdoc`
97
+ - `Rakefile`
98
+ - `bin/ruby-hyphen`
99
+
100
+ ## Language Files
101
+
102
+ - `lib/text/hyphen/language/1.8/ca.rb`
103
+ - `lib/text/hyphen/language/1.8/cs.rb`
104
+ - `lib/text/hyphen/language/1.8/da.rb`
105
+ - `lib/text/hyphen/language/1.8/de1.rb`
106
+ - `lib/text/hyphen/language/1.8/de2.rb`
107
+ - `lib/text/hyphen/language/1.8/en_uk.rb`
108
+ - `lib/text/hyphen/language/1.8/en_us.rb`
109
+ - `lib/text/hyphen/language/1.8/es.rb`
110
+ - `lib/text/hyphen/language/1.8/et.rb`
111
+ - `lib/text/hyphen/language/1.8/eu.rb`
112
+ - `lib/text/hyphen/language/1.8/fi.rb`
113
+ - `lib/text/hyphen/language/1.8/fr.rb`
114
+ - `lib/text/hyphen/language/1.8/ga.rb`
115
+ - `lib/text/hyphen/language/1.8/hr.rb`
116
+ - `lib/text/hyphen/language/1.8/hsb.rb`
117
+ - `lib/text/hyphen/language/1.8/hu1.rb`
118
+ - `lib/text/hyphen/language/1.8/hu2.rb`
119
+ - `lib/text/hyphen/language/1.8/ia.rb`
120
+ - `lib/text/hyphen/language/1.8/id.rb`
121
+ - `lib/text/hyphen/language/1.8/is.rb`
122
+ - `lib/text/hyphen/language/1.8/it.rb`
123
+ - `lib/text/hyphen/language/1.8/la.rb`
124
+ - `lib/text/hyphen/language/1.8/mn.rb`
125
+ - `lib/text/hyphen/language/1.8/nl.rb`
126
+ - `lib/text/hyphen/language/1.8/no1.rb`
127
+ - `lib/text/hyphen/language/1.8/no2.rb`
128
+ - `lib/text/hyphen/language/1.8/pl.rb`
129
+ - `lib/text/hyphen/language/1.8/pt.rb`
130
+ - `lib/text/hyphen/language/1.8/sv.rb`
131
+ - `lib/text/hyphen/language/1.9/ca.rb`
132
+ - `lib/text/hyphen/language/1.9/cs.rb`
133
+ - `lib/text/hyphen/language/1.9/da.rb`
134
+ - `lib/text/hyphen/language/1.9/de1.rb`
135
+ - `lib/text/hyphen/language/1.9/de2.rb`
136
+ - `lib/text/hyphen/language/1.9/en_uk.rb`
137
+ - `lib/text/hyphen/language/1.9/en_us.rb`
138
+ - `lib/text/hyphen/language/1.9/es.rb`
139
+ - `lib/text/hyphen/language/1.9/et.rb`
140
+ - `lib/text/hyphen/language/1.9/eu.rb`
141
+ - `lib/text/hyphen/language/1.9/fi.rb`
142
+ - `lib/text/hyphen/language/1.9/fr.rb`
143
+ - `lib/text/hyphen/language/1.9/ga.rb`
144
+ - `lib/text/hyphen/language/1.9/hr.rb`
145
+ - `lib/text/hyphen/language/1.9/hsb.rb`
146
+ - `lib/text/hyphen/language/1.9/hu1.rb`
147
+ - `lib/text/hyphen/language/1.9/hu2.rb`
148
+ - `lib/text/hyphen/language/1.9/ia.rb`
149
+ - `lib/text/hyphen/language/1.9/id.rb`
150
+ - `lib/text/hyphen/language/1.9/is.rb`
151
+ - `lib/text/hyphen/language/1.9/it.rb`
152
+ - `lib/text/hyphen/language/1.9/la.rb`
153
+ - `lib/text/hyphen/language/1.9/mn.rb`
154
+ - `lib/text/hyphen/language/1.9/nl.rb`
155
+ - `lib/text/hyphen/language/1.9/no1.rb`
156
+ - `lib/text/hyphen/language/1.9/no2.rb`
157
+ - `lib/text/hyphen/language/1.9/pl.rb`
158
+ - `lib/text/hyphen/language/1.9/pt.rb`
159
+ - `lib/text/hyphen/language/1.9/sv.rb`
data/Manifest.txt CHANGED
@@ -1,8 +1,10 @@
1
- .autotest
2
- History.rdoc
3
- License.rdoc
1
+ .standard.yml
2
+ Code-of-Conduct.md
3
+ Contributing.md
4
+ History.md
5
+ Licence.md
4
6
  Manifest.txt
5
- README.rdoc
7
+ README.md
6
8
  Rakefile
7
9
  bin/ruby-hyphen
8
10
  lib/text-hyphen.rb
@@ -30,6 +32,7 @@ lib/text/hyphen/language/1.8/id.rb
30
32
  lib/text/hyphen/language/1.8/is.rb
31
33
  lib/text/hyphen/language/1.8/it.rb
32
34
  lib/text/hyphen/language/1.8/la.rb
35
+ lib/text/hyphen/language/1.8/lt.rb
33
36
  lib/text/hyphen/language/1.8/mn.rb
34
37
  lib/text/hyphen/language/1.8/nl.rb
35
38
  lib/text/hyphen/language/1.8/no1.rb
@@ -37,6 +40,7 @@ lib/text/hyphen/language/1.8/no2.rb
37
40
  lib/text/hyphen/language/1.8/pl.rb
38
41
  lib/text/hyphen/language/1.8/pt.rb
39
42
  lib/text/hyphen/language/1.8/ru.rb
43
+ lib/text/hyphen/language/1.8/sk.rb
40
44
  lib/text/hyphen/language/1.8/sv.rb
41
45
  lib/text/hyphen/language/1.9/ca.rb
42
46
  lib/text/hyphen/language/1.9/cs.rb
@@ -60,6 +64,7 @@ lib/text/hyphen/language/1.9/id.rb
60
64
  lib/text/hyphen/language/1.9/is.rb
61
65
  lib/text/hyphen/language/1.9/it.rb
62
66
  lib/text/hyphen/language/1.9/la.rb
67
+ lib/text/hyphen/language/1.9/lt.rb
63
68
  lib/text/hyphen/language/1.9/mn.rb
64
69
  lib/text/hyphen/language/1.9/nl.rb
65
70
  lib/text/hyphen/language/1.9/no1.rb
@@ -67,6 +72,7 @@ lib/text/hyphen/language/1.9/no2.rb
67
72
  lib/text/hyphen/language/1.9/pl.rb
68
73
  lib/text/hyphen/language/1.9/pt.rb
69
74
  lib/text/hyphen/language/1.9/ru.rb
75
+ lib/text/hyphen/language/1.9/sk.rb
70
76
  lib/text/hyphen/language/1.9/sv.rb
71
77
  lib/text/hyphen/language/ca.rb
72
78
  lib/text/hyphen/language/cs.rb
@@ -92,6 +98,7 @@ lib/text/hyphen/language/id.rb
92
98
  lib/text/hyphen/language/is.rb
93
99
  lib/text/hyphen/language/it.rb
94
100
  lib/text/hyphen/language/la.rb
101
+ lib/text/hyphen/language/lt.rb
95
102
  lib/text/hyphen/language/mn.rb
96
103
  lib/text/hyphen/language/ms.rb
97
104
  lib/text/hyphen/language/nl.rb
@@ -101,9 +108,9 @@ lib/text/hyphen/language/no2.rb
101
108
  lib/text/hyphen/language/pl.rb
102
109
  lib/text/hyphen/language/pt.rb
103
110
  lib/text/hyphen/language/ru.rb
111
+ lib/text/hyphen/language/sk.rb
104
112
  lib/text/hyphen/language/sv.rb
105
113
  test/data/bug_9807_latin1.rb
106
114
  test/data/bug_9807_utf-8.rb
107
115
  test/test_bugs.rb
108
116
  test/test_text_hyphen.rb
109
- text-hyphen.gemspec
data/README.md ADDED
@@ -0,0 +1,81 @@
1
+ # text-hyphen
2
+
3
+ - home :: https://rubygems.org/gems/text-hyphen
4
+ - issues :: https://rubygems.org/gems/text-hyphen/issues
5
+
6
+ ## Description
7
+
8
+ Text::Hyphen is a Ruby library to hyphenate words in various languages using
9
+ Ruby-fied versions of TeX hyphenation patterns. It will properly hyphenate
10
+ various words according to the rules of the language the word is written in. The
11
+ algorithm is based on that of the TeX typesetting system by Donald E. Knuth.
12
+
13
+ This is originally based on the Perl implementation of [TeX::Hyphen][] and the
14
+ [Ruby port][]. The language hyphenation pattern files are based on the sources
15
+ available from [CTAN][] as of 2004.12.19 and have been manually translated by
16
+ Austin Ziegler.
17
+
18
+ This is a small feature release adding Russian language support and fixing a bug
19
+ in the custom hyphen support introduced last version. This release provides both
20
+ Ruby 1.8.7 and Ruby 1.9.2 support (but please read below). In short, Ruby 1.8
21
+ support is deprecated and I will not be providing any bug fixes related to Ruby
22
+ 1.8. New features will be developed and tested against Ruby 1.9 only.
23
+
24
+ ## Synopsis
25
+
26
+ ```ruby
27
+ require "text/hyphen"
28
+
29
+ hh = Text::Hyphen.new(language: 'en_us', left: 2, right: 2)
30
+ # which is the same as
31
+ hh = Text::Hyphen.new
32
+
33
+ word = "representation"
34
+ points = hh.hyphenate(word) #=> [3, 5, 8, 10]
35
+ puts hh.visualize(word) #=> rep-re-sen-ta-tion
36
+
37
+ # Phrases are also supported
38
+ phrase = "This useful library supports sentences."
39
+ points = hh.hyphenate(phrase) #=> [8, 14, 23, 27, 34, 44]
40
+ puts hh.visualize(phrase) #=> This use-ful li-brary sup-port-s phras-es and sen-tences.
41
+ ```
42
+
43
+ Both visualize and hyphenate_to methods allow choosing a custom hyphen:
44
+
45
+ ```ruby
46
+ puts hh.visualize(word, "&shy;") #=> rep&shy;re&shy;sen&shy;ta&shy;tion
47
+ ```
48
+
49
+ Text::Hyphen is truly multilingual, with 29 languages or language variants
50
+ supported. As an example, consider the difference between the following:
51
+
52
+ ```ruby
53
+ require 'text/hyphen'
54
+
55
+ # Using left and right minimum values of 0 ensures that you will see all
56
+ # possible hyphenation points, not just those that meet the minimum width
57
+ # requirements.
58
+ en = Text::Hyphen.new(left: 0, right: 0)
59
+ fr = Text::Hyphen.new(language: "fr", left: 0, right: 0)
60
+
61
+ puts en.visualise("organiser") #=> or-gan-iser
62
+ puts fr.visualise("organiser") #=> or-ga-ni-ser
63
+ ```
64
+
65
+ As you can see, the hyphenation is distinct between the two hyphenators.
66
+ Improvements over TeX::Hyphen include thread safety (except for debug control)
67
+ and support for UTF-8 under Ruby 1.9.
68
+
69
+ ## Install
70
+
71
+ gem install text-hyphen
72
+
73
+ ### A Note About Support on Older Rubies
74
+
75
+ There is no explicit support for any version of Ruby older than 2.6, but none of
76
+ the code has been updated and support for version back to 1.8.7 _should_
77
+ continue to work.
78
+
79
+ [TeX::Hyphen]: http://search.cpan.org/author/JANPAZ/TeX-Hyphen-0.140/lib/TeX/Hyphen.pm
80
+ [Ruby port]: https://github.com/halostatue/tex-hyphen
81
+ [CTAN]: https://www.ctan.org