blob: f42c7572f23a968fc9117ce20546ed2a7c9d0308 (
plain) (
blame)
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
|
package analyze
import (
"fmt"
"github.com/Fuwn/kivia/internal/nlp"
)
type resources struct {
dictionary *nlp.Dictionary
}
func getResources() (resources, error) {
return loadResources()
}
func loadResources() (resources, error) {
dictionary, err := nlp.NewDictionary()
if err != nil {
return resources{}, fmt.Errorf("Failed to load dictionary: %w", err)
}
return resources{
dictionary: dictionary,
}, nil
}
|