-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
76 lines (70 loc) · 3.35 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="./src/index.scss">
<link rel="shortcut icon" href="./favicon.png">
<title>Typeahead Spellchecker with Typesense</title>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-116415641-7"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-116415641-7');
</script>
</head>
<body>
<div class="container p-5">
<div class="row">
<div class="col-sm">
<h1>Typeahead Spellchecker</h1>
<p class="lead">Powered by <a href="https://typesense.org" target="_blank" class="text-secondary">Typesense
Search</a></p>
<p>
<a href="#" class="text-dark" aria-roledescription="button" data-toggle="modal" data-target="#aboutModal">
<span class="small">How it works</span>
</a>
</p>
<textarea id="textbox" class="form-control p-2 mt-4" placeholder="Try typing something..."></textarea>
<ul id="suggestions-list" class="mt-2 list-group list-group-horizontal"></ul>
</div>
</div>
</div>
<!-- About Modal -->
<div id="aboutModal" class="modal fade" tabindex="-1" aria-labelledby="aboutLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title font-weight-normal" id="aboutLabel">
How it works
</h5>
<button type="button" class="close btn btn-primary" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p>
This showcase uses <a href="https://typesense.org/" target="_blank">Typesense's</a> typo-correction feature to build a Type-Ahead Spellchecker.
</p>
<p>
We index 333K <a href="https://www.kaggle.com/rtatman/english-word-frequency" target="_blank">dictionary words</a>, along with the popularity of each word in a Typesense collection.
We then extract the last typed word and send it as a "search" to Typesense. Since Typesense searches for typo-corrected words automatically, it returns closely related typo-corrected words from the dictionary, which we show as type-ahead suggestions.
</p>
<p>
The search backend is powered by a single-node 512MB RAM <a href="https://cloud.typesense.org" target="_blank">Typesense Cloud</a> cluster in Oregon.
</p>
<p>
View source here <a href="https://github.com/typesense/showcase-spellcheck" target="_blank">here</a>.
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<script type="module" src="./src/index.js"></script>
</body>
</html>