Last active
December 13, 2015 21:29
-
-
Save phluks/4977891 to your computer and use it in GitHub Desktop.
Forsøg på dansk orddeling med TeX::Hyphen::Pattern
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use warnings; | |
use v5.10; | |
# Remember to save as utf8! | |
use utf8; | |
use TeX::Hyphen; | |
use TeX::Hyphen::Pattern; | |
use open ":locale"; | |
$pat = TeX::Hyphen::Pattern->new(); | |
$pat->label('da_DK'); | |
# Changing left/rightmin does not seem to help | |
#$hyph = TeX::Hyphen->new(file => $pat->filename, leftmin => 2, rightmin => 2); | |
$hyph = TeX::Hyphen->new(file => $pat->filename); | |
say "køreskole: " | |
. $hyph->visualize("køreskole"); # køreskole: køresko-le | |
say "wonderwoman: " | |
. $hyph->visualize("wonderwoman"); # wonderwoman: won-derwo-man | |
say "katedralskole: " | |
. $hyph->visualize("katedralskole"); # katedralskole: ka-ted-ralsko-le |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am not amused.