aboutsummaryrefslogtreecommitdiff
path: root/internal/analyze/resources.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/analyze/resources.go')
-rw-r--r--internal/analyze/resources.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/internal/analyze/resources.go b/internal/analyze/resources.go
new file mode 100644
index 0000000..f42c757
--- /dev/null
+++ b/internal/analyze/resources.go
@@ -0,0 +1,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
+}