parser

package
v1.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SCORE_TAG        = "maodou"
	COMPUTE_FUNC     = []func(*html.Node){score_f, res_f}
	INCLUDE_ID_CLASS = []string{"content"}                                    //className或id包含content…加分
	EXCLUDE_ID_CLASS = []string{"header", "foot", "sidebar", "about", "logo"} // className或id为header|foot|sidebar…减分
	SET_PUNCTUATION  = []string{",", ".", ",", "。"}
)

Functions

func Attr

func Attr(n *html.Node, attrName string) string

func Content

func Content(r io.Reader, is_optimizatioin bool) string

func ContentFromNode

func ContentFromNode(doc *html.Node, is_optimizatioin bool) string

func Html

func Html(node *html.Node) string

func SetAttr

func SetAttr(n *html.Node, attrName, val string)

func Tranverse

func Tranverse(n *html.Node, f func(*html.Node))

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL