aboutsummaryrefslogtreecommitdiff
path: root/dictionary.go
diff options
context:
space:
mode:
Diffstat (limited to 'dictionary.go')
-rw-r--r--dictionary.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/dictionary.go b/dictionary.go
index 611dd7f..e58151f 100644
--- a/dictionary.go
+++ b/dictionary.go
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: 2020 M. Shulhan <ms@kilabit.info>
// SPDX-License-Identifier: GPL-3.0-or-later
-package kamusd
+package kamusku
import (
"bytes"
@@ -11,7 +11,7 @@ import (
"os"
"sync"
- "git.sr.ht/~shulhan/kamusku"
+ "git.sr.ht/~shulhan/kbbi"
libos "git.sr.ht/~shulhan/pakakeh.go/lib/os"
)
@@ -22,7 +22,7 @@ const (
// dictionary contains cache of words and its definitions.
type dictionary struct {
sync.Mutex
- cache map[string]*kamusku.Word
+ cache map[string]*kbbi.Word
lastSize int
storagePath string
}
@@ -34,7 +34,7 @@ func newDictionary(storagePath string) (dict *dictionary, err error) {
}
dict = &dictionary{
- cache: make(map[string]*kamusku.Word),
+ cache: make(map[string]*kbbi.Word),
storagePath: storagePath,
}
@@ -47,7 +47,7 @@ func newDictionary(storagePath string) (dict *dictionary, err error) {
}
// lookup the definition of word from cache or nil if not exist.
-func (dict *dictionary) lookup(word string) (kata *kamusku.Word) {
+func (dict *dictionary) lookup(word string) (kata *kbbi.Word) {
dict.Lock()
kata = dict.cache[word]
dict.Unlock()
@@ -104,7 +104,7 @@ func (dict *dictionary) load() (err error) {
}
// set save the definition of word into cache.
-func (dict *dictionary) set(word string, kata *kamusku.Word) {
+func (dict *dictionary) set(word string, kata *kbbi.Word) {
if len(word) == 0 || kata == nil {
return
}