-
Notifications
You must be signed in to change notification settings - Fork 4
/
wordlists.go
46 lines (42 loc) · 1.26 KB
/
wordlists.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
40
41
42
43
44
45
46
package mnemonic
import (
"github.com/dongri/go-mnemonic/wordlists"
)
// Language ...
type Language string
// Language const
const (
LanguageEnglish Language = "english"
LanguageFrench Language = "french"
LanguageItalian Language = "italian"
LanguageJapanese Language = "japanese"
LanguageKorean Language = "korean"
LanguageSpanish Language = "spanish"
LanguageChineseSimplified Language = "chinese_simplified"
LanguageChineseTraditional Language = "chinese_traditional"
)
// GetWordList ...
func GetWordList(language Language) ([]string, error) {
var wordlist = []string{}
switch language {
case LanguageEnglish:
wordlist = wordlists.WordlistEnglish
case LanguageFrench:
wordlist = wordlists.WordlistFrench
case LanguageItalian:
wordlist = wordlists.WordlistItalian
case LanguageJapanese:
wordlist = wordlists.WordlistJapanese
case LanguageKorean:
wordlist = wordlists.WordlistKorean
case LanguageSpanish:
wordlist = wordlists.WordlistSpanish
case LanguageChineseSimplified:
wordlist = wordlists.WordlistChineseSimplified
case LanguageChineseTraditional:
wordlist = wordlists.WordlistChineseTraditional
default:
wordlist = wordlists.WordlistEnglish
}
return wordlist, nil
}