wordpos/samples/self-hosted/index.html

53 lines
1.3 KiB
HTML
Raw Normal View History

2018-10-13 03:35:11 +00:00
<!doctype html>
<html>
<head>
2019-02-19 00:50:51 +00:00
<meta http-equiv="Content-Security-Policy" content="script-src https: http: 'unsafe-inline' 'unsafe-eval'">
<title>Wordpos in the browser</title>
2018-10-15 05:20:56 +00:00
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css" />
2018-10-21 02:26:45 +00:00
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/javascript.min.js"></script>
2018-10-13 03:35:11 +00:00
2019-05-24 21:18:55 +00:00
<script src="/dist/wordpos.min.js"></script>
<script>
let wordpos = window.wordpos = new WordPOS({
// preload: true,
dictPath: '/samples/self-hosted/dict',
profile: true,
// stopwords: false
});
</script>
<script src="../main.js" name="main"></script>
2018-10-15 05:20:56 +00:00
<style>
pre {
padding: 2em;
display: block;
2018-10-13 03:35:11 +00:00
}
2018-10-15 05:20:56 +00:00
</style>
2018-10-13 03:35:11 +00:00
</head>
<body>
<h1>Self-hosted WordPOS sample</h1>
2018-10-15 05:20:56 +00:00
Open console to see results.
2018-10-15 05:21:50 +00:00
<pre><code> </code></pre>
2018-10-15 05:20:56 +00:00
<script>
var el = document.querySelector('code');
if (fetch) {
2019-05-24 21:18:55 +00:00
fetch('../main.js')
2018-10-15 05:20:56 +00:00
.then(res => res.text())
.then(txt => {
el.innerText = txt;
2019-02-19 00:50:51 +00:00
window.hljs && hljs.initHighlightingOnLoad();
2018-10-15 05:20:56 +00:00
});
} else {
2019-05-24 21:18:55 +00:00
el.innerHTML = 'Open <a href="../main.js">main.js</a>.';
2018-10-15 05:20:56 +00:00
}
</script>
2018-10-13 03:35:11 +00:00
</body>
</html>