-
Notifications
You must be signed in to change notification settings - Fork 26
/
constants.go
39 lines (34 loc) 路 1.07 KB
/
constants.go
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
package shared
import (
"github.com/algolia/algoliasearch-client-go/v3/algolia/search"
)
// EntryType represents the type of an entry in a dictionary.
// It can be either a custom entry or a standard entry.
type EntryType string
type DictionaryType int
// DictionaryEntry can be plural, compound or stopword entry.
type DictionaryEntry struct {
Type EntryType
Word string `json:"word,omitempty"`
Words []string `json:"words,omitempty"`
Decomposition []string `json:"decomposition,omitempty"`
ObjectID string
Language string
State string
}
const (
// CustomEntryType is the type of a custom entry in a dictionary (i.e. added by the user).
CustomEntryType EntryType = "custom"
// StandardEntryType is the type of a standard entry in a dictionary (i.e. added by Algolia).
StandardEntryType EntryType = "standard"
)
var (
// DictionaryNames returns the list of available dictionaries.
DictionaryNames = func() []string {
return []string{
string(search.Stopwords),
string(search.Compounds),
string(search.Plurals),
}
}
)