correction, ajout gitignore

This commit is contained in:
Thibaud
2019-07-06 13:25:00 +02:00
commit 28d1936dee
182 changed files with 28900 additions and 0 deletions
@@ -0,0 +1,68 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Hyphenopoly.js &ndash; Testsuite</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style type="text/css">
body {
width:80%;
margin-left:10%;
margin-right:10%;
font: normal 11px Verdana;
line-height: 18px;
}
#template {
display: none;
}
#testframe {
visibility: hidden;
}
.passed {
color: green;
background-color: lime;
}
.failed {
color: maroon;
background-color: red;
}
.obsolete {
color: black;
background-color: silver;
}
.visual {
color: olive;
background-color: yellow;
}
.omitted {
color: grey;
background-color: black;
}
.testname {
display: inline-block;
width: 6em;
}
.result {
display: inline-block;
width: 5em;
}
ul {
list-style-type: none;
padding-left: 0px;
}
</style>
</head>
<body>
<h1>The Hyphenopoly Testsuite</h1>
<ul id="template">
<li>
<span class="testname"><a href="@file@">@file@</a></span>
<span class="result @result@">[@result@]</span>
<span class="desc">@desc@</span>
</li>
</ul>
<ul id="testresults">
</ul>
<iframe id="testframe" src=""></iframe>
<script src="testdriver.js"></script>
</body>
</html>
@@ -0,0 +1,93 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 001</title>
<script>
var Hyphenopoly = {
require: {
"en-us": "FORCEHYPHENOPOLY",
"hy": "ձայնավորձայնավոր"
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
}
}
};
function assert() {
var tests = 2;
var i = 1;
var test = "";
var ref = "";
var result = true;
var lang = "";
while (i <= tests) {
lang = document.getElementById("test" + i).lang;
if (Hyphenopoly.cf.langs[lang] === "CSS") {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed (CSS)</p>";
result = result && true;
} else {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed</p>";
result = result && true;
} else {
document.getElementById("result").innerHTML += "<p style=\"background-color: #ffd6d6\">" + i + " failed</p>";
result = false;
}
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 1,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
.hyphenate {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="index.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test2.html">Next&nbsp;&rarr;</a></div>
<h1>Test 001</h1>
<p id="desc">Hyphenate two texts – en-us (where CSS-hyphenation is mostly supported) and hy (where CSS-hyphenation is unsupported).</p>
<div id="result"></div>
<hr>
<h2>1: en-us</h2>
<p id="test1" class="test hyphenate" lang="en-us">A hyphenation algorithm is a set of rules that decides at which points a word can be broken over two lines with a hyphen.</p>
<p id="ref1" class="ref" lang="en-us">A hy&shy;phen&shy;ation al&shy;go&shy;rithm is a set of rules that de&shy;cides at which points a word can be bro&shy;ken over two lines with a hy&shy;phen.</p>
<h2>2: hy (Armenian)</h2>
<p id="test2" class="test hyphenate" lang="hy">Հայերենն ունի վեց ձայնավոր, մեկ կիսաձայն և երեսուն բաղաձայն հնչյուններ</p>
<p id="ref2" class="ref" lang="hy">Հա&shy;յե&shy;րենն ունի վեց ձայնա&shy;վոր, մեկ կի&shy;սա&shy;ձայն և ե&shy;րե&shy;սուն բա&shy;ղա&shy;ձայն հնչյուններ</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,103 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 010</title>
<script>
var Hyphenopoly = {
require: {
"de": "FORCEHYPHENOPOLY"
},
setup: {
hide: "element",
selectors: {
".class1": {
hyphen: "·"
},
".class2": {
hyphen: String.fromCharCode(173)
}
}
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
}
}
};
function assert() {
var tests = 1;
var i = 1;
var test = "";
var ref = "";
var result = true;
while (i <= tests) {
test = document.getElementById("test" + i).textContent;
ref = document.getElementById("ref" + i).textContent;
if (test === ref) {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed</p>";
result = result && true;
} else {
document.getElementById("result").innerHTML += "<p style=\"background-color: #ffd6d6\">" + i + " failed</p>";
result = false;
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 10,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
document.addEventListener("DOMContentLoaded", function() {
document.getElementById("pastebin").addEventListener("keyup", function(e) {
this.value += "\n" + Array.prototype.map.call(this.value, function (x) {
return x.charCodeAt(0)
});
}, true);
});
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.italic {
font-style: italic;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
.hyphenate {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;&nbsp;<a href="test9.html">&larr;&nbsp;Prev</a>&nbsp;&nbsp;<a href="test11.html">Next&nbsp;&rarr;</a></div>
<h1>Test 010</h1>
<p id="desc">Check copy hack</p>
<div id="result"></div>
<hr>
<h2>1: class1</h2>
<p id="test1" class="test class1" lang="de">Silbentrennung: <span class="class2 italic">Die Worttrennung, auch Silbentrennung genannt, bezeichnet in der Orthographie die Art und Weise, wie die Wörter insbesondere am Zeilenende getrennt werden können.</span></p>
<p id="ref1" class="ref" lang="de">Sil·ben·tren·nung: <span class="italic">Die Wort&shy;tren&shy;nung, auch Sil&shy;ben&shy;tren&shy;nung ge&shy;nannt, be&shy;zeich&shy;net in der Or&shy;tho&shy;gra&shy;phie die Art und Weise, wie die Wör&shy;ter ins&shy;be&shy;son&shy;de&shy;re am Zei&shy;len&shy;en&shy;de ge&shy;trennt wer&shy;den kön&shy;nen.</span></p>
<hr>
<textarea id="pastebin" placeholder="paste here" cols="40"></textarea>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,89 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 011</title>
<script>
var Hyphenopoly = {
require: {
"de": "FORCEHYPHENOPOLY"
},
setup: {
selectors: {
".hyphenate": {
hyphen: "•"
}
}
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
}
}
};
function assert() {
var tests = 1;
var i = 1;
var test = "";
var ref = "";
var result = false;
while (i <= tests) {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed</p>";
result = result || true;
} else {
document.getElementById("result").innerHTML += "<p style=\"background-color: #ffd6d6\">" + i + " failed</p>";
result = result || false;
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 11,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
.hyphenate {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test10.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test12.html">Next&nbsp;&rarr;</a></div>
<h1>Test 011</h1>
<p id="desc">Check character substitution.</p>
<div id="result"></div>
<hr>
<p id="test1" class="test hyphenate" lang="de">Fürstenberg Fürſtenberg</p>
<p id="ref1" class="ref" lang="de">Fürs•ten•berg Fürſ•ten•berg</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,100 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 012</title>
<script>
var Hyphenopoly = {
require: {
"de": "FORCEHYPHENOPOLY"
},
setup: {
dontHyphenate: {
kbd: false,
button: false,
span: true
},
selectors: {
".hyphenate": {
hyphen: "•"
},
".h9n_btn": {}
}
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
}
}
};
function assert() {
var tests = 1;
var i = 1;
var test = "";
var ref = "";
var result = false;
while (i <= tests) {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed</p>";
result = result || true;
} else {
document.getElementById("result").innerHTML += "<p style=\"background-color: #ffd6d6\">" + i + " failed</p>";
result = result || false;
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 12,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
.h9n_btn {
width: 5em;
text-align: left;
}
.hyphenate {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test11.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test13.html">Next&nbsp;&rarr;</a></div>
<h1>Test 012</h1>
<p id="desc">Check dontHyphenate-Elements</p>
<div id="result"></div>
<hr>
<p id="test1" class="test hyphenate" lang="de">Silbentrennung <code>Silbentrennung</code> <kbd>Silbentrennung</kbd> <button class="h9n_btn">Silbentrennung</button> <span>Silbentrennung</span></p>
<p id="ref1" class="ref" lang="de">Sil•ben•tren•nung <code>Silbentrennung</code> <kbd>Sil•ben•tren•nung</kbd> <button class="h9n_btn">Sil&shy;ben&shy;tren&shy;nung</button> <span>Silbentrennung</span></p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,97 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 013</title>
<script>
var Hyphenopoly = {
require: {
"en-us": "FORCEHYPHENOPOLY",
"de": "FORCEHYPHENOPOLY"
},
setup: {
selectors: {
".hyphenate": {
hyphen: "•"
},
".hyphenate2": {}
},
exceptions: {
"global": "FORTRAN, Java-Script",
"en-us": "Web-As-sem-bly",
"de": "Web-Assembly"
}
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
}
}
};
function assert() {
var tests = 2;
var i = 1;
var test = "";
var ref = "";
var result = false;
while (i <= tests) {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed</p>";
result = result || true;
} else {
document.getElementById("result").innerHTML += "<p style=\"background-color: #ffd6d6\">" + i + " failed</p>";
result = result || false;
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 13,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
.hyphenate {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test12.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test14.html">Next&nbsp;&rarr;</a></div>
<h1>Test 013</h1>
<p id="desc">Check exceptions</p>
<div id="result"></div>
<hr>
<p id="test1" class="test hyphenate" lang="en-us">FORTRAN, JavaScript, WebAssembly <span lang="de">(WebAssembly)</span></p>
<p id="ref1" class="ref" lang="en-us">FORTRAN, Java•Script, Web•As•sem•bly <span lang="de">(Web•Assembly)</span></p>
<p id="test2" class="test hyphenate2" lang="en-us">FORTRAN, JavaScript, WebAssembly <span lang="de">(WebAssembly)</span></p>
<p id="ref2" class="ref" lang="en-us">FORTRAN, Java&shy;Script, Web&shy;As&shy;sem&shy;bly <span lang="de">(Web&shy;Assembly)</span></p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,112 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 014</title>
<script>
var Hyphenopoly = {
require: {
"de": "FORCEHYPHENOPOLY",
"en-us": "FORCEHYPHENOPOLY"
},
setup: {
selectors: {
".class1": {
hyphen: "•",
leftmin: 0,
rightmin: 0
},
".class2": {
hyphen: "•",
leftmin: 4,
rightmin: 4
},
".class3": {
hyphen: "•",
leftmin: 0,
leftminPerLang: {
"de": 4,
"en-us": 4
}
}
}
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
}
}
};
function assert() {
var tests = 3;
var i = 1;
var test = "";
var ref = "";
var result = false;
while (i <= tests) {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<span style=\"background-color: #d6ffd6\">" + (function (i) {
return (i < 10) ? "0" + i : i;
}(i)) + "</span> ";
result = result || true;
} else {
document.getElementById("result").innerHTML += "<span style=\"background-color: #ffd6d6\">" + (function (i) {
return (i < 10) ? "0" + i : i;
}(i)) + "</span> ";
result = result || false;
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 14,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
.hyphenate {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test13.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test15.html">Next&nbsp;&rarr;</a></div>
<h1>Test 014</h1>
<p id="desc">Test left-/rightmin and left-/rightminPerLang</p>
<div id="result"></div>
<hr>
<p id="test1" class="test class1" lang="de">Silbentrennungsalgorithmus</p>
<p id="ref1" class="ref" lang="de">Sil•ben•tren•nungs•al•go•rith•mus</p>
<p id="test2" class="test class2" lang="de">Silbentrennungsalgorithmus</p>
<p id="ref2" class="ref" lang="de">Silben•tren•nungs•al•go•rithmus</p>
<p id="test3" class="test class3" lang="de">Silbentrennungsalgorithmus <span lang="en-us">hyphenation</span></p>
<p id="ref3" class="ref" lang="de">Silben•tren•nungs•al•go•rith•mus <span lang="en-us">hyphen•ation</span></p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,98 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 015</title>
<script>
var Hyphenopoly = {
require: {
"de": "FORCEHYPHENOPOLY"
},
setup: {
selectors: {
".hyphenate": {
hyphen: "•"
}
}
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
},
beforeElementHyphenation: function (e) {
e.el.firstChild.data = e.lang + ": " + e.el.firstChild.data;
},
afterElementHyphenation: function (e) {
e.el.firstChild.data = e.el.firstChild.data.split("").reverse().join("");
}
}
};
function assert() {
var tests = 1;
var i = 1;
var test = "";
var ref = "";
var result = false;
while (i <= tests) {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<span style=\"background-color: #d6ffd6\">" + (function (i) {
return (i < 10) ? "0" + i : i;
}(i)) + "</span> ";
result = result || true;
} else {
document.getElementById("result").innerHTML += "<span style=\"background-color: #ffd6d6\">" + (function (i) {
return (i < 10) ? "0" + i : i;
}(i)) + "</span> ";
result = result || false;
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 15,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
.hyphenate {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test14.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test16.html">Next&nbsp;&rarr;</a></div>
<h1>Test 015</h1>
<p id="desc">Check before-/onAfterElementHyphenation</p>
<div id="result"></div>
<hr>
<p id="test1" class="test hyphenate" lang="de">Silbentrennungsalgorithmus</p>
<p id="ref1" class="ref" lang="de">sum•htir•og•la•sgnun•nert•neb•liS :ed</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,85 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 016</title>
<script>
var Hyphenopoly = {
require: {
"en-us": "FORCEHYPHENOPOLY"
},
setup: {
selectors: {
".hyphenate": {
hyphen: "•"
}
}
},
handleEvent: {
myFantasyEvent: function (e) {
console.log(e);
},
error: function (e) {
e.preventDefault();
assert(e);
}
}
};
function assert(e) {
var test = "unknown Event \"myFantasyEvent\" discarded";
var ref = e.msg;
var result = false;
if (test === ref) {
document.getElementById("result").innerHTML += "<span style=\"background-color: #d6ffd6\">passed</span> ";
result = result || true;
} else {
document.getElementById("result").innerHTML += "<span style=\"background-color: #ffd6d6\">failed</span> ";
result = result || false;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 16,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
.hyphenate {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test15.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test17.html">Next&nbsp;&rarr;</a></div>
<h1>Test 016</h1>
<p id="desc">Discard unknown Events</p>
<div id="result"></div>
<hr>
<p id="test1" class="test hyphenate" lang="en-us">unknown Event "myFantasyEvent" discarded</p>
<p id="ref1" class="ref" lang="en">unknown Event "myFantasyEvent" discarded</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,81 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 017</title>
<script>
var Hyphenopoly = {
require: {
"en-us": "FORCEHYPHENOPOLY"
},
setup: {
selectors: {
".hyphenate": {}
}
},
handleEvent: {
error: function (e) {
e.preventDefault();
assert(e);
}
}
};
function assert(e) {
var test1 = "engine for language 'en-us' loaded, but no elements found.";
var test2 = "Element with 'en' found, but 'en.hpb' not loaded. Check language tags!";
var ref = e.msg;
var result = false;
if (test1 === ref || test2 === ref) {
document.getElementById("result").innerHTML += "<span style=\"background-color: #d6ffd6\">passed</span> ";
result = result || true;
} else {
document.getElementById("result").innerHTML += "<span style=\"background-color: #ffd6d6\">failed</span> ";
result = result || false;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 17,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
.hyphenate {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test16.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test18.html">Next&nbsp;&rarr;</a></div>
<h1>Test 017</h1>
<p id="desc">Error if no element found.</p>
<div id="result"></div>
<hr>
<p id="test1" class="test hyphenate" lang="en">engine for language 'en-us' loaded, but no elements found.</p>
<p id="ref1" class="ref" lang="en">engine for language 'en-us' loaded, but no elements found.</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,101 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 018</title>
<script>
var Hyphenopoly = {
require: {
"de": "FORCEHYPHENOPOLY"
},
setup: {
selectors: {
".hyphenate": {
hyphen: "•"
}
}
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
}
}
};
var assertRunCount = 0;
function assert() {
assertRunCount += 1;
var tests = (assertRunCount === 1) ? 1 : 3;
var i = 1;
var test = "";
var ref = "";
var result = false;
document.getElementById("result").innerHTML = "";
while (i <= tests) {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<span style=\"background-color: #d6ffd6\">" + i + "</span> ";
result = result || true;
} else {
document.getElementById("result").innerHTML += "<span style=\"background-color: #ffd6d6\">" + i + "</span> ";
result = result || false;
}
i += 1;
}
if (parent != window && assertRunCount === 2) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 18,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
window.setTimeout(function () {
document.getElementById("test1").innerHTML = "Typografie";
document.getElementById("ref1").innerHTML = "Ty•po•gra•fie";
document.getElementById("test2").innerHTML = "Textlayout";
document.getElementById("ref2").innerHTML = "Text•lay•out";
document.getElementById("test3").innerHTML ='<p class="hyphenate">Satzstruktur</p>';
document.getElementById("ref3").innerHTML ='<p class="hyphenate">Satz•struk•tur</p>';
Hyphenopoly.events.dispatch("contentLoaded");
}, 500);
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test17.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test19.html">Next&nbsp;&rarr;</a></div>
<h1>Test 018</h1>
<p id="desc">Hyphenate element manually</p>
<div id="result">wait for it...</div>
<hr>
<h2>1: Hyphenate on load, changed later</h2>
<p id="test1" class="test hyphenate" lang="de">Silbentrennungsalgorithmus</p>
<p id="ref1" class="ref" lang="de">Sil•ben•tren•nungs•al•go•rith•mus</p>
<h2>2: Hyphenate text added to element with class="hyphenate"</h2>
<p id="test2" class="test hyphenate" lang="de"></p>
<p id="ref2" class="ref" lang="de"></p>
<h2>3: Hyphenate element with class="hyphenate" added to container</h2>
<div id="test3" class="test" lang="de"></div>
<div id="ref3" class="ref" lang="de"></div>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,88 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 019</title>
<script>
var Hyphenopoly = {
require: {
"la": "FORCEHYPHENOPOLY"
},
setup: {
selectors: {
".hyphenate": {
hyphen: "•"
}
}
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
}
}
};
function assert() {
var tests = 1;
var i = 1;
var test = "";
var ref = "";
var result = false;
while (i <= tests) {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed</p>";
result = result || true;
} else {
document.getElementById("result").innerHTML += "<p style=\"background-color: #ffd6d6\">" + i + " failed</p>";
result = result || false;
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 19,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
.hyphenate {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test18.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test20.html">Next&nbsp;&rarr;</a></div>
<h1>Test 019</h1>
<p id="desc">Check latin (letter "v" is not in classic alphabet)</p>
<div id="result"></div>
<hr>
<p id="test1" class="test hyphenate" lang="la">Qua de causa Helvetii quoque reliquos Gallos virtute praecedunt, quod fere cotidianis proeliis cum Germanis contendunt, cum aut suis finibus eos prohibent aut ipsi in eorum finibus bellum gerunt.</p>
<p id="ref1" class="ref" lang="la">Qua de causa Helvetii quo•que re•li•quos Gal•los virtute prae•ce•dunt, quod fere co•ti•dia•nis proe•li•is cum Ger•ma•nis con•ten•dunt, cum aut suis fi•ni•bus eos pro•hi•bent aut ipsi in eorum fi•ni•bus bel•lum ge•runt.</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,88 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 002</title>
<script>
var Hyphenopoly = {
require: {
"hu": "FORCEHYPHENOPOLY"
},
setup: {
selectors: {
".hyphenate": {
hyphen: "•"
}
}
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
}
}
};
function assert() {
var tests = 1;
var i = 1;
var test = "";
var ref = "";
var result = false;
while (i <= tests) {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed</p>";
result = result || true;
} else {
document.getElementById("result").innerHTML += "<p style=\"background-color: #ffd6d6\">" + i + " failed</p>";
result = result || false;
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 2,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
.hyphenate {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test1.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test3.html">Next&nbsp;&rarr;</a></div>
<h1>Test 002</h1>
<p id="desc">Force hyphenate an hungarian word. Use special hyphen character.</p>
<div id="result"></div>
<hr>
<p id="test1" class="test hyphenate" lang="hu">automatikusan</p>
<p id="ref1" class="ref" lang="hu">au•to•ma•ti•ku•san</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,98 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 020</title>
<script>
var Hyphenopoly = {
require: {
"de": "FORCEHYPHENOPOLY",
"en-us": "FORCEHYPHENOPOLY"
},
setup: {
selectors: {
".hyphenate": {
hyphen: "•"
}
}
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
}
}
};
function assert() {
var tests = 4;
var i = 1;
var test = "";
var ref = "";
var result = false;
while (i <= tests) {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<span style=\"background-color: #d6ffd6\">" + (function (i) {
return (i < 10) ? "0" + i : i;
}(i)) + "</span> ";
result = result || true;
} else {
document.getElementById("result").innerHTML += "<span style=\"background-color: #ffd6d6\">" + (function (i) {
return (i < 10) ? "0" + i : i;
}(i)) + "</span> ";
result = result || false;
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 20,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
.hyphenate {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test19.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test21.html">Next&nbsp;&rarr;</a></div>
<h1>Test 020</h1>
<p id="desc">Inherit language</p>
<div id="result"></div>
<hr>
<p id="test1" class="test hyphenate">exception</p>
<p id="ref1" class="ref">ex•cep•tion</p>
<p id="test2" class="test hyphenate" lang="de"><span>beinhalten</span></p>
<p id="ref2" class="ref" lang="de"><span>be•inhal•ten</span></p>
<p id="test3" class="test hyphenate" lang="de"><span lang="en-us">exception</span></p>
<p id="ref3" class="ref" lang="de"><span lang="en-us">ex•cep•tion</span></p>
<p id="test4" class="test hyphenate"><span>exception</span></p>
<p id="ref4" class="ref"><span>ex•cep•tion</span></p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,107 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 021</title>
<script>
var msgs = "";
var Hyphenopoly = {
require: {
"de": "FORCEHYPHENOPOLY",
"en-us": "FORCEHYPHENOPOLY"
},
setup: {
selectors: {
".hyphenate": {
hyphen: "•"
}
}
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert(msgs);
},
fantasyEvent: function (e) {
console.log(e);
}
}
};
function assert(e) {
var ref = "Listener 1:unknown Event \"fantasyEvent\" discardedListener 1:unknown Event \"fantasyEvent\" discardedListener 1:unknown Event \"fantasyEvent\" discarded";
var test = e;
var result = false;
if (test === ref) {
document.getElementById("result").innerHTML += "<span style=\"background-color: #d6ffd6\">passed</span> ";
result = result || true;
} else {
document.getElementById("result").innerHTML += "<span style=\"background-color: #ffd6d6\">failed</span> ";
result = result || false;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 21,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<script>
Hyphenopoly.events.addListener("error", function (e) {
e.preventDefault();
msgs += "Listener 1:" + e.msg;
console.log("Listener 1:" + e.msg)
});
Hyphenopoly.events.addListener("error", function (e) {
e.preventDefault();
msgs += "Listener 1:" + e.msg;
console.log("Listener 2:" + e.msg)
});
Hyphenopoly.events.addListener("error", function (e) {
e.preventDefault();
msgs += "Listener 1:" + e.msg;
console.log("Listener 3:" + e.msg)
});
</script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
.hyphenate {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test20.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test22.html">Next&nbsp;&rarr;</a></div>
<h1>Test 021</h1>
<p id="desc">Register multiple error handlers (also watch console)</p>
<div id="result"></div>
<hr>
<h2>1: en-us</h2>
<p id="test1" class="test hyphenate" lang="en-us">hyphenation algorithm</p>
<p id="ref1" class="ref" lang="en-us">hy•phen•ation al•go•rithm</p>
<h2>2: de</h2>
<p id="test2" class="test hyphenate" lang="de">Silbentrennungsalgorithmus</p>
<p id="ref2" class="ref" lang="de">Sil•ben•tren•nungs•al•go•rith•mus</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,89 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 022</title>
<script>
var Hyphenopoly = {
require: {
"de": "FORCEHYPHENOPOLY"
},
setup: {
selectors: {
".hyphenate": {
hyphen: "•"
}
},
normalize: true
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
}
}
};
function assert() {
var tests = 1;
var i = 1;
var test = "";
var ref = "";
var result = false;
while (i <= tests) {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed</p>";
result = result || true;
} else {
document.getElementById("result").innerHTML += "<p style=\"background-color: #ffd6d6\">" + i + " failed</p>";
result = result || false;
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 22,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
.hyphenate {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test21.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test23.html">Next&nbsp;&rarr;</a></div>
<h1>Test 022</h1>
<p id="desc">Normalize combined characters (not supported in all clients)</p>
<div id="result"></div>
<hr>
<p id="test1" class="test hyphenate" lang="de">Bärentöter Ba&#x0308;rento&#x0308;ter</p>
<p id="ref1" class="ref" lang="de">Bä•ren•tö•ter Bä•ren•tö•ter</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,93 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 023</title>
<script>
var reloaded = !!sessionStorage.getItem("Hyphenopoly_Loader");
var Hyphenopoly = {
cacheFeatureTests: true,
require: {
"fur": "probabilmentri"
},
setup: {
selectors: {
".hyphenate": {
hyphen: "|",
minWordLength: 4
}
}
},
handleEvent: {
hyphenopolyEnd: function (e) {
if (!reloaded) {
reloaded = true;
window.location.reload();
} else {
assert();
sessionStorage.clear();
}
}
}
};
function assert() {
var tests = 1;
var i = 1;
var test = "";
var ref = "";
var result = false;
while (i <= tests) {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<span style=\"background-color: #d6ffd6\">" + (function (i) {
return (i < 10) ? "0" + i : i;
}(i)) + "</span> ";
result = result || true;
} else {
document.getElementById("result").innerHTML += "<span style=\"background-color: #ffd6d6\">" + i + "</span> ";
result = result || false;
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 23,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
hyphens: auto;
}
.ref {
background-color: #FEEFC0;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test22.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test24.html">Next&nbsp;&rarr;</a></div>
<h1>Test 023</h1>
<p id="desc">Hyphenate Furlan (not native in current UAs) and use sessionStorage for clientFeatures.</p>
<div id="result"></div>
<hr>
<h2>fur</h2>
<p id="test1" lang="fur" class="test hyphenate">Il furlan e je une lenghe romanze de famee des lenghis retichis, che e je fevelade soredut intal Friûl, ma ancje vie pal mont. Cualchi volte al ven clamât Ladin orientâl, parcè che al à diviers ponts in comun cul ladin, ma si è svilupât in un altri mût cul passâ dal timp, sot de influence des lenghis ator dal Friûl</p>
<p id="ref1" lang="fur" class="ref">Il fur|lan e je une len|ghe ro|man|ze de fa|mee des len|ghis re|ti|chis, che e je fe|ve|la|de so|re|dut in|tal Friûl, ma an|cje vie pal mont. Cual|chi vol|te al ven clamât La|din orientâl, parcè che al à di|viers ponts in co|mun cul la|din, ma si è svi|lupât in un al|tri mût cul pa|ssâ dal timp, sot de in|fluen|ce des len|ghis ator dal Friûl</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,100 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 024</title>
<script>
var Hyphenopoly = {
require: {
"en-au": "FORCEHYPHENOPOLY",
"en": "FORCEHYPHENOPOLY"
},
fallbacks: {
"en-au": "en-gb",
"en": "en-us"
},
setup: {
safeCopy: false
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
}
}
};
function assert() {
var tests = 2;
var i = 1;
var test = "";
var ref = "";
var result = true;
var lang = "";
while (i <= tests) {
lang = document.getElementById("test" + i).lang;
if (Hyphenopoly.cf.langs[lang] === "CSS") {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed (CSS)</p>";
result = result && true;
} else {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed</p>";
result = result && true;
} else {
document.getElementById("result").innerHTML += "<p style=\"background-color: #ffd6d6\">" + i + " failed</p>";
result = false;
}
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 24,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
.hyphenate {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test23.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test25.html">Next&nbsp;&rarr;</a></div>
<h1>Test 024</h1>
<p id="desc">Hyphenate a text marked with lang 'en-au'. Hyphenopoly should use 'en-gb'-patterns.</p>
<div id="result"></div>
<hr>
<h2>1: en-au</h2>
<p id="test1" class="test hyphenate" lang="en-au">A hyphenation algorithm is a set of rules that decides at which points a word can be broken over two lines with a hyphen.</p>
<p id="ref1" class="ref" lang="en-au">A hy&shy;phen&shy;a&shy;tion al&shy;gorithm is a set of rules that de&shy;cides at which points a word can be broken over two lines with a hy&shy;phen.</p>
<h2>2: en</h2>
<p id="test2" class="test hyphenate" lang="en">A hyphenation algorithm is a set of rules that decides at which points a word can be broken over two lines with a hyphen.</p>
<p id="ref2" class="ref" lang="en">A hy&shy;phen&shy;ation al&shy;go&shy;rithm is a set of rules that de&shy;cides at which points a word can be bro&shy;ken over two lines with a hy&shy;phen.</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,88 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 025</title>
<script>
var Hyphenopoly = {
require: {
"nl": "FORCEHYPHENOPOLY"
},
setup: {
selectors: {
".hyphenate": {
hyphen: "•"
}
}
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
}
}
};
function assert() {
var tests = 1;
var i = 1;
var test = "";
var ref = "";
var result = false;
while (i <= tests) {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed</p>";
result = result || true;
} else {
document.getElementById("result").innerHTML += "<p style=\"background-color: #ffd6d6\">" + i + " failed</p>";
result = result || false;
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 25,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
.hyphenate {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test24.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test26.html">Next&nbsp;&rarr;</a></div>
<h1>Test 025</h1>
<p id="desc">Hyphenate long word</p>
<div id="result"></div>
<hr>
<p id="test1" class="test hyphenate" lang="nl">Kindercarnavalsoptochtvoorbereidingswerkzaamhedenplan Kindercarnavalsoptochtvoorbereidingswerkzaamhedenplankinderca Kindercarnavalsoptochtvoorbereidingswerkzaamhedenplankindercarnavals</p>
<p id="ref1" class="ref" lang="nl">Kin•der•car•na•vals•op•tocht•voor•be•rei•dings•werk•zaam•he•den•plan Kin•der•car•na•vals•op•tocht•voor•be•rei•dings•werk•zaam•he•den•plan•kin•der•ca Kindercarnavalsoptochtvoorbereidingswerkzaamhedenplankindercarnavals</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,119 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 026</title>
<script>
const Hyphenopoly = {
require: {
"de": "FORCEHYPHENOPOLY"
},
setup: {
selectors: {
".hyphenate": {
hyphen: "•"
},
".usePipe": {
hyphen: "|"
}
}
},
handleEvent: {
hyphenopolyEnd: function (e) {
/*async function hyphenate_de(text) {
document.getElementById("test2").innerText = (await Hyphenopoly.hyphenators.de)(text);
assert();
}*/
function hyphenate_de(text) {
Hyphenopoly.hyphenators.de.then(function (dehyph) {
document.getElementById("test2").innerText = dehyph(text, ".usePipe");
assertAll();
});
}
hyphenate_de("Silbentrennung verbessert den Blocksatz.");
},
error: function (e) {
assertError(e);
}
}
};
function assertError(e) {
var result = false;
if (e.msg.indexOf("Promises not supported in this engine") !== -1) {
result = true;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 26,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
function assertAll() {
var tests = 2;
var i = 1;
var test = "";
var ref = "";
var result = false;
while (i <= tests) {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed</p>";
result = result || true;
} else {
document.getElementById("result").innerHTML += "<p style=\"background-color: #ffd6d6\">" + i + " failed</p>";
result = result || false;
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 26,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
.hyphenate {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test25.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test27.html">Next&nbsp;&rarr;</a></div>
<h1>Test 026</h1>
<p id="desc">Hyphenate manually (uses promises): FORCE</p>
<div id="result"></div>
<hr>
<p id="test1" class="test hyphenate" lang="de">Silbentrennungsalgorithmus</p>
<p id="ref1" class="ref" lang="de">Sil•ben•tren•nungs•al•go•rith•mus</p>
<p id="test2" class="test" lang="de"></p>
<p id="ref2" class="ref" lang="de">Sil|ben|tren|nung ver|bes|sert den Block|satz.</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,110 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 027</title>
<script>
var Hyphenopoly = {
require: {
"fur": "probabilmentri"
},
setup: {
selectors: {
".hyphenate": {
hyphen: "|",
minWordLength: 4
}
}
},
handleEvent: {
engineReady: function (e) {
/*async function hyphenate_de(text) {
document.getElementById("test2").innerText = (await Hyphenopoly.hyphenators.fur)(text);
assert();
}*/
function hyphenate_fur(text) {
Hyphenopoly.hyphenators.fur.then(function (furhyph) {
document.getElementById("test1").innerText = furhyph(text);
assertAll();
});
}
hyphenate_fur("Il furlan e je une lenghe romanze de famee des lenghis retichis, che e je fevelade soredut intal Friûl, ma ancje vie pal mont. Cualchi volte al ven clamât Ladin orientâl, parcè che al à diviers ponts in comun cul ladin, ma si è svilupât in un altri mût cul passâ dal timp, sot de influence des lenghis ator dal Friûl");
},
error: function (e) {
assertError(e);
}
}
};
function assertError(e) {
var result = false;
if (e.msg.indexOf("Promises not supported in this engine") !== -1) {
result = true;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 27,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
function assertAll() {
var tests = 1;
var i = 1;
var test = "";
var ref = "";
var result = false;
while (i <= tests) {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed</p>";
result = result || true;
} else {
document.getElementById("result").innerHTML += "<p style=\"background-color: #ffd6d6\">" + i + " failed</p>";
result = result || false;
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 27,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
hyphens: auto;
}
.ref {
background-color: #FEEFC0;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test26.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test28.html">Next&nbsp;&rarr;</a></div>
<h1>Test 027</h1>
<p id="desc">Hyphenate manually (uses promises): check</p>
<div id="result"></div>
<hr>
<h2>fur</h2>
<p id="test1" lang="fur" class="test hyphenate"></p>
<p id="ref1" lang="fur" class="ref">Il fur|lan e je une len|ghe ro|man|ze de fa|mee des len|ghis re|ti|chis, che e je fe|ve|la|de so|re|dut in|tal Friûl, ma an|cje vie pal mont. Cual|chi vol|te al ven clamât La|din orientâl, parcè che al à di|viers ponts in co|mun cul la|din, ma si è svi|lupât in un al|tri mût cul pa|ssâ dal timp, sot de in|fluen|ce des len|ghis ator dal Friûl</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,112 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 028</title>
<script>
let elCount = 0;
let testresult = true;
const hide_mode = window.sessionStorage.getItem("H9Y_hideMode") || "all";
var Hyphenopoly = {
require: {
"en-us": "FORCEHYPHENOPOLY"
},
setup: {
hide: hide_mode,
selectors: {
".hyphenate1": {
hyphen: "•"
},
".hyphenate2": {
hyphen: "|"
}
}
},
handleEvent: {
beforeElementHyphenation: function (e) {
assert(e.el);
}
}
};
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<script>
function assert(el) {
elCount += 1;
switch (hide_mode) {
case "all":
testresult = testresult && (document.getElementById("H9Y_Styles").innerHTML === "html {visibility: hidden !important}\n");
break;
case "element":
testresult = testresult && (document.getElementById("H9Y_Styles").innerHTML === ".hyphenate1 {visibility: hidden !important}\n.hyphenate2 {visibility: hidden !important}\n");
break;
case "text":
testresult = testresult && (document.getElementById("H9Y_Styles").innerHTML === ".hyphenate1 {color: transparent !important}\n.hyphenate2 {color: transparent !important}\n");
break;
default:
testresult = testresult && (document.getElementById("H9Y_Styles") === null);
break;
}
if (elCount === 2) {
if (testresult) {
document.getElementById("result").innerHTML = "<p style=\"background-color: #d6ffd6\">passed</p>";
} else {
document.getElementById("result").innerHTML = "<p style=\"background-color: #ffd6d6\">failed</p>";
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 28,
result: (testresult ? "passed" : "failed")
}), window.location.href);
}
}
}
if (!Hyphenopoly) {
document.addEventListener("DOMContentLoaded", function() {
assert();
});
}
function changeHandler() {
window.sessionStorage.setItem("H9Y_hideMode", document.getElementById("selHideMode").value);
}
</script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
text-align: justify;
}
.ref {
background-color: #FEEFC0;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test27.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test29.html">Next&nbsp;&rarr;</a></div>
<h1>Test 028</h1>
<p id="desc">See what hiding does (change mode and reload to see flicker)</p>
<select id="selHideMode" onchange="changeHandler();">
<option id="all" value="all">all</option>
<option id="element" value="element">element</option>
<option id="text" value="text">text</option>
<option id="none" value="none">none</option>
</select>
<div id="result"><p style="background-color: #d6ffd6">…</p></div>
<hr>
<p id="test1" class="test hyphenate1" lang="en-us">Hyphenation</p>
<p id="test2" class="test hyphenate2" lang="en-us">Hyphenation</p>
<hr>
<script>
document.getElementById(hide_mode).selected = "selected";
</script>
</body>
</html>
@@ -0,0 +1,114 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 029</title>
<script>
var Hyphenopoly = {
require: {
"en-us": "FORCEHYPHENOPOLY",
"en-au": "FORCEHYPHENOPOLY",
"de": "FORCEHYPHENOPOLY",
"de-ch": "FORCEHYPHENOPOLY"
},
fallbacks: {
"en-au": "en-gb",
"de-ch": "de"
},
setup: {
hide: "all",
selectors: {
".hyphenate": {
hyphen: "|"
}
}
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
}
}
};
function assert() {
var tests = 6;
var i = 1;
var test = "";
var ref = "";
var result = true;
while (i <= tests) {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<span style=\"background-color: #d6ffd6\">" + (function (i) {
return (i < 10) ? "0" + i : i;
}(i)) + "</span> ";
result = result && true;
} else {
document.getElementById("result").innerHTML += "<span style=\"background-color: #ffd6d6\">" + (function (i) {
return (i < 10) ? "0" + i : i;
}(i)) + "</span> ";
result = false;
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 29,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test28.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test30.html">Next&nbsp;&rarr;</a></div>
<h1>Test 029</h1>
<p id="desc">Check case-insensitiveness of lang attributes and fallbacks.</p>
<div id="result">R: </div>
<hr>
<h2>1: en-us</h2>
<p id="test1" class="test hyphenate" lang="en-us">A hyphenation algorithm is a set of rules that decides at which points a word can be broken over two lines with a hyphen.</p>
<p id="ref1" class="ref" lang="en-us">A hy|phen|ation al|go|rithm is a set of rules that de|cides at which points a word can be bro|ken over two lines with a hy|phen.</p>
<h2>2: en-US</h2>
<p id="test2" class="test hyphenate" lang="en-US">A hyphenation algorithm is a set of rules that decides at which points a word can be broken over two lines with a hyphen.</p>
<p id="ref2" class="ref" lang="en-US">A hy|phen|ation al|go|rithm is a set of rules that de|cides at which points a word can be bro|ken over two lines with a hy|phen.</p>
<h2>3: en-au (fallback to en-gb)</h2>
<p id="test3" class="test hyphenate" lang="en-au">A hyphenation algorithm is a set of rules that decides at which points a word can be broken over two lines with a hyphen.</p>
<p id="ref3" class="ref" lang="en-au">A hy|phen|a|tion al|gorithm is a set of rules that de|cides at which points a word can be broken over two lines with a hy|phen.</p>
<h2>4: en-AU (fallback to en-gb)</h2>
<p id="test4" class="test hyphenate" lang="en-AU">A hyphenation algorithm is a set of rules that decides at which points a word can be broken over two lines with a hyphen.</p>
<p id="ref4" class="ref" lang="en-AU">A hy|phen|a|tion al|gorithm is a set of rules that de|cides at which points a word can be broken over two lines with a hy|phen.</p>
<h2>5: de</h2>
<p id="test5" class="test hyphenate" lang="de">Die Worttrennung, auch Silbentrennung genannt, bezeichnet in der Orthographie die Art und Weise, wie die Wörter insbesondere am Zeilenende getrennt werden können.</p>
<p id="ref5" class="ref" lang="de">Die Wort|tren|nung, auch Sil|ben|tren|nung ge|nannt, be|zeich|net in der Or|tho|gra|phie die Art und Weise, wie die Wör|ter ins|be|son|de|re am Zei|len|en|de ge|trennt wer|den kön|nen.</p>
<h2>6: de-CH (fallback to de)</h2>
<p id="test6" class="test hyphenate" lang="de-CH">Die Worttrennung, auch Silbentrennung genannt, bezeichnet in der Orthographie die Art und Weise, wie die Wörter insbesondere am Zeilenende getrennt werden können.</p>
<p id="ref6" class="ref" lang="de-CH">Die Wort|tren|nung, auch Sil|ben|tren|nung ge|nannt, be|zeich|net in der Or|tho|gra|phie die Art und Weise, wie die Wör|ter ins|be|son|de|re am Zei|len|en|de ge|trennt wer|den kön|nen.</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,211 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 003</title>
<script>
var startTime = performance.now();
var Hyphenopoly = {
require: {
"en-us": "FORCEHYPHENOPOLY"
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
}
}
};
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<script>
function assert() {
var endTime = performance.now();
document.getElementById("result").innerHTML = "<p style=\"background-color: #d6ffd6\">" + (Math.round((endTime - startTime) * 100) / 100).toString() + " ms</p>";
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 3,
result: Math.round((endTime - startTime) * 100) / 100
}), window.location.href);
}
}
if (!Hyphenopoly) {
document.addEventListener("DOMContentLoaded", function() {
assert();
});
}
</script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
text-align: justify;
}
.ref {
background-color: #FEEFC0;
}
.hyphenate {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test2.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test4.html">Next&nbsp;&rarr;</a></div>
<h1>Test 003</h1>
<p id="desc">Measure time (pattern-loading inclusive).</p>
<div id="result"><p>…</p></div>
<hr>
<div id="test1" class="test hyphenate" lang="en-us">
<p>In the year 1878 I took my degree of Doctor of Medicine of the University of London, and proceeded to Netley to go through the course prescribed for surgeons in the army. Having completed my studies there, I was duly attached to the Fifth Northumberland Fusiliers as Assistant Surgeon. The regiment was stationed in India at the time, and before I could join it, the second Afghan war had broken out. On landing at Bombay, I learned that my corps had advanced through the passes, and was already deep in the enemy's country. I followed, however, with many other officers who were in the same situation as myself, and succeeded in reaching Candahar in safety, where I found my regiment, and at once entered upon my new duties.</p>
<p>The campaign brought honours and promotion to many, but for me it had nothing but misfortune and disaster. I was removed from my brigade and attached to the Berkshires, with whom I served at the fatal battle of Maiwand. There I was struck on the shoulder by a Jezail bullet, which shattered the bone and grazed the subclavian artery. I should have fallen into the hands of the murderous Ghazis had it not been for the devotion and courage shown by Murray, my orderly, who threw me across a pack-horse, and succeeded in bringing me safely to the British lines.</p>
<p>Worn with pain, and weak from the prolonged hardships which I had undergone, I was removed, with a great train of wounded sufferers, to the base hospital at Peshawar. Here I rallied, and had already improved so far as to be able to walk about the wards, and even to bask a little upon the verandah, when I was struck down by enteric fever, that curse of our Indian possessions. For months my life was despaired of, and when at last I came to myself and became convalescent, I was so weak and emaciated that a medical board determined that not a day should be lost in sending me back to England. I was dispatched, accordingly, in the troopship <span style="font-style:italic;">Orontes</span>, and landed a month later on Portsmouth jetty, with my health irretrievably ruined, but with permission from a paternal government to spend the next nine months in attempting to improve it.</p>
<p>I had neither kith nor kin in England, and was therefore as free as air&mdash;or as free as an income of eleven shillings and sixpence a day will permit a man to be. Under such circumstances, I naturally gravitated to London, that great cesspool into which all the loungers and idlers of the Empire are irresistibly drained. There I stayed for some time at a private hotel in the Strand, leading a comfortless, meaningless existence, and spending such money as I had, considerably more freely than I ought. So alarming did the state of my finances become, that I soon realized that I must either leave the metropolis and rusticate somewhere in the country, or that I must make a complete alteration in my style of living. Choosing the latter alternative, I began by making up my mind to leave the hotel, and to take up my quarters in some less pretentious and less expensive domicile.</p>
<p>On the very day that I had come to this conclusion, I was standing at the Criterion Bar, when some one tapped me on the shoulder, and turning round I recognized young Stamford, who had been a dresser under me at Bart's. The sight of a friendly face in the great wilderness of London is a pleasant thing indeed to a lonely man. In old days Stamford had never been a particular crony of mine, but now I hailed him with enthusiasm, and he, in his turn, appeared to be delighted to see me. In the exuberance of my joy, I asked him to lunch with me at the Holborn, and we started off together in a hansom.</p>
<p>&ldquo;Whatever have you been doing with yourself, Watson?&rdquo; he asked in undisguised wonder, as we rattled through the crowded London streets. &ldquo;You are as thin as a lath and as brown as a nut.&rdquo;</p>
<p>I gave him a short sketch of my adventures, and had hardly concluded it by the time that we reached our destination.</p>
<p>&ldquo;Poor devil!&rdquo; he said, commiseratingly, after he had listened to my misfortunes. &ldquo;What are you up to now?&rdquo;</p>
<p>&ldquo;Looking for lodgings,&rdquo; I answered. &ldquo;Trying to solve the problem as to whether it is possible to get comfortable rooms at a reasonable price.&rdquo;</p>
<p>&ldquo;That's a strange thing,&rdquo; remarked my companion; &ldquo;you are the second man to-day that has used that expression to me.&rdquo;</p>
<p>&ldquo;And who was the first?&rdquo; I asked.</p>
<p>&ldquo;A fellow who is working at the chemical laboratory up at the hospital. He was bemoaning himself this morning because he could not get someone to go halves with him in some nice rooms which he had found, and which were too much for his purse.&rdquo;</p>
<p>&ldquo;By Jove!&rdquo; I cried, &ldquo;if he really wants someone to share the rooms and the expense, I am the very man for him. I should prefer having a partner to being alone.&rdquo;</p>
<p>Young Stamford looked rather strangely at me over his wine-glass. &ldquo;You don't know Sherlock Holmes yet,&rdquo; he said; &ldquo;perhaps you would not care for him as a constant companion.&rdquo;</p>
<p>&ldquo;Why, what is there against him?&rdquo;</p>
<p>&ldquo;Oh, I didn't say there was anything against him. He is a little queer in his ideas&mdash;an enthusiast in some branches of science. As far as I know he is a decent fellow enough.&rdquo;</p>
<p>&ldquo;A medical student, I suppose?&rdquo; said I.</p>
<p>&ldquo;No&mdash;I have no idea what he intends to go in for. I believe he is well up in anatomy, and he is a first-class chemist; but, as far as I know, he has never taken out any systematic medical classes. His studies are very desultory and eccentric, but he has amassed a lot of out-of-the way knowledge which would astonish his professors.&rdquo;</p>
<p>&ldquo;Did you never ask him what he was going in for?&rdquo; I asked.</p>
<p>&ldquo;No; he is not a man that it is easy to draw out, though he can be communicative enough when the fancy seizes him.&rdquo;</p>
<p>&ldquo;I should like to meet him,&rdquo; I said. &ldquo;If I am to lodge with anyone, I should prefer a man of studious and quiet habits. I am not strong enough yet to stand much noise or excitement. I had enough of both in Afghanistan to last me for the remainder of my natural existence. How could I meet this friend of yours?&rdquo;</p>
<p>&ldquo;He is sure to be at the laboratory,&rdquo; returned my companion. &ldquo;He either avoids the place for weeks, or else he works there from morning to night. If you like, we shall drive round together after luncheon.&rdquo;</p>
<p>&ldquo;Certainly,&rdquo; I answered, and the conversation drifted away into other channels.</p>
<p>As we made our way to the hospital after leaving the Holborn, Stamford gave me a few more particulars about the gentleman whom I proposed to take as a fellow-lodger.</p>
<p>&ldquo;You mustn't blame me if you don't get on with him,&rdquo; he said; &ldquo;I know nothing more of him than I have learned from meeting him occasionally in the laboratory. You proposed this arrangement, so you must not hold me responsible.&rdquo;</p>
<p>&ldquo;If we don't get on it will be easy to part company,&rdquo; I answered. &ldquo;It seems to me, Stamford,&rdquo; I added, looking hard at my companion, &ldquo;that you have some reason for washing your hands of the matter. Is this fellow's temper so formidable, or what is it? Don't be mealy-mouthed about it.&rdquo;</p>
<p>&ldquo;It is not easy to express the inexpressible,&rdquo; he answered with a laugh. &ldquo;Holmes is a little too scientific for my tastes&mdash;it approaches to cold-bloodedness. I could imagine his giving a friend a little pinch of the latest vegetable alkaloid, not out of malevolence, you understand, but simply out of a spirit of inquiry in order to have an accurate idea of the effects. To do him justice, I think that he would take it himself with the same readiness. He appears to have a passion for definite and exact knowledge.&rdquo;</p>
<p>&ldquo;Very right too.&rdquo;</p>
<p>&ldquo;Yes, but it may be pushed to excess. When it comes to beating the subjects in the dissecting-rooms with a stick, it is certainly taking rather a bizarre shape.&rdquo;</p>
<p>&ldquo;Beating the subjects!&rdquo;</p>
<p>&ldquo;Yes, to verify how far bruises may be produced after death. I saw him at it with my own eyes.&rdquo;</p>
<p>&ldquo;And yet you say he is not a medical student?&rdquo;</p>
<p>&ldquo;No. Heaven knows what the objects of his studies are. But here we are, and you must form your own impressions about him.&rdquo; As he spoke, we turned down a narrow lane and passed through a small side-door, which opened into a wing of the great hospital. It was familiar ground to me, and I needed no guiding as we ascended the bleak stone staircase and made our way down the long corridor with its vista of whitewashed wall and dun-coloured doors. Near the further end a low arched passage branched away from it and led to the chemical laboratory.</p>
<p>This was a lofty chamber, lined and littered with countless bottles. Broad, low tables were scattered about, which bristled with retorts, test-tubes, and little Bunsen lamps, with their blue flickering flames. There was only one student in the room, who was bending over a distant table absorbed in his work. At the sound of our steps he glanced round and sprang to his feet with a cry of pleasure. &ldquo;I've found it! I've found it,&rdquo; he shouted to my companion, running towards us with a test-tube in his hand. &ldquo;I have found a re-agent which is precipitated by h&#339;moglobin, and by nothing else.&rdquo; Had he discovered a gold mine, greater delight could not have shone upon his features.</p>
<p>&ldquo;Dr. Watson, Mr. Sherlock Holmes,&rdquo; said Stamford, introducing us.</p>
<p>&ldquo;How are you?&rdquo; he said cordially, gripping my hand with a strength for which I should hardly have given him credit. &ldquo;You have been in Afghanistan, I perceive.&rdquo;</p>
<p>&ldquo;How on earth did you know that?&rdquo; I asked in astonishment.</p>
<p>&ldquo;Never mind,&rdquo; said he, chuckling to himself. &ldquo;The question now is about h&#339;moglobin. No doubt you see the significance of this discovery of mine?&rdquo;</p>
<p>&ldquo;It is interesting, chemically, no doubt,&rdquo; I answered, &ldquo;but practically&mdash;&rdquo;</p>
<p>&ldquo;Why, man, it is the most practical medico-legal discovery for years. Don't you see that it gives us an infallible test for blood stains. Come over here now!&rdquo; He seized me by the coat-sleeve in his eagerness, and drew me over to the table at which he had been working. &ldquo;Let us have some fresh blood,&rdquo; he said, digging a long bodkin into his finger, and drawing off the resulting drop of blood in a chemical pipette. &ldquo;Now, I add this small quantity of blood to a litre of water. You perceive that the resulting mixture has the appearance of pure water. The proportion of blood cannot be more than one in a million. I have no doubt, however, that we shall be able to obtain the characteristic reaction.&rdquo; As he spoke, he threw into the vessel a few white crystals, and then added some drops of a transparent fluid. In an instant the contents assumed a dull mahogany colour, and a brownish dust was precipitated to the bottom of the glass jar.</p>
<p>&ldquo;Ha! ha!&rdquo; he cried, clapping his hands, and looking as delighted as a child with a new toy. &ldquo;What do you think of that?&rdquo;</p>
<p>&ldquo;It seems to be a very delicate test,&rdquo; I remarked.</p>
<p>&ldquo;Beautiful! beautiful! The old Guiacum test was very clumsy and uncertain. So is the microscopic examination for blood corpuscles. The latter is valueless if the stains are a few hours old. Now, this appears to act as well whether the blood is old or new. Had this test been invented, there are hundreds of men now walking the earth who would long ago have paid the penalty of their crimes.&rdquo;</p>
<p>&ldquo;Indeed!&rdquo; I murmured.</p>
<p>&ldquo;Criminal cases are continually hinging upon that one point. A man is suspected of a crime months perhaps after it has been committed. His linen or clothes are examined, and brownish stains discovered upon them. Are they blood stains, or mud stains, or rust stains, or fruit stains, or what are they? That is a question which has puzzled many an expert, and why? Because there was no reliable test. Now we have the Sherlock Holmes' test, and there will no longer be any difficulty.&rdquo;</p>
<p>His eyes fairly glittered as he spoke, and he put his hand over his heart and bowed as if to some applauding crowd conjured up by his imagination.</p>
<p>&ldquo;You are to be congratulated,&rdquo; I remarked, considerably surprised at his enthusiasm.</p>
<p>&ldquo;There was the case of Von Bischoff at Frankfort last year. He would certainly have been hung had this test been in existence. Then there was Mason of Bradford, and the notorious Muller, and Lefevre of Montpellier, and Samson of new Orleans. I could name a score of cases in which it would have been decisive.&rdquo;</p>
<p>&ldquo;You seem to be a walking calendar of crime,&rdquo; said Stamford with a laugh. &ldquo;You might start a paper on those lines. Call it the &lsquo;Police News of the Past.&rsquo;&rdquo;</p>
<p>&ldquo;Very interesting reading it might be made, too,&rdquo; remarked Sherlock Holmes, sticking a small piece of plaster over the prick on his finger. &ldquo;I have to be careful,&rdquo; he continued, turning to me with a smile, &ldquo;for I dabble with poisons a good deal.&rdquo; He held out his hand as he spoke, and I noticed that it was all mottled over with similar pieces of plaster, and discoloured with strong acids.</p>
<p>&ldquo;We came here on business,&rdquo; said Stamford, sitting down on a high three-legged stool, and pushing another one in my direction with his foot. &ldquo;My friend here wants to take diggings, and as you were complaining that you could get no one to go halves with you, I thought that I had better bring you together.&rdquo;</p>
<p>Sherlock Holmes seemed delighted at the idea of sharing his rooms with me. &ldquo;I have my eye on a suite in Baker Street,&rdquo; he said, &ldquo;which would suit us down to the ground. You don't mind the smell of strong tobacco, I hope?&rdquo;</p>
<p>&ldquo;I always smoke &lsquo;ship's&rsquo; myself,&rdquo; I answered.</p>
<p>&ldquo;That's good enough. I generally have chemicals about, and occasionally do experiments. Would that annoy you?&rdquo;</p>
<p>&ldquo;By no means.&rdquo;</p>
<p>&ldquo;Let me see&mdash;what are my other shortcomings. I get in the dumps at times, and don't open my mouth for days on end. You must not think I am sulky when I do that. Just let me alone, and I'll soon be right. What have you to confess now? It's just as well for two fellows to know the worst of one another before they begin to live together.&rdquo;</p>
<p>I laughed at this cross-examination. &ldquo;I keep a bull pup,&rdquo; I said, &ldquo;and I object to rows because my nerves are shaken, and I get up at all sorts of ungodly hours, and I am extremely lazy. I have another set of vices when I'm well, but those are the principal ones at present.&rdquo;</p>
<p>&ldquo;Do you include violin-playing in your category of rows?&rdquo; he asked, anxiously.</p>
<p>&ldquo;It depends on the player,&rdquo; I answered. &ldquo;A well-played violin is a treat for the gods&mdash;a badly-played one&mdash;&rdquo;</p>
<p>&ldquo;Oh, that's all right,&rdquo; he cried, with a merry laugh. &ldquo;I think we may consider the thing as settled&mdash;that is, if the rooms are agreeable to you.&rdquo;</p>
<p>&ldquo;When shall we see them?&rdquo;</p>
<p>&ldquo;Call for me here at noon to-morrow, and we'll go together and settle everything,&rdquo; he answered.</p>
<p>&ldquo;All right&mdash;noon exactly,&rdquo; said I, shaking his hand.</p>
<p>We left him working among his chemicals, and we walked together towards my hotel.</p>
<p>&ldquo;By the way,&rdquo; I asked suddenly, stopping and turning upon Stamford, &ldquo;how the deuce did he know that I had come from Afghanistan?&rdquo;</p>
<p>My companion smiled an enigmatical smile. &ldquo;That's just his little peculiarity,&rdquo; he said. &ldquo;A good many people have wanted to know how he finds things out.&rdquo;</p>
<p>&ldquo;Oh! a mystery is it?&rdquo; I cried, rubbing my hands. &ldquo;This is very piquant. I am much obliged to you for bringing us together. &lsquo;The proper study of mankind is man,&rsquo; you know.&rdquo;</p>
<p>&ldquo;You must study him, then,&rdquo; Stamford said, as he bade me good-bye. &ldquo;You'll find him a knotty problem, though. I'll wager he learns more about you than you about him. Good-bye.&rdquo;</p>
<p>&ldquo;Good-bye,&rdquo; I answered, and strolled on to my hotel, considerably interested in my new acquaintance.</p>
</div>
<hr>
</body>
</html>
@@ -0,0 +1,107 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 030</title>
<script>
var Hyphenopoly = {
require: {
"en-us": "FORCEHYPHENOPOLY"
},
setup: {
classnames: {
"hyphenopoly": {}
},
selectors: {
".hyphenate": {
hyphen: "|"
},
"#test2": {
hyphen: "•"
},
"p#test3": {
hyphen: "·"
},
"h2+p": {
hyphen: "⁄"
}
}
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
}
}
};
function assert() {
var tests = 4;
var i = 1;
var test = "";
var ref = "";
var result = true;
while (i <= tests) {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<span style=\"background-color: #d6ffd6\">" + (function (i) {
return (i < 10) ? "0" + i : i;
}(i)) + "</span> ";
result = result && true;
} else {
document.getElementById("result").innerHTML += "<span style=\"background-color: #ffd6d6\">" + (function (i) {
return (i < 10) ? "0" + i : i;
}(i)) + "</span> ";
result = false;
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 30,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test29.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test31.html">Next&nbsp;&rarr;</a></div>
<h1>Test 030</h1>
<p id="desc">Select elements with selectors instead of classes.</p>
<div id="result">R: </div>
<hr>
<h2>1: use classname to select</h2>
<p id="test1" class="test hyphenate">A hyphenation algorithm is a set of rules that decides at which points a word can be broken over two lines with a hyphen.</p>
<p id="ref1" class="ref">A hy|phen|ation al|go|rithm is a set of rules that de|cides at which points a word can be bro|ken over two lines with a hy|phen.</p>
<h2>2: use id to select</h2>
<p id="test2" class="test">A hyphenation algorithm is a set of rules that decides at which points a word can be broken over two lines with a hyphen.</p>
<p id="ref2" class="ref">A hy•phen•ation al•go•rithm is a set of rules that de•cides at which points a word can be bro•ken over two lines with a hy•phen.</p>
<h2>3: use element and id to select</h2>
<p id="test3" class="test">A hyphenation algorithm is a set of rules that decides at which points a word can be broken over two lines with a hyphen.</p>
<p id="ref3" class="ref">A hy·phen·ation al·go·rithm is a set of rules that de·cides at which points a word can be bro·ken over two lines with a hy·phen.</p>
<h2>4: use siblings to select</h2>
<p id="test4" class="test">A hyphenation algorithm is a set of rules that decides at which points a word can be broken over two lines with a hyphen.</p>
<p id="ref4" class="ref">A hy⁄phen⁄ation al⁄go⁄rithm is a set of rules that de⁄cides at which points a word can be bro⁄ken over two lines with a hy⁄phen.</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,96 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 031</title>
<script>
var Hyphenopoly = {
require: {
"de": "FORCEHYPHENOPOLY"
},
setup: {
dontHyphenateClass: "nohyphens",
selectors: {
".hyphenate": {
hyphen: "•"
},
".h9n_btn": {}
}
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
}
}
};
function assert() {
var tests = 1;
var i = 1;
var test = "";
var ref = "";
var result = false;
while (i <= tests) {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed</p>";
result = result || true;
} else {
document.getElementById("result").innerHTML += "<p style=\"background-color: #ffd6d6\">" + i + " failed</p>";
result = result || false;
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 31,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
.h9n_btn {
width: 5em;
text-align: left;
}
.hyphenate {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test30.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test32.html">Next&nbsp;&rarr;</a></div>
<h1>Test 031</h1>
<p id="desc">Check dontHyphenateClass</p>
<div id="result"></div>
<hr>
<p id="test1" class="test hyphenate" lang="de">Silbentrennung <span class="nohyphens">Silbentrennung</span> Silbentrennung</p>
<p id="ref1" class="ref" lang="de">Sil•ben•tren•nung <span class="nohyphens">Silbentrennung</span> Sil•ben•tren•nung</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,143 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 032</title>
<script>
var result = false;
let assertRuns = 0;
function assert() {
const mql = window.matchMedia("(max-width: 600px)");
var tests = 4;
var i = 1;
var test = "";
var ref = "";
while (i <= tests) {
test = document.getElementById("test" + i).innerHTML;
if (mql.matches) {
ref = document.getElementById("ref" + i).innerHTML;
} else {
ref = document.getElementById("ref" + i + "_u").innerHTML;
}
if (test === ref) {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed</p>";
result = result || true;
} else {
document.getElementById("result").innerHTML += "<p style=\"background-color: #ffd6d6\">" + i + " failed</p>";
result = result || false;
}
i += 1;
}
assertRuns += 1;
if (assertRuns === 2 && parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 32,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
(function selectiveLoad() {
let H9YLisLoaded = false;
function handleSize(mql) {
if (mql.matches) {
if (H9YLisLoaded) {
window.Hyphenopoly.events.dispatch(
"contentLoaded",
{"msg": ["contentLoaded"]}
);
} else {
window.Hyphenopoly = {
require: {
"de": "FORCEHYPHENOPOLY",
"en-us": "FORCEHYPHENOPOLY"
},
setup: {
selectors: {
".hyphenate": {
hyphen: "•"
}
}
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
if (parent != window) {
window.parent.document.getElementById("testframe").width = "800px";
}
}
}
};
const loaderScript = document.createElement("script");
loaderScript.src = "../Hyphenopoly_Loader.js";
document.head.appendChild(loaderScript);
H9YLisLoaded = true;
}
} else {
if (H9YLisLoaded) {
window.Hyphenopoly.unhyphenate();
assert();
} else {
window.onload = function() {
assert();
}
}
}
}
const mql = window.matchMedia("(max-width: 600px)");
mql.addListener(handleSize);
handleSize(mql);
}());
</script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
@media (max-width: 600px) {
.hyphenate {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test31.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test33.html">Next&nbsp;&rarr;</a></div>
<h1>Test 032</h1>
<p id="desc">Make hyphenation viewport dependent (resize window!)</p>
<div id="result"></div>
<hr>
<p id="test1" class="test hyphenate" lang="de">Silbentrennungsalgorithmus</p>
<p id="ref1" class="ref" lang="de">Sil•ben•tren•nungs•al•go•rith•mus</p>
<p id="ref1_u" class="ref" lang="de">Silbentrennungsalgorithmus</p>
<p id="test2" class="test hyphenate" lang="de">Silbentrennungsalgorithmus <span>Donaudampfschiff</span></p>
<p id="ref2" class="ref" lang="de">Sil•ben•tren•nungs•al•go•rith•mus <span>Do•nau•dampf•schiff</span></p>
<p id="ref2_u" class="ref" lang="de">Silbentrennungsalgorithmus <span>Donaudampfschiff</span></p>
<p id="test3" class="test hyphenate" lang="de">Silbentrennungsalgorithmus <span class="donthyphenate">Donaudampfschiff</span></p>
<p id="ref3" class="ref" lang="de">Sil•ben•tren•nungs•al•go•rith•mus <span class="donthyphenate">Donaudampfschiff</span></p>
<p id="ref3_u" class="ref" lang="de">Silbentrennungsalgorithmus <span class="donthyphenate">Donaudampfschiff</span></p>
<p id="test4" class="test hyphenate" lang="de">Silbentrennungsalgorithmus <span lang="en-us">hyphenation</span></p>
<p id="ref4" class="ref" lang="de">Sil•ben•tren•nungs•al•go•rith•mus <span lang="en-us">hy•phen•ation</span></p>
<p id="ref4_u" class="ref" lang="de">Silbentrennungsalgorithmus <span lang="en-us">hyphenation</span></p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,99 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 033</title>
<script>
var Hyphenopoly = {
require: {
"en-us": "FORCEHYPHENOPOLY",
"en-au": "FORCEHYPHENOPOLY"
},
fallbacks: {
"en-au": "en-us"
},
setup: {
safeCopy: false
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
}
}
};
function assert() {
var tests = 2;
var i = 1;
var test = "";
var ref = "";
var result = true;
var lang = "";
while (i <= tests) {
lang = document.getElementById("test" + i).lang;
if (Hyphenopoly.cf.langs[lang] === "CSS") {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed (CSS)</p>";
result = result && true;
} else {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed</p>";
result = result && true;
} else {
document.getElementById("result").innerHTML += "<p style=\"background-color: #ffd6d6\">" + i + " failed</p>";
result = false;
}
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 33,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
.hyphenate {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test32.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test34.html">Next&nbsp;&rarr;</a></div>
<h1>Test 033</h1>
<p id="desc">Make sure en-us.hpb isn't loaded twice (see network tab).</p>
<div id="result"></div>
<hr>
<h2>1: en-au</h2>
<p id="test1" class="test hyphenate" lang="en-au">A hyphenation algorithm is a set of rules that decides at which points a word can be broken over two lines with a hyphen.</p>
<p id="ref1" class="ref" lang="en-au">A hy&shy;phen&shy;ation al&shy;go&shy;rithm is a set of rules that de&shy;cides at which points a word can be bro&shy;ken over two lines with a hy&shy;phen.</p>
<h2>2: en</h2>
<p id="test2" class="test hyphenate" lang="en-us">A hyphenation algorithm is a set of rules that decides at which points a word can be broken over two lines with a hyphen.</p>
<p id="ref2" class="ref" lang="en">A hy&shy;phen&shy;ation al&shy;go&shy;rithm is a set of rules that de&shy;cides at which points a word can be bro&shy;ken over two lines with a hy&shy;phen.</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,97 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 034</title>
<script>
var Hyphenopoly = {
require: {
"foobar": "garzabariktimalborsi",
"en-us": "FORCEHYPHENOPOLY"
},
setup: {
safeCopy: false,
checkRes: true
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
}
}
};
function assert() {
var tests = 2;
var i = 1;
var test = "";
var ref = "";
var result = true;
var lang = "";
while (i <= tests) {
lang = document.getElementById("test" + i).lang;
if (Hyphenopoly.cf.langs[lang] === "CSS") {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed (CSS)</p>";
result = result && true;
} else {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed</p>";
result = result && true;
} else {
document.getElementById("result").innerHTML += "<p style=\"background-color: #ffd6d6\">" + i + " failed</p>";
result = false;
}
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 34,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
.hyphenate {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test33.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test35.html">Next&nbsp;&rarr;</a></div>
<h1>Test 034</h1>
<p id="desc">Recover from 404 if .hpb doesn't exist.</p>
<div id="result"></div>
<hr>
<h2>1: foobar</h2>
<p id="test1" class="test hyphenate" lang="foobar">Izgarz blonab schub ei follar quabsi zubur ma na fnaghi. Dalla burksi fad pelo i fnagha werksnar.</p>
<p id="ref1" class="ref" lang="foobar">Izgarz blonab schub ei follar quabsi zubur ma na fnaghi. Dalla burksi fad pelo i fnagha werksnar.</p>
<h2>2: en</h2>
<p id="test2" class="test hyphenate" lang="en-us">A hyphenation algorithm is a set of rules that decides at which points a word can be broken over two lines with a hyphen.</p>
<p id="ref2" class="ref" lang="en">A hy&shy;phen&shy;ation al&shy;go&shy;rithm is a set of rules that de&shy;cides at which points a word can be bro&shy;ken over two lines with a hy&shy;phen.</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,86 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 035</title>
<script>
var Hyphenopoly = {
require: {
"hu": "FORCEHYPHENOPOLY"
},
setup: {
selectors: {
".hyphenate": {
hyphen: "•"
}
}
},
handleEvent: {
hyphenopolyEnd: function (e) {
window.Hyphenopoly = null;
assert();
}
}
};
function assert() {
var test = document.getElementById("test1").innerHTML;;
var ref = document.getElementById("ref1").innerHTML;;
var result = false;
if (test === ref) {
result = result || true;
} else {
result = result || false;
}
result = result && !window.Hyphenopoly;
if (result) {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">passed</p>";
} else {
document.getElementById("result").innerHTML += "<p style=\"background-color: #ffd6d6\">failed</p>";
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 35,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
.hyphenate {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test34.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test36.html">Next&nbsp;&rarr;</a></div>
<h1>Test 035</h1>
<p id="desc">Remove Hyphenopoly when finished.</p>
<div id="result"></div>
<hr>
<p id="test1" class="test hyphenate" lang="hu">automatikusan</p>
<p id="ref1" class="ref" lang="hu">au•to•ma•ti•ku•san</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,128 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 036</title>
<script>
var mode = window.location.search.substring(1);
var path = "../patterns/";
if (mode === "fail") {
path = "../pattern/"
}
var Hyphenopoly = {
require: {
"fur": "probabilmentri"
},
paths: {
patterndir: path
},
setup: {
selectors: {
".hyphenate": {
hyphen: "|",
minWordLength: 4
}
}
}
};
window.onload = function () {
function hyphenate_fur(text) {
if (window.Promise) {
Hyphenopoly.hyphenators.fur.then(
function (furhyph) {
document.getElementById("test1").innerText = furhyph(text);
assertAll();
}).catch(function(e) {
assertError(e);
});
} else {
result = false
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 36,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
}
hyphenate_fur("Il furlan e je une lenghe romanze de famee des lenghis retichis, che e je fevelade soredut intal Friûl, ma ancje vie pal mont. Cualchi volte al ven clamât Ladin orientâl, parcè che al à diviers ponts in comun cul ladin, ma si è svilupât in un altri mût cul passâ dal timp, sot de influence des lenghis ator dal Friûl");
};
function assertError(e) {
var result = false;
if (e.message.indexOf("File fur.hpb can't be loaded from ../pattern/") !== -1) {
result = true;
}
if (result) {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + 1 + " passed</p>";
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 36,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
function assertAll() {
var tests = 1;
var i = 1;
var test = "";
var ref = "";
var result = false;
while (i <= tests) {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed</p>";
result = result || true;
} else {
document.getElementById("result").innerHTML += "<p style=\"background-color: #ffd6d6\">" + i + " failed</p>";
result = result || false;
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 36,
result: (result ? "passed" : "failed")
}), window.location.href);
}
window.location = "test36.html?fail";
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
hyphens: auto;
}
.ref {
background-color: #FEEFC0;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test35.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test37.html">Next&nbsp;&rarr;</a></div>
<h1>Test 036</h1>
<p id="desc">Reject hyphenator-promise if pattern can't be loaded.</p>
<div id="result"></div>
<hr>
<h2>fur</h2>
<p id="test1" lang="fur" class="test hyphenate"></p>
<p id="ref1" lang="fur" class="ref">Il fur|lan e je une len|ghe ro|man|ze de fa|mee des len|ghis re|ti|chis, che e je fe|ve|la|de so|re|dut in|tal Friûl, ma an|cje vie pal mont. Cual|chi vol|te al ven clamât La|din orientâl, parcè che al à di|viers ponts in co|mun cul la|din, ma si è svi|lupât in un al|tri mût cul pa|ssâ dal timp, sot de in|fluen|ce des len|ghis ator dal Friûl</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,128 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 037</title>
<script>
var mode = window.location.search.substring(1);
var path = "../";
if (mode === "fail") {
path = "../foobar/"
}
var Hyphenopoly = {
require: {
"fur": "probabilmentri"
},
paths: {
maindir: path
},
setup: {
selectors: {
".hyphenate": {
hyphen: "|",
minWordLength: 4
}
}
}
};
window.onload = function () {
function hyphenate_fur(text) {
if (window.Promise) {
Hyphenopoly.hyphenators.fur.then(
function (furhyph) {
document.getElementById("test1").innerText = furhyph(text);
assertAll();
}).catch(function(e) {
assertError(e);
});
} else {
result = false
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 37,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
}
hyphenate_fur("Il furlan e je une lenghe romanze de famee des lenghis retichis, che e je fevelade soredut intal Friûl, ma ancje vie pal mont. Cualchi volte al ven clamât Ladin orientâl, parcè che al à diviers ponts in comun cul ladin, ma si è svilupât in un altri mût cul passâ dal timp, sot de influence des lenghis ator dal Friûl");
};
function assertError(e) {
var result = false;
if (e.message.indexOf("File hyphenEngine.wasm can't be loaded from ../foobar/") !== -1) {
result = true;
}
if (result) {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + 1 + " passed</p>";
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 37,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
function assertAll() {
var tests = 1;
var i = 1;
var test = "";
var ref = "";
var result = false;
while (i <= tests) {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed</p>";
result = result || true;
} else {
document.getElementById("result").innerHTML += "<p style=\"background-color: #ffd6d6\">" + i + " failed</p>";
result = result || false;
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 37,
result: (result ? "passed" : "failed")
}), window.location.href);
}
window.location = "test37.html?fail";
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
hyphens: auto;
}
.ref {
background-color: #FEEFC0;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test36.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test38.html">Next&nbsp;&rarr;</a></div>
<h1>Test 037</h1>
<p id="desc">Reject hyphenator-promise if engine can't be loaded.</p>
<div id="result"></div>
<hr>
<h2>fur</h2>
<p id="test1" lang="fur" class="test hyphenate"></p>
<p id="ref1" lang="fur" class="ref">Il fur|lan e je une len|ghe ro|man|ze de fa|mee des len|ghis re|ti|chis, che e je fe|ve|la|de so|re|dut in|tal Friûl, ma an|cje vie pal mont. Cual|chi vol|te al ven clamât La|din orientâl, parcè che al à di|viers ponts in co|mun cul la|din, ma si è svi|lupât in un al|tri mût cul pa|ssâ dal timp, sot de in|fluen|ce des len|ghis ator dal Friûl</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,131 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 038</title>
<script>
var mode = window.location.search.substring(1);
var path = "../patterns/";
var result = false;
var Hyphenopoly = {
require: {
"de": "FORCEHYPHENOPOLY",
"en": "FORCEHYPHENOPOLY"
},
paths: {
patterndir: path
},
setup: {
selectors: {
".hyphenate": {
hyphen: "|",
minWordLength: 4
}
}
}
};
window.onload = function () {
if (window.Promise) {
function hyphenate_en(text) {
Hyphenopoly.hyphenators["en"].then(
function (enhyph) {
document.getElementById("test1").innerText = enhyph(text);
assertAll();
}).catch(function(e) {
assertError(e);
});
}
function hyphenate_de(text) {
Hyphenopoly.hyphenators["de"].then(
function (dehyph) {
document.getElementById("test2").innerText = dehyph(text);
assertAll();
}).catch(function(e) {
assertError(e);
});
}
hyphenate_en("hyphenation algorithm");
hyphenate_de("Silbentrennungsalgorithmus");
} else {
result = false
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 38,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
};
function assertError(e) {
if (e.message.indexOf("File en.hpb can't be loaded from ../patterns/") !== -1) {
result = true;
}
if (result) {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + 1 + " passed</p>";
}
}
function assertAll() {
var tests = 2;
var i = 2;
var test = "";
var ref = "";
while (i <= tests) {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed</p>";
result = result || true;
} else {
document.getElementById("result").innerHTML += "<p style=\"background-color: #ffd6d6\">" + i + " failed</p>";
result = result || false;
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 38,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
hyphens: auto;
}
.ref {
background-color: #FEEFC0;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test37.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test39.html">Next&nbsp;&rarr;</a></div>
<h1>Test 038</h1>
<p id="desc">Reject only hyphenator-promise if it's pattern can't be loaded.</p>
<div id="result"></div>
<hr>
<h2>en-us</h2>
<p id="test1" lang="en-us" class="test"></p>
<p id="ref1" lang="en-us" class="ref">hy|phen|ation al|go|rithm</p>
<h2>de</h2>
<p id="test2" lang="de" class="test"></p>
<p id="ref2" lang="de" class="ref">Sil|ben|tren|nungs|al|go|rith|mus</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,214 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 004</title>
<script>
var startTime;
var Hyphenopoly = {
require: {
"en-us": "FORCEHYPHENOPOLY"
},
handleEvent: {
hyphenopolyStart: function () {
startTime = performance.now();
},
hyphenopolyEnd: function (e) {
assert();
}
}
};
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<script>
function assert() {
var endTime = performance.now();
document.getElementById("result").innerHTML = "<p style=\"background-color: #d6ffd6\">" + (Math.round((endTime - startTime) * 100) / 100).toString() + " ms</p>";
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 4,
result: Math.round((endTime - startTime) * 100) / 100
}), window.location.href);
}
}
if (!Hyphenopoly) {
document.addEventListener("DOMContentLoaded", function () {
document.getElementById("result").innerHTML = "<p style=\"background-color: #d6ffd6\">" + "CSS</p>";
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 4,
result: "CSS"
}), window.location.href);
}
});
}
</script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
text-align: justify;
}
.ref {
background-color: #FEEFC0;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test3.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test5.html">Next&nbsp;&rarr;</a></div>
<h1>Test 004</h1>
<p id="desc">Measure time (pattern-loading exclusive).</p>
<div id="result"><p>…</p></div>
<hr>
<div id="test1" class="test hyphenate" lang="en-us">
<p>In the year 1878 I took my degree of Doctor of Medicine of the University of London, and proceeded to Netley to go through the course prescribed for surgeons in the army. Having completed my studies there, I was duly attached to the Fifth Northumberland Fusiliers as Assistant Surgeon. The regiment was stationed in India at the time, and before I could join it, the second Afghan war had broken out. On landing at Bombay, I learned that my corps had advanced through the passes, and was already deep in the enemy's country. I followed, however, with many other officers who were in the same situation as myself, and succeeded in reaching Candahar in safety, where I found my regiment, and at once entered upon my new duties.</p>
<p>The campaign brought honours and promotion to many, but for me it had nothing but misfortune and disaster. I was removed from my brigade and attached to the Berkshires, with whom I served at the fatal battle of Maiwand. There I was struck on the shoulder by a Jezail bullet, which shattered the bone and grazed the subclavian artery. I should have fallen into the hands of the murderous Ghazis had it not been for the devotion and courage shown by Murray, my orderly, who threw me across a pack-horse, and succeeded in bringing me safely to the British lines.</p>
<p>Worn with pain, and weak from the prolonged hardships which I had undergone, I was removed, with a great train of wounded sufferers, to the base hospital at Peshawar. Here I rallied, and had already improved so far as to be able to walk about the wards, and even to bask a little upon the verandah, when I was struck down by enteric fever, that curse of our Indian possessions. For months my life was despaired of, and when at last I came to myself and became convalescent, I was so weak and emaciated that a medical board determined that not a day should be lost in sending me back to England. I was dispatched, accordingly, in the troopship <span style="font-style:italic;">Orontes</span>, and landed a month later on Portsmouth jetty, with my health irretrievably ruined, but with permission from a paternal government to spend the next nine months in attempting to improve it.</p>
<p>I had neither kith nor kin in England, and was therefore as free as air&mdash;or as free as an income of eleven shillings and sixpence a day will permit a man to be. Under such circumstances, I naturally gravitated to London, that great cesspool into which all the loungers and idlers of the Empire are irresistibly drained. There I stayed for some time at a private hotel in the Strand, leading a comfortless, meaningless existence, and spending such money as I had, considerably more freely than I ought. So alarming did the state of my finances become, that I soon realized that I must either leave the metropolis and rusticate somewhere in the country, or that I must make a complete alteration in my style of living. Choosing the latter alternative, I began by making up my mind to leave the hotel, and to take up my quarters in some less pretentious and less expensive domicile.</p>
<p>On the very day that I had come to this conclusion, I was standing at the Criterion Bar, when some one tapped me on the shoulder, and turning round I recognized young Stamford, who had been a dresser under me at Bart's. The sight of a friendly face in the great wilderness of London is a pleasant thing indeed to a lonely man. In old days Stamford had never been a particular crony of mine, but now I hailed him with enthusiasm, and he, in his turn, appeared to be delighted to see me. In the exuberance of my joy, I asked him to lunch with me at the Holborn, and we started off together in a hansom.</p>
<p>&ldquo;Whatever have you been doing with yourself, Watson?&rdquo; he asked in undisguised wonder, as we rattled through the crowded London streets. &ldquo;You are as thin as a lath and as brown as a nut.&rdquo;</p>
<p>I gave him a short sketch of my adventures, and had hardly concluded it by the time that we reached our destination.</p>
<p>&ldquo;Poor devil!&rdquo; he said, commiseratingly, after he had listened to my misfortunes. &ldquo;What are you up to now?&rdquo;</p>
<p>&ldquo;Looking for lodgings,&rdquo; I answered. &ldquo;Trying to solve the problem as to whether it is possible to get comfortable rooms at a reasonable price.&rdquo;</p>
<p>&ldquo;That's a strange thing,&rdquo; remarked my companion; &ldquo;you are the second man to-day that has used that expression to me.&rdquo;</p>
<p>&ldquo;And who was the first?&rdquo; I asked.</p>
<p>&ldquo;A fellow who is working at the chemical laboratory up at the hospital. He was bemoaning himself this morning because he could not get someone to go halves with him in some nice rooms which he had found, and which were too much for his purse.&rdquo;</p>
<p>&ldquo;By Jove!&rdquo; I cried, &ldquo;if he really wants someone to share the rooms and the expense, I am the very man for him. I should prefer having a partner to being alone.&rdquo;</p>
<p>Young Stamford looked rather strangely at me over his wine-glass. &ldquo;You don't know Sherlock Holmes yet,&rdquo; he said; &ldquo;perhaps you would not care for him as a constant companion.&rdquo;</p>
<p>&ldquo;Why, what is there against him?&rdquo;</p>
<p>&ldquo;Oh, I didn't say there was anything against him. He is a little queer in his ideas&mdash;an enthusiast in some branches of science. As far as I know he is a decent fellow enough.&rdquo;</p>
<p>&ldquo;A medical student, I suppose?&rdquo; said I.</p>
<p>&ldquo;No&mdash;I have no idea what he intends to go in for. I believe he is well up in anatomy, and he is a first-class chemist; but, as far as I know, he has never taken out any systematic medical classes. His studies are very desultory and eccentric, but he has amassed a lot of out-of-the way knowledge which would astonish his professors.&rdquo;</p>
<p>&ldquo;Did you never ask him what he was going in for?&rdquo; I asked.</p>
<p>&ldquo;No; he is not a man that it is easy to draw out, though he can be communicative enough when the fancy seizes him.&rdquo;</p>
<p>&ldquo;I should like to meet him,&rdquo; I said. &ldquo;If I am to lodge with anyone, I should prefer a man of studious and quiet habits. I am not strong enough yet to stand much noise or excitement. I had enough of both in Afghanistan to last me for the remainder of my natural existence. How could I meet this friend of yours?&rdquo;</p>
<p>&ldquo;He is sure to be at the laboratory,&rdquo; returned my companion. &ldquo;He either avoids the place for weeks, or else he works there from morning to night. If you like, we shall drive round together after luncheon.&rdquo;</p>
<p>&ldquo;Certainly,&rdquo; I answered, and the conversation drifted away into other channels.</p>
<p>As we made our way to the hospital after leaving the Holborn, Stamford gave me a few more particulars about the gentleman whom I proposed to take as a fellow-lodger.</p>
<p>&ldquo;You mustn't blame me if you don't get on with him,&rdquo; he said; &ldquo;I know nothing more of him than I have learned from meeting him occasionally in the laboratory. You proposed this arrangement, so you must not hold me responsible.&rdquo;</p>
<p>&ldquo;If we don't get on it will be easy to part company,&rdquo; I answered. &ldquo;It seems to me, Stamford,&rdquo; I added, looking hard at my companion, &ldquo;that you have some reason for washing your hands of the matter. Is this fellow's temper so formidable, or what is it? Don't be mealy-mouthed about it.&rdquo;</p>
<p>&ldquo;It is not easy to express the inexpressible,&rdquo; he answered with a laugh. &ldquo;Holmes is a little too scientific for my tastes&mdash;it approaches to cold-bloodedness. I could imagine his giving a friend a little pinch of the latest vegetable alkaloid, not out of malevolence, you understand, but simply out of a spirit of inquiry in order to have an accurate idea of the effects. To do him justice, I think that he would take it himself with the same readiness. He appears to have a passion for definite and exact knowledge.&rdquo;</p>
<p>&ldquo;Very right too.&rdquo;</p>
<p>&ldquo;Yes, but it may be pushed to excess. When it comes to beating the subjects in the dissecting-rooms with a stick, it is certainly taking rather a bizarre shape.&rdquo;</p>
<p>&ldquo;Beating the subjects!&rdquo;</p>
<p>&ldquo;Yes, to verify how far bruises may be produced after death. I saw him at it with my own eyes.&rdquo;</p>
<p>&ldquo;And yet you say he is not a medical student?&rdquo;</p>
<p>&ldquo;No. Heaven knows what the objects of his studies are. But here we are, and you must form your own impressions about him.&rdquo; As he spoke, we turned down a narrow lane and passed through a small side-door, which opened into a wing of the great hospital. It was familiar ground to me, and I needed no guiding as we ascended the bleak stone staircase and made our way down the long corridor with its vista of whitewashed wall and dun-coloured doors. Near the further end a low arched passage branched away from it and led to the chemical laboratory.</p>
<p>This was a lofty chamber, lined and littered with countless bottles. Broad, low tables were scattered about, which bristled with retorts, test-tubes, and little Bunsen lamps, with their blue flickering flames. There was only one student in the room, who was bending over a distant table absorbed in his work. At the sound of our steps he glanced round and sprang to his feet with a cry of pleasure. &ldquo;I've found it! I've found it,&rdquo; he shouted to my companion, running towards us with a test-tube in his hand. &ldquo;I have found a re-agent which is precipitated by h&#339;moglobin, and by nothing else.&rdquo; Had he discovered a gold mine, greater delight could not have shone upon his features.</p>
<p>&ldquo;Dr. Watson, Mr. Sherlock Holmes,&rdquo; said Stamford, introducing us.</p>
<p>&ldquo;How are you?&rdquo; he said cordially, gripping my hand with a strength for which I should hardly have given him credit. &ldquo;You have been in Afghanistan, I perceive.&rdquo;</p>
<p>&ldquo;How on earth did you know that?&rdquo; I asked in astonishment.</p>
<p>&ldquo;Never mind,&rdquo; said he, chuckling to himself. &ldquo;The question now is about h&#339;moglobin. No doubt you see the significance of this discovery of mine?&rdquo;</p>
<p>&ldquo;It is interesting, chemically, no doubt,&rdquo; I answered, &ldquo;but practically&mdash;&rdquo;</p>
<p>&ldquo;Why, man, it is the most practical medico-legal discovery for years. Don't you see that it gives us an infallible test for blood stains. Come over here now!&rdquo; He seized me by the coat-sleeve in his eagerness, and drew me over to the table at which he had been working. &ldquo;Let us have some fresh blood,&rdquo; he said, digging a long bodkin into his finger, and drawing off the resulting drop of blood in a chemical pipette. &ldquo;Now, I add this small quantity of blood to a litre of water. You perceive that the resulting mixture has the appearance of pure water. The proportion of blood cannot be more than one in a million. I have no doubt, however, that we shall be able to obtain the characteristic reaction.&rdquo; As he spoke, he threw into the vessel a few white crystals, and then added some drops of a transparent fluid. In an instant the contents assumed a dull mahogany colour, and a brownish dust was precipitated to the bottom of the glass jar.</p>
<p>&ldquo;Ha! ha!&rdquo; he cried, clapping his hands, and looking as delighted as a child with a new toy. &ldquo;What do you think of that?&rdquo;</p>
<p>&ldquo;It seems to be a very delicate test,&rdquo; I remarked.</p>
<p>&ldquo;Beautiful! beautiful! The old Guiacum test was very clumsy and uncertain. So is the microscopic examination for blood corpuscles. The latter is valueless if the stains are a few hours old. Now, this appears to act as well whether the blood is old or new. Had this test been invented, there are hundreds of men now walking the earth who would long ago have paid the penalty of their crimes.&rdquo;</p>
<p>&ldquo;Indeed!&rdquo; I murmured.</p>
<p>&ldquo;Criminal cases are continually hinging upon that one point. A man is suspected of a crime months perhaps after it has been committed. His linen or clothes are examined, and brownish stains discovered upon them. Are they blood stains, or mud stains, or rust stains, or fruit stains, or what are they? That is a question which has puzzled many an expert, and why? Because there was no reliable test. Now we have the Sherlock Holmes' test, and there will no longer be any difficulty.&rdquo;</p>
<p>His eyes fairly glittered as he spoke, and he put his hand over his heart and bowed as if to some applauding crowd conjured up by his imagination.</p>
<p>&ldquo;You are to be congratulated,&rdquo; I remarked, considerably surprised at his enthusiasm.</p>
<p>&ldquo;There was the case of Von Bischoff at Frankfort last year. He would certainly have been hung had this test been in existence. Then there was Mason of Bradford, and the notorious Muller, and Lefevre of Montpellier, and Samson of new Orleans. I could name a score of cases in which it would have been decisive.&rdquo;</p>
<p>&ldquo;You seem to be a walking calendar of crime,&rdquo; said Stamford with a laugh. &ldquo;You might start a paper on those lines. Call it the &lsquo;Police News of the Past.&rsquo;&rdquo;</p>
<p>&ldquo;Very interesting reading it might be made, too,&rdquo; remarked Sherlock Holmes, sticking a small piece of plaster over the prick on his finger. &ldquo;I have to be careful,&rdquo; he continued, turning to me with a smile, &ldquo;for I dabble with poisons a good deal.&rdquo; He held out his hand as he spoke, and I noticed that it was all mottled over with similar pieces of plaster, and discoloured with strong acids.</p>
<p>&ldquo;We came here on business,&rdquo; said Stamford, sitting down on a high three-legged stool, and pushing another one in my direction with his foot. &ldquo;My friend here wants to take diggings, and as you were complaining that you could get no one to go halves with you, I thought that I had better bring you together.&rdquo;</p>
<p>Sherlock Holmes seemed delighted at the idea of sharing his rooms with me. &ldquo;I have my eye on a suite in Baker Street,&rdquo; he said, &ldquo;which would suit us down to the ground. You don't mind the smell of strong tobacco, I hope?&rdquo;</p>
<p>&ldquo;I always smoke &lsquo;ship's&rsquo; myself,&rdquo; I answered.</p>
<p>&ldquo;That's good enough. I generally have chemicals about, and occasionally do experiments. Would that annoy you?&rdquo;</p>
<p>&ldquo;By no means.&rdquo;</p>
<p>&ldquo;Let me see&mdash;what are my other shortcomings. I get in the dumps at times, and don't open my mouth for days on end. You must not think I am sulky when I do that. Just let me alone, and I'll soon be right. What have you to confess now? It's just as well for two fellows to know the worst of one another before they begin to live together.&rdquo;</p>
<p>I laughed at this cross-examination. &ldquo;I keep a bull pup,&rdquo; I said, &ldquo;and I object to rows because my nerves are shaken, and I get up at all sorts of ungodly hours, and I am extremely lazy. I have another set of vices when I'm well, but those are the principal ones at present.&rdquo;</p>
<p>&ldquo;Do you include violin-playing in your category of rows?&rdquo; he asked, anxiously.</p>
<p>&ldquo;It depends on the player,&rdquo; I answered. &ldquo;A well-played violin is a treat for the gods&mdash;a badly-played one&mdash;&rdquo;</p>
<p>&ldquo;Oh, that's all right,&rdquo; he cried, with a merry laugh. &ldquo;I think we may consider the thing as settled&mdash;that is, if the rooms are agreeable to you.&rdquo;</p>
<p>&ldquo;When shall we see them?&rdquo;</p>
<p>&ldquo;Call for me here at noon to-morrow, and we'll go together and settle everything,&rdquo; he answered.</p>
<p>&ldquo;All right&mdash;noon exactly,&rdquo; said I, shaking his hand.</p>
<p>We left him working among his chemicals, and we walked together towards my hotel.</p>
<p>&ldquo;By the way,&rdquo; I asked suddenly, stopping and turning upon Stamford, &ldquo;how the deuce did he know that I had come from Afghanistan?&rdquo;</p>
<p>My companion smiled an enigmatical smile. &ldquo;That's just his little peculiarity,&rdquo; he said. &ldquo;A good many people have wanted to know how he finds things out.&rdquo;</p>
<p>&ldquo;Oh! a mystery is it?&rdquo; I cried, rubbing my hands. &ldquo;This is very piquant. I am much obliged to you for bringing us together. &lsquo;The proper study of mankind is man,&rsquo; you know.&rdquo;</p>
<p>&ldquo;You must study him, then,&rdquo; Stamford said, as he bade me good-bye. &ldquo;You'll find him a knotty problem, though. I'll wager he learns more about you than you about him. Good-bye.&rdquo;</p>
<p>&ldquo;Good-bye,&rdquo; I answered, and strolled on to my hotel, considerably interested in my new acquaintance.</p>
</div>
<hr>
</body>
</html>
@@ -0,0 +1,197 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 005</title>
<script>
var Hyphenopoly = {
require: {
"cs": "FORCEHYPHENOPOLY",
"da": "FORCEHYPHENOPOLY",
"en-us": "FORCEHYPHENOPOLY",
"de": "FORCEHYPHENOPOLY",
"fr": "FORCEHYPHENOPOLY",
"nl": "FORCEHYPHENOPOLY",
"es": "FORCEHYPHENOPOLY",
"sv": "FORCEHYPHENOPOLY",
"it": "FORCEHYPHENOPOLY",
"fi": "FORCEHYPHENOPOLY",
"pl": "FORCEHYPHENOPOLY",
"pt": "FORCEHYPHENOPOLY",
"hu": "FORCEHYPHENOPOLY",
"tr": "FORCEHYPHENOPOLY",
"lt": "FORCEHYPHENOPOLY",
"sl": "FORCEHYPHENOPOLY",
"la": "FORCEHYPHENOPOLY",
"nb-no": "FORCEHYPHENOPOLY",
"lv": "FORCEHYPHENOPOLY",
"ca": "FORCEHYPHENOPOLY",
"sk": "FORCEHYPHENOPOLY",
"eo": "FORCEHYPHENOPOLY",
"sr-latn": "FORCEHYPHENOPOLY",
"ro": "FORCEHYPHENOPOLY",
"et": "FORCEHYPHENOPOLY",
"ga": "FORCEHYPHENOPOLY"
},
fallbacks: {
"sr-latn": "sh-latn"
},
setup: {
selectors: {
".hyphenate": {
hyphen: "|",
compound: "auto"
}
}
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
}
}
};
function assert() {
var tests = 26;
var i = 1;
var test = "";
var ref = "";
var result = true;
while (i <= tests) {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<span style=\"background-color: #d6ffd6\">" + (function (i) {
return (i < 10) ? "0" + i : i;
}(i)) + "</span> ";
result = result && true;
} else {
document.getElementById("result").innerHTML += "<span style=\"background-color: #ffd6d6\">" + (function (i) {
return (i < 10) ? "0" + i : i;
}(i)) + "</span> ";
result = false;
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 5,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test4.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test6.html">Next&nbsp;&rarr;</a></div>
<h1>Test 005</h1>
<p id="desc">Hyphenate a paragraph for each supported language in latin-script.</p>
<div id="result">R: </div>
<hr>
<h2>1: cs</h2>
<p id="test1" class="test hyphenate" lang="cs">Typografie je umělecko-technický obor, který se zabývá písmem.</p>
<p id="ref1" class="ref" lang="cs">Ty|po|gra|fie je umě|lecko-tech|nický obor, který se za|bývá pís|mem.</p>
<h2>2: da</h2>
<p id="test2" class="test hyphenate" lang="da">Bindestregen er et symbol brugt i grammatisk tegnsætning. Den bruges til at lave sammensatte ord eller adskille stavelser ved linjeskift.</p>
<p id="ref2" class="ref" lang="da">Bin|de|stre|gen er et sym|bol brugt i gram|ma|tisk tegn|sæt|ning. Den bru|ges til at lave sam|men|sat|te ord eller ad|skil|le sta|vel|ser ved linjeskift.</p>
<h2>3: en-us</h2>
<p id="test3" class="test hyphenate" lang="en-us">A hyphenation algorithm is a set of rules that decides at which points a word can be broken over two lines with a hyphen.</p>
<p id="ref3" class="ref" lang="en-us">A hy|phen|ation al|go|rithm is a set of rules that de|cides at which points a word can be bro|ken over two lines with a hy|phen.</p>
<h2>4: de</h2>
<p id="test4" class="test hyphenate" lang="de">Die Worttrennung, auch Silbentrennung genannt, bezeichnet in der Orthographie die Art und Weise, wie die Wörter insbesondere am Zeilenende getrennt werden können.</p>
<p id="ref4" class="ref" lang="de">Die Wort|tren|nung, auch Sil|ben|tren|nung ge|nannt, be|zeich|net in der Or|tho|gra|phie die Art und Weise, wie die Wör|ter ins|be|son|de|re am Zei|len|en|de ge|trennt wer|den kön|nen.</p>
<h2>5: fr</h2>
<p id="test5" class="test hyphenate" lang="fr">En typographie, la coupure de mot (parfois aussi appelée césure) est l'opération qui consiste à couper en fin de ligne un mot qui n'entrerait pas dans la justification.</p>
<p id="ref5" class="ref" lang="fr">En ty|po|gra|phie, la cou|pure de mot (par|fois aussi ap|pe|lée cé|sure) est l'opé|ra|tion qui consiste à cou|per en fin de ligne un mot qui n'en|tre|rait pas dans la jus|ti|fi|ca|tion.</p>
<h2>6: nl</h2>
<p id="test6" class="test hyphenate" lang="nl">Een lettergreep of syllabe is een prosodische eenheid in gesproken taal.</p>
<p id="ref6" class="ref" lang="nl">Een let|ter|greep of syl|la|be is een pro|so|di|sche een|heid in ge|spro|ken taal.</p>
<h2>7: es</h2>
<p id="test7" class="test hyphenate" lang="es">Las palabras en español suelen ser, en promedio, más largas que en inglés pero más cortas que en alemán. <span lang="de">«Silbentrennungsalgorithmus»</span>, por ejemplo, es una palabra bastante larga.</p>
<p id="ref7" class="ref" lang="es">Las pa|la|bras en es|pa|ñol sue|len ser, en pro|me|dio, más lar|gas que en in|glés pero más cor|tas que en ale|mán. <span lang="de">«Sil|ben|tren|nungs|al|go|rith|mus»</span>, por ejem|plo, es una pa|la|bra bas|tan|te larga.</p>
<h2>8: sv</h2>
<p id="test8" class="test hyphenate" lang="sv">En algoritm är inom matematiken och datavetenskapen begränsad uppsättning (mängd) väldefinierade instruktioner för att lösa en uppgift, som från givna utgångstillstånd (starttillstånd) med säkerhet leder till något givet sluttillstånd.</p>
<p id="ref8" class="ref" lang="sv">En al|go|ritm är inom ma|te|ma|ti|ken och data|ve|ten|ska|pen be|grän|sad upp|sätt|ning (mängd) väl|de|fi|ni|e|ra|de in|struk|tio|ner för att lösa en upp|gift, som från givna ut|gångs|till|stånd (start|till|stånd) med sä|ker|het leder till något givet slut|till|stånd.</p>
<h2>9: it</h2>
<p id="test9" class="test hyphenate" lang="it">La storia della scrittura, quel processo lungo e tortuoso, ma anche estremamente affascinante e ricco di sorprese, che parte dai primi incerti disegni sulla roccia degli uomini primitivi e giunge ai moderni word processor, ha avuto proprio negli scribi, nei copisti e negli amanuensi dei solitari, silenziosi, laboriosi e importantissimi protagonisti.</p>
<p id="ref9" class="ref" lang="it">La sto|ria della scrit|tu|ra, quel pro|ces|so lungo e tor|tuo|so, ma anche estre|ma|men|te af|fa|sci|nan|te e ricco di sor|pre|se, che parte dai primi in|cer|ti di|se|gni sulla roc|cia degli uo|mi|ni pri|mi|ti|vi e giun|ge ai mo|der|ni word pro|ces|sor, ha avuto pro|prio negli scri|bi, nei co|pi|sti e negli ama|nuen|si dei so|li|ta|ri, si|len|zio|si, la|bo|rio|si e im|por|tan|tis|si|mi pro|ta|go|ni|sti.</p>
<h2>10: fi</h2>
<p id="test10" class="test hyphenate" lang="fi">Typografia tarkoittaa nykyisin mitä tahansa tekstiin, tekstityyppiin, kirjainten asetteluun, väritykseen ja muuhun liittyvää suunnittelua.</p>
<p id="ref10" class="ref" lang="fi">Ty|po|gra|fia tar|koit|taa ny|kyi|sin mitä ta|han|sa teks|tiin, teks|ti|tyyp|piin, kir|jain|ten aset|te|luun, vä|ri|tyk|seen ja muu|hun liit|ty|vää suun|nit|te|lua.</p>
<h2>11: pl</h2>
<p id="test11" class="test hyphenate" lang="pl">Typografia - termin mający szereg pokrewnych znaczeń związanych z użyciem znaków pisarskich w druku, prezentacją ich na ekranie monitora komputerowego itp.</p>
<p id="ref11" class="ref" lang="pl">Ty|po|gra|fia - ter|min ma|ją|cy sze|reg po|krew|nych zna|czeń zwią|za|nych z uży|ciem zna|ków pi|sar|skich w druku, pre|zen|ta|cją ich na ekra|nie mo|ni|to|ra kom|pu|te|ro|we|go itp.</p>
<h2>12: pt</h2>
<p id="test12" class="test hyphenate" lang="pt">A tipografia é a arte e o processo de criação na composição de um texto, física ou digitalmente.</p>
<p id="ref12" class="ref" lang="pt">A ti|po|gra|fia é a arte e o pro|cesso de cri|a|ção na com|po|si|ção de um texto, fí|sica ou di|gi|tal|mente.</p>
<h2>13: hu</h2>
<p id="test13" class="test hyphenate" lang="hu">A weboldal nyelvét nem sikerült automatikusan megállapítani. Kérem adja meg a nyelvet.</p>
<p id="ref13" class="ref" lang="hu">A web|ol|dal nyel|vét nem si|ke|rült au|to|ma|ti|ku|san meg|ál|la|pí|ta|ni. Kérem adja meg a nyel|vet.</p>
<h2>14: tr</h2>
<p id="test14" class="test hyphenate" lang="tr">Tipografi sözcüklerinden türemiş olan typographia sözcüğünün Türkçe halidir.</p>
<p id="ref14" class="ref" lang="tr">Ti|pog|ra|fi söz|cük|le|rin|den tü|re|miş olan ty|pog|rap|hia söz|cü|ğü|nün Türk|çe ha|li|dir.</p>
<h2>15: lt</h2>
<p id="test15" class="test hyphenate" lang="lt">Lietuvių kalba yra labiausiai vartojama iš rytų baltų kalbų.</p>
<p id="ref15" class="ref" lang="lt">Lie|tu|vių kalba yra la|biau|siai var|to|ja|ma iš rytų baltų kalbų.</p>
<h2>16: sl</h2>
<p id="test16" class="test hyphenate" lang="sl">Tipografija je veda o tipografskem oblikovanju. Preučuje izdelavo črk in pisav ter njihovo uporabo v besedilu.</p>
<p id="ref16" class="ref" lang="sl">Ti|po|gra|fi|ja je veda o ti|po|graf|skem obli|ko|va|nju. Pre|u|ču|je iz|de|la|vo črk in pisav ter nji|ho|vo upo|ra|bo v be|se|di|lu.</p>
<h2>17: la</h2>
<p id="test17" class="test hyphenate" lang="la">Typographia disciplina transcribendarum litterarum est, quae propositum formam scripturae usu formae litterarum ac gentis litterarum assequi temptat, ut litterae eius simul elegantes et accomodatae sint.</p>
<p id="ref17" class="ref" lang="la">Ty|po|gra|phia dis|ci|pli|na tran|scri|ben|da|rum lit|te|ra|rum est, quae pro|po|si|tum for|mam scrip|tu|rae usu for|mae lit|te|ra|rum ac gen|tis lit|te|ra|rum as|se|qui temp|tat, ut lit|te|rae eius simul ele|gan|tes et ac|co|mo|da|tae sint.</p>
<h2>18: no</h2>
<p id="test18" class="test hyphenate" lang="nb-no">Typografi er utforming og behandling av skrift, bokstaver og andre grafiske elementer i trykkerfaget og i grafisk design.</p>
<p id="ref18" class="ref" lang="nb-no">Ty|po|gra|fi er ut|for|ming og be|hand|ling av skrift, bok|sta|ver og andre gra|fis|ke ele|men|ter i tryk|ker|fa|get og i gra|fisk de|sign.</p>
<h2>19: lv</h2>
<p id="test19" class="test hyphenate" lang="lv">Šīs lapas valodu nevarēja noteikt automātiski. Lūdzu norādiet pamata valodu:</p>
<p id="ref19" class="ref" lang="no">Šīs lapas va|lo|du ne|va|rē|ja no|teikt au|to|mā|tis|ki. Lūdzu no|rā|diet pa|ma|ta va|lo|du:</p>
<h2>20: ca</h2>
<p id="test20" class="test hyphenate" lang="ca">Una manera especial de provar la partició de paraules en català a la web.</p>
<p id="ref20" class="ref" lang="ca">Una ma|ne|ra es|pe|ci|al de pro|var la par|ti|ció de pa|rau|les en ca|ta|là a la web.</p>
<h2>21: sk</h2>
<p id="test21" class="test hyphenate" lang="sk">Typografia sa zaoberá problematikou grafickej úpravy tlačených dokumentov s použitím vhodných rezov písma a usporiadania jednotlivých znakov a odsekov vo vhodnej, pre čitateľa zrozumiteľnej a esteticky akceptovateľnej forme. Zaoberá sa tiež dizajnom písma, výberom farebnej schémy dokumentov, ilustrácií, zalamovaním textu do odsekov až po výber papiera pre tlač.</p>
<p id="ref21" class="ref" lang="sk">Ty|po|gra|fia sa za|oberá prob|le|ma|ti|kou gra|fic|kej úp|ravy tla|če|ných do|ku|men|tov s po|u|ži|tím vhod|ných rezov písma a uspo|ria|da|nia jed|not|li|vých zna|kov a od|se|kov vo vhod|nej, pre či|ta|teľa zro|zu|mi|teľ|nej a es|te|ticky ak|cep|to|va|teľ|nej forme. Za|oberá sa tiež di|zaj|nom písma, vý|be|rom fa|reb|nej schémy do|ku|men|tov, ilus|trá|cií, za|la|mo|va|ním textu do od|se|kov až po výber pa|piera pre tlač.</p>
<h2>22: eo</h2>
<p id="test22" class="test hyphenate" lang="eo">Tipografio unuavice estas la kreo de komunikaĵo per reproduktebla skribo, sed duavice ankaŭ la dezajno de tia skriba komunikaĵo per linioj, areoj kaj la specifa aranĝo de literoj.</p>
<p id="ref22" class="ref" lang="eo">Ti|po|gra|fio unu|a|vi|ce estas la kreo de ko|mu|ni|k|aĵo per re|pro|duk|t|ebla skri|bo, sed du|a|vi|ce ankaŭ la de|zaj|no de tia skri|ba ko|mu|ni|k|aĵo per li|ni|oj, areoj kaj la spe|ci|fa aran|ĝo de li|te|roj.</p>
<h2>23: sr-latn</h2>
<p id="test23" class="test hyphenate" lang="sr-latn">Tipografija se bavi izborom i organizacijom oblika slova i drugih grafičkih karakteristika štampane strane.</p>
<p id="ref23" class="ref" lang="sr-Latn">Ti|po|gra|fi|ja se bavi iz|bo|rom i or|ga|ni|za|ci|jom obli|ka slova i dru|gih gra|fič|kih ka|rak|te|ri|sti|ka štam|pa|ne stra|ne.</p>
<h2>24: ro</h2>
<p id="test24" class="test hyphenate" lang="ro">Tipografia reprezintă arta și tehnica tipăritului, a formei și aranjării literelor pe un document scris.</p>
<p id="ref24" class="ref" lang="ro">Ti|po|gra|fia re|pre|zin|tă arta și teh|ni|ca ti|pă|ri|tu|lui, a for|mei și aran|jă|rii li|te|re|lor pe un do|cu|ment scris.</p>
<h2>25: et</h2>
<p id="test25" class="test hyphenate" lang="et">Tüpograafia ehk trükikunst on trükiste valmistamise oskus, täpsemini sõnastatult trükimärkide kujundamise ja paigutamise kunst ja tehnika.</p>
<p id="ref25" class="ref" lang="et">Tü|pog|raa|fia ehk trü|ki|kunst on trükiste val|mis|ta|mise oskus, täp|se|mini sõ|nas|ta|tult trü|ki|mär|kide ku|jun|da|mise ja pai|gu|ta|mise kunst ja teh|nika.</p>
<h2>26: ga</h2>
<p id="test26" class="test hyphenate" lang="ga">Dearadh foirmeacha na litreacha le húsáid mar chló-aghaidheanna, agus roghnú na gcló-aghaidheanna i gcomhair cáipéisí clóchurtha.</p>
<p id="ref26" class="ref" lang="ga">Dear|adh foirm|eacha na lit|reacha le húsáid mar chló-aghaidh|eanna, agus roghnú na gcló-aghaidh|eanna i gcomh|air cáip|éisí cló|chur|tha.</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,105 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 006</title>
<script>
var Hyphenopoly = {
require: {
"hy": "FORCEHYPHENOPOLY",
"be": "FORCEHYPHENOPOLY",
"ru": "FORCEHYPHENOPOLY",
"sr-cyrl": "FORCEHYPHENOPOLY",
"uk": "FORCEHYPHENOPOLY",
"ka": "FORCEHYPHENOPOLY"
},
setup: {
selectors: {
".hyphenate": {
hyphen: "|",
minWordLength: 4
}
}
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
}
}
};
function assert() {
var tests = 6;
var i = 1;
var test = "";
var ref = "";
var result = true;
while (i <= tests) {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<span style=\"background-color: #d6ffd6\">" + (function (i) {
return (i < 10) ? "0" + i : i;
}(i)) + "</span> ";
result = result && true;
} else {
document.getElementById("result").innerHTML += "<span style=\"background-color: #ffd6d6\">" + i + "</span> ";
result = false;
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 6,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test5.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test7.html">Next&nbsp;&rarr;</a></div>
<h1>Test 006</h1>
<p id="desc">Hyphenate a paragraph for each supported language in non-latin script.</p>
<div id="result"></div>
<hr>
<h2>1: hy</h2>
<p id="test1" class="test hyphenate" lang="hy">Հայերենն ունի վեց ձայնավոր, մեկ կիսաձայն և երեսուն բաղաձայն հնչյուններ</p>
<p id="ref1" class="ref" lang="hy">Հա|յե|րենն ունի վեց ձայնա|վոր, մեկ կի|սա|ձայն և ե|րե|սուն բա|ղա|ձայն հնչյուններ</p>
<h2>2: be</h2>
<p id="test2" class="test hyphenate" lang="be">БЕЛАРУ́СКАЯ МО́ВА, мова беларусаў, уваходзіць у сям’ю індаеўрапейскіх моў, яе славянскай групы і ўсходнеславянскіх моваў падгрупы, на якой размаўляюць у Беларусі і па ўсім свеце, галоўным чынам у Расіі, Украіне, Польшчы.</p>
<p id="ref2" class="ref" lang="be">БЕ|ЛА|РУ́СКАЯ МО́ВА, мо|ва бе|ла|ру|саў, ува|хо|дзіць у сям’ю ін|да|еў|ра|пей|с|кіх моў, яе сла|вя|н|с|кай гру|пы і ўс|хо|д|не|с|ла|вя|н|с|кіх мо|ваў пад|гру|пы, на якой раз|маў|ля|юць у Бе|ла|ру|сі і па ўсім све|це, га|лоў|ным чы|нам у Ра|сіі, Ук|ра|і|не, Поль|ш|чы.</p>
<h2>3: ru</h2>
<p id="test3" class="test hyphenate" lang="ru">Типогра́фика — графическое оформление печатного текста посредством набора и вёрстки с использованием норм и правил, специфических для данного языка.</p>
<p id="ref3" class="ref" lang="ru">Ти|по|гра́фи|ка — гра|фи|че|ское оформ|ле|ние пе|чат|но|го тек|ста по|сред|ством на|бо|ра и вёрст|ки с ис|поль|зо|ва|ни|ем норм и пра|вил, спе|ци|фи|че|ских для дан|но|го язы|ка.</p>
<h2>4: sr-cyrl</h2>
<p id="test4" class="test hyphenate" lang="sr-cyrl">Штампарија се примарно бави израдом штампаних пословних образаца који имају разноврсну примену. Наше пословне обрасце користи велики број задовољних клијената из разних делатности. Такође, се бавимо и дигиталном штампом.</p>
<p id="ref4" class="ref" lang="sr-cyrl">Шта|мпа|ри|ја се при|мар|но ба|ви из|ра|дом шта|мпа|них по|слов|них обра|за|ца ко|ји има|ју раз|но|вр|сну при|ме|ну. На|ше по|слов|не об|ра|сце ко|ри|сти ве|ли|ки број за|до|вољ|них кли|је|на|та из раз|них де|лат|но|сти. Та|ко|ђе, се ба|ви|мо и ди|ги|та|лном шта|мпом.</p>
<h2>5: uk</h2>
<p id="test5" class="test hyphenate" lang="uk">Українська мова належить до індоєвропейської мовної родини, слов'янської групи і разом з російською та білоруською до східнослов'янської підгрупи.</p>
<p id="ref5" class="ref" lang="uk">Укра|їн|ська мо|ва на|ле|жить до ін|до|єв|ро|пей|ської мов|ної ро|ди|ни, слов'|ян|ської гру|пи і ра|зом з ро|сій|ською та бі|ло|ру|ською до схі|дно|слов'|ян|ської під|гру|пи.</p>
<h2>6: ka</h2>
<p id="test6" class="test hyphenate" lang="ka">შეგროვება გრაფიკული დიზაინერი, ხატები, ფონტები და დიდაქტიკური და გრამატიკა წიგნების ნივთები</p>
<p id="ref6" class="ref" lang="ka">შეგ|რო|ვე|ბა გ|რა|ფი|კუ|ლი დი|ზა|ი|ნე|რი, ხა|ტე|ბი, ფონ|ტე|ბი და დი|დაქ|ტი|კუ|რი და გ|რა|მა|ტი|კა წიგ|ნე|ბის ნივ|თე|ბი</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,102 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 007</title>
<script>
var Hyphenopoly = {
require: {
"en-us": "FORCEHYPHENOPOLY"
},
setup: {
selectors: {
".class1": {
compound: "all"
},
".class2": {
compound: "auto"
},
".class3": {
compound: "hyphen"
}
}
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
}
}
};
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<script>
function assert() {
var tests = 3;
var i = 1;
var test = "";
var ref = "";
var result = false;
while (i <= tests) {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<span style=\"background-color: #d6ffd6\">" + (function (i) {
return (i < 10) ? "0" + i : i;
}(i)) + "</span> ";
result = result || true;
} else {
document.getElementById("result").innerHTML += "<span style=\"background-color: #ffd6d6\">" + i + "</span> ";
result = result || false;
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 7,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
width: 2em;
margin: 0.5em;
border: 1px solid blue;
}
.ref {
background-color: #FEEFC0;
width: 2em;
margin: 0.5em;
border: 1px solid yellow;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test6.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test8.html">Next&nbsp;&rarr;</a></div>
<h1>Test 007</h1>
<p id="desc">Hyphenate compound words differently.</p>
<div id="result"></div>
<hr>
<h2>1: compound: all</h2>
<p id="test1" class="test class1" lang="en-us">hyphenation-two</p>
<p id="ref1" class="ref" lang="en-us">hy&shy;phen&shy;ation-&#8203;two</p>
<h2>2: compound: auto</h2>
<p id="test2" class="test class2" lang="en-us">hyphenation-two</p>
<p id="ref2" class="ref" lang="en-us">hy&shy;phen&shy;ation-two</p>
<h2>3: compound: hyphen</h2>
<p id="test3" class="test class3" lang="en-us">hyphenation-two</p>
<p id="ref3" class="ref" lang="en-us">hyphenation-&#8203;two</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,117 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 008</title>
<script>
var Hyphenopoly = {
require: {
"en-us": "FORCEHYPHENOPOLY"
},
setup: {
selectors: {
".class1": {
hyphen: "·",
minWordLength: 10,
leftmin: 3
},
".class2": {
hyphen: "|",
compound: "auto"
},
".class3": {
hyphen: "¬",
rightmin: 6
},
".class4": {
hyphen: "•"
}
}
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
}
}
};
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<script>
function assert() {
var tests = 4;
var i = 1;
var test = "";
var ref = "";
var result = true;
while (i <= tests) {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed</p>";
result = result && true;
} else {
document.getElementById("result").innerHTML += "<p style=\"background-color: #ffd6d6\">" + i + " failed</p>";
result = false;
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 8,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
if (!Hyphenopoly) {
document.addEventListener("DOMContentLoaded", function() {
assert();
});
}
</script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
.hyphenate {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test7.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test9.html">Next&nbsp;&rarr;</a></div>
<h1>Test 008</h1>
<p id="desc">Class-based settings.</p>
<div id="result"></div>
<hr>
<h2>1: class1</h2>
<p id="test1" class="test class1" lang="en-us">hyphenation algorithm</p>
<p id="ref1" class="ref" lang="en-us">hyphen·ation algorithm</p>
<h2>2: class2</h2>
<p id="test2" class="test class2" lang="en-us">hyphenation algorithm</p>
<p id="ref2" class="ref" lang="en-us">hy|phen|ation al|go|rithm</p>
<h2>3: class3</h2>
<p id="test3" class="test class3" lang="en-us">hyphenation algorithm</p>
<p id="ref3" class="ref" lang="en-us">hy¬phenation al¬gorithm</p>
<h2>4: class4 (subelement)</h2>
<p id="test4" class="test class3" lang="en-us">superclass <span class="class4">subclass</span></p>
<p id="ref4" class="ref" lang="en-us">su¬perclass <span class="class4">sub•class</span></p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,118 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 009</title>
<script>
var Hyphenopoly = {
require: {
"en-us": "FORCEHYPHENOPOLY"
},
setup: {
selectors: {
".class1": {
hyphen: "·"
},
".class2": {
hyphen: "|",
compound: "auto"
}
}
},
handleEvent: {
beforeElementHyphenation: function (e) {
if (e.el.className.indexOf("class1") !== -1) {
e.el.style.opacity = "0";
}
},
afterElementHyphenation: function (e) {
if (e.el.className.indexOf("class1") !== -1) {
window.setTimeout(function () {
e.el.style.opacity = "1";
e.el.style.transition = "opacity 1000ms ease";
}, 0);
}
},
hyphenopolyEnd: function (e) {
assert();
}
}
};
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<script>
function assert() {
var tests = 2;
var i = 1;
var test = "";
var ref = "";
var result = true;
while (i <= tests) {
test = document.getElementById("test" + i).innerHTML;
ref = document.getElementById("ref" + i).innerHTML;
if (test === ref) {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed</p>";
result = result && true;
} else {
document.getElementById("result").innerHTML += "<p style=\"background-color: #ffd6d6\">" + i + " failed</p>";
result = false;
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 9,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
if (!Hyphenopoly) {
document.addEventListener("DOMContentLoaded", function() {
assert();
});
}
</script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
#result {
height: 100px;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
.hyphenate {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test8.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test10.html">Next&nbsp;&rarr;</a></div>
<h1>Test 009</h1>
<p id="desc">Ease</p>
<div id="result"></div>
<hr>
<h2>1: class1</h2>
<p id="test1" class="test class1" lang="en-us">hyphenation algorithm</p>
<p id="ref1" class="ref" lang="en-us">hy·phen·ation al·go·rithm</p>
<h2>2: class2</h2>
<p id="test2" class="test class2" lang="en-us">hyphenation algorithm</p>
<p id="ref2" class="ref" lang="en-us">hy|phen|ation al|go|rithm</p>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>
@@ -0,0 +1,99 @@
/* eslint-disable object-property-newline */
/* eslint-disable no-var */
(function testDriver() {
"use strict";
var tests = [
{"exec": false, "path": "test0.html"},
{"exec": true, "path": "test1.html"},
{"exec": true, "path": "test2.html"},
{"exec": true, "path": "test3.html"},
{"exec": true, "path": "test4.html"},
{"exec": true, "path": "test5.html"},
{"exec": true, "path": "test6.html"},
{"exec": true, "path": "test7.html"},
{"exec": true, "path": "test8.html"},
{"exec": true, "path": "test9.html"},
{"exec": true, "path": "test10.html"},
{"exec": true, "path": "test11.html"},
{"exec": true, "path": "test12.html"},
{"exec": true, "path": "test13.html"},
{"exec": true, "path": "test14.html"},
{"exec": true, "path": "test15.html"},
{"exec": true, "path": "test16.html"},
{"exec": true, "path": "test17.html"},
{"exec": true, "path": "test18.html"},
{"exec": true, "path": "test19.html"},
{"exec": true, "path": "test20.html"},
{"exec": true, "path": "test21.html"},
{"exec": true, "path": "test22.html"},
{"exec": true, "path": "test23.html"},
{"exec": true, "path": "test24.html"},
{"exec": true, "path": "test25.html"},
{"exec": true, "path": "test26.html"},
{"exec": true, "path": "test27.html"},
{"exec": true, "path": "test28.html"},
{"exec": true, "path": "test29.html"},
{"exec": true, "path": "test30.html"},
{"exec": true, "path": "test31.html"},
{"exec": true, "path": "test32.html"},
{"exec": true, "path": "test33.html"},
{"exec": true, "path": "test34.html"},
{"exec": true, "path": "test35.html"},
{"exec": true, "path": "test36.html"},
{"exec": true, "path": "test37.html"},
{"exec": true, "path": "test38.html"}
];
var testframe = document.getElementById("testframe");
var currentTest = 1;
var total = "passed";
/**
* Add test result to the DOM
* @param {string} name – Filename
* @param {string} desc - Test description
* @param {string} result - Result (failed or passed)
*/
function addTestResult(name, desc, result) {
var dl = document.getElementById("testresults");
var template = document.getElementById("template").innerHTML;
template = template.replace(/@file@/g, name);
template = template.replace(/@desc@/, desc);
template = template.replace(/@result@/g, result);
dl.innerHTML += template;
window.scrollBy(0, 20);
}
/**
* Runs tests
* @param {number} index - Index of the test
*/
function run(index) {
/* eslint-disable security/detect-object-injection */
if (tests[index]) {
currentTest = index;
if (tests[index].exec) {
window.setTimeout(function defer() {
testframe.src = tests[index].path;
}, 0);
} else {
addTestResult(tests[index].path, "omitted", "omitted");
run(index + 1);
}
} else {
addTestResult("", navigator.userAgent, total);
}
/* eslint-enable security/detect-object-injection */
}
window.addEventListener("message", function onMessage(e) {
var msg = JSON.parse(e.data);
addTestResult(tests[msg.index].path, msg.desc, msg.result);
if (msg.result === "failed") {
total = "failed";
}
run(msg.index + 1);
}, false);
run(currentTest);
}());