This repository has been archived by the owner on Aug 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 79
/
reducePatternSet.html
237 lines (233 loc) · 11.4 KB
/
reducePatternSet.html
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>Hyphenator – reducePatternSet</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style type="text/css">
body {
font: 11px/1.8em Verdana;
margin-left: 20%;
margin-right:20%;
background-color:#EEEEEE;
width:60em;
}
fieldset {
background-color:#FFFFFF;
border:1px solid #AAAAAA;
margin:1em 0em;
padding: 0em 1em 2em 1em;
}
h1 {
background-color:#FFFFFF;
border:1px solid #AAAAAA;
margin:1em 0em;
color: #404041;
text-align:right;
}
img {
vertical-align:middle;
}
.info_btn {
vertical-align:text-bottom;
cursor:pointer;
}
.info_box {
display:none;
border:1px dashed #AAAAAA;
padding:0.2em 1em;
font-style:italic;
}
.multicol {
text-align:justify;
width: 28em;
float:left;
margin:0em 1em;
}
ul.multicol {
width:21em;
padding:0;
margin:0;
}
li {
list-style:none;
}
form {
clear: both;
padding-top:2em;
}
legend {
border:1px solid #AAAAAA;
background-color:#FFFFFF;
padding:0em 1em;
font-style: italic;
font-weight: 200;
}
input {
margin-right:1em;
}
textarea {
width:100%;
}
.grayedout {
border: 1px solid grey;
color: grey;
}
</style>
<script src="Hyphenator.js" type="text/javascript"></script>
<script src="patterns/be.js" type="text/javascript"></script>
<script src="patterns/bn.js" type="text/javascript"></script>
<script src="patterns/ca.js" type="text/javascript"></script>
<script src="patterns/cs.js" type="text/javascript"></script>
<script src="patterns/da.js" type="text/javascript"></script>
<script src="patterns/de.js" type="text/javascript"></script>
<script src="patterns/el-monoton.js" type="text/javascript"></script>
<script src="patterns/el-polyton.js" type="text/javascript"></script>
<script src="patterns/en-gb.js" type="text/javascript"></script>
<script src="patterns/en-us.js" type="text/javascript"></script>
<script src="patterns/eo.js" type="text/javascript"></script>
<script src="patterns/es.js" type="text/javascript"></script>
<script src="patterns/et.js" type="text/javascript"></script>
<script src="patterns/fi.js" type="text/javascript"></script>
<script src="patterns/fr.js" type="text/javascript"></script>
<script src="patterns/gu.js" type="text/javascript"></script>
<script src="patterns/grc.js" type="text/javascript"></script>
<script src="patterns/hi.js" type="text/javascript"></script>
<script src="patterns/hu.js" type="text/javascript"></script>
<script src="patterns/hy.js" type="text/javascript"></script>
<script src="patterns/it.js" type="text/javascript"></script>
<script src="patterns/kn.js" type="text/javascript"></script>
<script src="patterns/la.js" type="text/javascript"></script>
<script src="patterns/lt.js" type="text/javascript"></script>
<script src="patterns/lv.js" type="text/javascript"></script>
<script src="patterns/ml.js" type="text/javascript"></script>
<script src="patterns/nl.js" type="text/javascript"></script>
<script src="patterns/nb-no.js" type="text/javascript"></script>
<script src="patterns/or.js" type="text/javascript"></script>
<script src="patterns/pa.js" type="text/javascript"></script>
<script src="patterns/pl.js" type="text/javascript"></script>
<script src="patterns/pt.js" type="text/javascript"></script>
<script src="patterns/ro.js" type="text/javascript"></script>
<script src="patterns/ru.js" type="text/javascript"></script>
<script src="patterns/sk.js" type="text/javascript"></script>
<script src="patterns/sl.js" type="text/javascript"></script>
<script src="patterns/sr-latn.js" type="text/javascript"></script>
<script src="patterns/sv.js" type="text/javascript"></script>
<script src="patterns/ta.js" type="text/javascript"></script>
<script src="patterns/te.js" type="text/javascript"></script>
<script src="patterns/tr.js" type="text/javascript"></script>
<script src="patterns/uk.js" type="text/javascript"></script>
<script type="text/javascript">
window.onload = function () {
document.getElementById('myform').onsubmit = function (e) {
if (e && e.preventDefault) {
e.preventDefault();
} else if (window.event) {
window.event.returnValue = false;
}
var text = document.getElementById('text').value,
language = document.getElementById('language').value;
Hyphenator.hyphenate(text, language);
var patSet = Hyphenator.getRedPatternSet(language),
s = '', k;
for(k in patSet) {
s += patSet[k].replace(/_/g, '.') + ' ';
}
var output = document.getElementById('output');
output.firstChild.data = '';
output.firstChild.data = s;
output.focus();
output.select();
return false;
};
};
Hyphenator.config({
remoteloading:false,
displaytogglebox: true,
enablereducedpatternset: true,
storagetype: 'none'
});
</script>
</head>
<body>
<h1>reducePatternSet <svg height="60" width="150" version="1.1" style="vertical-align: middle">
<g font-family="Consolas" font-weight="bold" font-size="36px" transform="translate(-90,-191)">
<text y="230" x="139" fill="#bbb">&shy;</text>
<text line-height="70%" fill="#444">
<tspan y="218" x="103">Hyphen-</tspan>
<tspan y="243" x="103">ator.js</tspan>
</text>
<text font-weight="normal" line-height="125%" font-size="32px" y="228" x="89" fill="#000">{</text>
</g>
</svg>
</h1>
<p class="multicol hyphenate">
Hyphenator uses a large set of patterns to hyphenate words. If you have a static site (i.e. a site that will not be changed) it may be convenient to reduce the set of patterns to those wich are actually used. This helps to save lots of bits of your pageload.</p>
<p class="multicol hyphenate">
The script loads the version of Hyphenator.js that resides in the same directory as this page.
</p>
<form action="#outanchor" method="post" id="myform">
<fieldset>
<legend>Reduce Patterns for this text:</legend>
<p>Enter the text(s) of your static site here:</p>
<textarea id="text" rows="20" cols="20"></textarea>
<p>Select the language:</p>
<select id="language" name="language" size="1" title="language">
<option value="be">Беларуская (Belarusian)</option>
<option value="bn">বাংলা (Bengali)</option>
<option value="ca">Català (Catalan)</option>
<option value="cs">Česky (Czech)</option>
<option value="da">Dansk (Danish)</option>
<option value="de" selected>Deutsch (German)</option>
<option value="el-monoton">monton greek</option>
<option value="el-polyton">polyton greek</option>
<option value="en-us">American English</option>
<option value="en-gb">British English</option>
<option value="et">Eesti (Estonian)</option>
<option value="eo">Esperanto (Esperanto)</option>
<option value="es">Español (Spanish)</option>
<option value="fi">Suomi (Finnish)</option>
<option value="fr">Français (French)</option>
<option value="grc">ancient greek</option>
<option value="gu">ગુજરાતી (Gujarati)</option>
<option value="hi">हिंदी (Hindi)</option>
<option value="hu">Magyar (Hungarian)</option>
<option value="hy">Հայերեն լեզու (Armenian)</option>
<option value="it">Italiano (Italian)</option>
<option value="kn">ಕನ್ನಡ (Kannada)</option>
<option value="la">Latin (Latin)</option>
<option value="lt">Lietuvių (Lithuanian)</option>
<option value="lv">latviešu valoda (Latvian)</option>
<option value="ml">മലയാളം (Malayalam)</option>
<option value="nl">Nederlands (Dutch)</option>
<option value="nb-no">Norsk (Norwegian)</option>
<option value="or">ଓଡ଼ିଆ (Oriya)</option>
<option value="pa">ਪੰਜਾਬੀ (Punjabi)</option>
<option value="pl">Polski (Polish)</option>
<option value="pt">Português (Portuguese)</option>
<option value="ro">Română (Romanian)</option>
<option value="ru">Pyccĸий (Russian)</option>
<option value="sk">Slovenčina (Slovak)</option>
<option value="sl">Slovenščina (Slovenian)</option>
<option value="sr-latn">Srpski (Serbian, Latin script)</option>
<option value="sv">Svenska (Swedish)</option>
<option value="ta">தமிழ் (Tamil)</option>
<option value="te">తెలుగు (Telugu)</option>
<option value="tr">Türkçe (Turkish)</option>
<option value="uk">Українська (Ukrainian)</option>
</select>
<p>
<input id="create2" type="submit" value=" Go! ">
<input type="reset" value=" Reset! ">
</p>
</fieldset>
<fieldset>
<legend>Output:</legend>
<a name="outanchor"></a>
<p>Copy this to the inputfield in <a href="compressor.html">compressor.html</a>:</p>
<textarea id="output" rows="20" cols="20">
</textarea>
</fieldset>
</form>
</body>
</html>