-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqueries.js
35 lines (29 loc) · 822 Bytes
/
queries.js
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
export default {
datamuse: function ({ words, max } = {}) {
this.api_name = 'datamuse'
this.endpoint = 'https://api.datamuse.com/words?'
this.query = q => `${this.endpoint}${q}=${words}&max=${max}`
return {
queries: [
{
type: `${this.api_name}__ml`,
name: 'Similar meaning',
description: 'Words with similar meaning',
query: this.query('ml'),
},
{
type: `${this.api_name}__rel_rhy`,
name: 'Rhyming',
description: 'Words that rhyme',
query: this.query('rel_rhy'),
},
{
type: `${this.api_name}__topics`,
name: 'Topics',
description: 'Words with describing similar topics',
query: this.query('topics'),
},
]
}
},
}