-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
136 lines (131 loc) · 3.94 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<!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-bs-toggle="modal"
data-bs-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 fw-normal" id="aboutLabel">How it works</h5>
<button
type="button"
class="btn-close"
data-bs-dismiss="modal"
aria-label="Close"
></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-bs-dismiss="modal"
>
Close
</button>
</div>
</div>
</div>
</div>
<script type="module" src="./src/index.js"></script>
</body>
</html>