-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
62 lines (57 loc) · 2.93 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
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Anagrams</title>
<link rel="stylesheet" type="text/css" href="https://raw.githubusercontent.com/viebel/klipse/master/docs/css/main.css">
<link rel="stylesheet" type="text/css" href="docs/styles.css">
</head>
<body>
<div class="app">
<div class="content">
<h1>Anagrams Live Demo</h1>
<p>First, you need to require anagrams into your namespace</p>
<div class="klipse code-block" data-external-libs="https://raw.githubusercontent.com/diminishedprime/anagrams/master/src/,
https://raw.githubusercontent.com/diminishedprime/english-words/master/src/,">
(ns your-namespace
(:require [anagrams.core :as anagrams]
[english-words.core :as words]))
</div>
<p>You should then set the world list that should be used to find anagrams. If you're on a nix machine, I would recommend pulling in the /usr/share/dict/words file</p>
<text-area class="klipse code-block">
(anagrams/set-word-list! words/words)
</text-area>
<p>To find anagrams, call <code>anagrams/anagrams-of</code> with a string. Try changing stop, to triangle, this is a live demo! Thanks <a href="https://github.com/viebel/klipse">KLIPSE!</a></p>
<div class="klipse code-block">
(anagrams/anagrams-of "stop")
</div>
<p>To append words to the dictionary, use <code>anagrams/append-word-list!</code> with a newline separated list of new words</p>
<div class="klipse code-block">
(anagrams/append-word-list! "The Best Things in Life are Free")
</div>
<p>The library is happy to find anagrams of sentences as well</p>
<div class="klipse code-block">
(anagrams/anagrams-of "Nail-biting refreshes the feet")
</div>
<p>If no anagrams can be found, <code>anagrams/anagrams-of</code> will return an empty set.</p>
<div class="klipse code-block">
(anagrams/anagrams-of "No Anagrams of me :(")
</div>
</div>
</div>
<link rel="stylesheet" type="text/css" href="docs/styles.css">
<script>
window.klipse_settings = {
selector: '.klipse',
codemirror_options_in: {
indentUnit: 3,
lineWrapping: true,
autoCloseBrackets: true
},
codemirror_options_out: {
lineWrapping: true
}
};
</script>
<script src="https://storage.googleapis.com/app.klipse.tech/plugin/js/klipse_plugin.js"></script>
</body>