forked from webrocker/hyphenator
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsample.php
More file actions
78 lines (69 loc) · 2.25 KB
/
sample.php
File metadata and controls
78 lines (69 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
/**
* a PHP Hyphenator
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.
* It is also available through the world-wide-web at this URL:
* http://web-rocker.de/projekte/new-bsd-license/
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to community@web-rocker.de so we can send you a copy immediately.
*
* @category Hyphenator
* @package Hyphenator
* @copyright Copyright (c) 2010-2012 Web Rocker (http://web-rocker.de)
* @license http://web-rocker.de/projekte/new-bsd-license/ New BSD License
*/
/**
* Hyphenator
*
* @category Hyphenator
* @package Hyphenator
* @copyright Copyright (c) 2010-2012 Web Rocker (http://web-rocker.de)
* @license http://web-rocker.de/projekte/new-bsd-license/ New BSD License
*/
namespace Hyphenator;
include_once "vendor/autoload.php";
// use Memcache (localhost:11211)
$core = new Core(
dirname(__FILE__) . DIRECTORY_SEPARATOR . 'patterns',
new Cache\MemcachedCache()
);
/*
// use custom Memcache handle
$handle = new \Memcache();
$handle->connect('localhost', 11211);
$core = new Core(
dirname(__FILE__) . DIRECTORY_SEPARATOR . 'patterns',
new Cache\MemcachedCache($handle)
);
*/
/*
// use APC
$core = new Core(
dirname(__FILE__) . DIRECTORY_SEPARATOR . 'patterns',
new Cache\ApcCache()
);
*/
/*
// use no cache
$core = new Core(
dirname(__FILE__) . DIRECTORY_SEPARATOR . 'patterns'
);
*/
$core->registerPatterns('de');
/*
* For example purposes we override the hyphen
*/
$core->setHyphen('|');
echo $core->hyphenate('Ein RIESEN Haufen von Ausdrucken liegt auf dem Boden. Und tatsaechlich, sein
Dokument liegt ganz oben auf. Ich breite es ueber dem Haufen aus und spruehe
grosszuegig unser Spezialfleckenwasser in die Gegend. Dann fahre ich den
schweren Bandwagen ein paar Mal darueber und klemme es zum kroenenden
Abschluss vier, fuenf Mal in die schwere Safetuere ein, wo wir die Backup-
Baender aufbewahren sollten. Huebsch. Ich schleiche zurueck in den Druckerraum und suche die Tonerkassette, die
wir fuer spezielle Faelle aufbewaren - die mit den dicken schwarzen Streifen
in der Mitte und den blassen Raendern.');