aboutsummaryrefslogtreecommitdiff
path: root/word.go
diff options
context:
space:
mode:
Diffstat (limited to 'word.go')
-rw-r--r--word.go10
1 files changed, 1 insertions, 9 deletions
diff --git a/word.go b/word.go
index 8bc0da0..89dc837 100644
--- a/word.go
+++ b/word.go
@@ -7,12 +7,10 @@ package kamusku
import (
"bytes"
- "github.com/shuLhan/share/lib/net/html"
+ "git.sr.ht/~shulhan/pakakeh.go/lib/html"
)
-//
// Word store the single root word and its definitions.
-//
type Word struct {
Root string `json:"dasar,omitempty"` // The root word
Definition []*WordDefinition `json:"definisi"` // The word definition.
@@ -24,17 +22,13 @@ type Word struct {
err error
}
-//
// Err return an error from retrieving definition.
-//
func (word *Word) Err() error {
return word.err
}
-//
// parseHTMLEntri parse HTML body from "/entri/<word>" page to find the
// definition of the word.
-//
func (word *Word) parseHTMLEntri(in string, htmlBody []byte) (err error) {
iter, err := html.Parse(bytes.NewReader(htmlBody))
if err != nil {
@@ -73,10 +67,8 @@ func (word *Word) parseHTMLEntri(in string, htmlBody []byte) (err error) {
return nil
}
-//
// parseRootWord given an HMTL element "h2" find a possible root word and
// return true; otherwise it will return false.
-//
func (word *Word) parseRootWord(h2 *html.Node) bool {
el := h2.GetFirstChild()
if el.Data != tagNameSpan {