Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 59 lines (38 sloc) 1.872 kB
75c1a25 @eelco Adding instructions to README
eelco authored
1 NSString+Hyphenate
2 by Eelco Lempsink
3
4
5 The Hyphenate category for NSString adds the method
6 -stringByHyphenatingWithLocale: which will (try to) return
7 the same string hyphenated with UTF-8 soft-hyphens.
8
9 The hyphenation itself is done using the 'hyphen' library
10 from the Hunspell project, which is also used by
11 OpenOffice.org. To support hyphenation for different
12 languages, you can use the hyphenation dictionaries from the
13 OpenOffice.org project.
14
15
16 -- Setup
17
18 * Step 1 : Download prerequisites
19
20 Go to http://sourceforge.net/projects/hunspell/files/Hyphen/
21 and download the latest version of the Hyphen library
22
23 Download all the hyphenation libraries you want via
24 http://wiki.services.openoffice.org/wiki/Dictionaries
25 It might be easier to just pick the files from an FTP
26 mirror, they're located in the contrib/dictionaries
27 directory and all the file names start with 'hyph_'.
28 (http://ftp.snt.utwente.nl/pub/software/openoffice/contrib/dictionaries/)
29
30
31 * Step 2 : Putting the code into place
32
33 Add the NSString+Hyphenate .h and .m file to your
34 project.
35
36 To statically add the hyphen library to your project add
37 the hyphen.h, hyphen.c and hnjalloc.h, hnjalloc.c files.
38
39
40 * Step 3 : Adding dictionaries
41
42 From the unzipped hyph_* files, copy the .dic file to
43 the bundle directory Hyphenate.bundle.
44
45 If you are going to use language detection, you also
46 need to provide the .dic files for just the language,
47 not the language plus location (e.g. copy or symlink
48 hyph_nl_NL.dic to hyph_nl.dic).
49
50 Add the Hyphenate.bundle to your project.
51
52
53 -- Licensing
54
55 The NSString+Hyphenate code is licensed under the BSD3
56 license. Hunspell is licensed under a GPL 2.0/LGPL 2.1/MPL 1.1
57 tri-license. The licensing of the hyphenation libraries
58 differs and often there are multiple licenses available.
Something went wrong with that request. Please try again.