id
int32
0
167k
repo
stringlengths
5
54
path
stringlengths
4
155
func_name
stringlengths
1
118
original_string
stringlengths
52
85.5k
language
stringclasses
1 value
code
stringlengths
52
85.5k
code_tokens
list
docstring
stringlengths
6
2.61k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
85
252
134,100
henrylee2cn/pholcus
common/xlsx/reftable.go
AddString
func (rt *RefTable) AddString(str string) int { if rt.isWrite { index, ok := rt.knownStrings[str] if ok { return index } } rt.indexedStrings = append(rt.indexedStrings, str) index := len(rt.indexedStrings) - 1 rt.knownStrings[str] = index return index }
go
func (rt *RefTable) AddString(str string) int { if rt.isWrite { index, ok := rt.knownStrings[str] if ok { return index } } rt.indexedStrings = append(rt.indexedStrings, str) index := len(rt.indexedStrings) - 1 rt.knownStrings[str] = index return index }
[ "func", "(", "rt", "*", "RefTable", ")", "AddString", "(", "str", "string", ")", "int", "{", "if", "rt", ".", "isWrite", "{", "index", ",", "ok", ":=", "rt", ".", "knownStrings", "[", "str", "]", "\n", "if", "ok", "{", "return", "index", "\n", "}...
// AddString adds a string to the reference table and return it's // numeric index. If the string already exists then it simply returns // the existing index.
[ "AddString", "adds", "a", "string", "to", "the", "reference", "table", "and", "return", "it", "s", "numeric", "index", ".", "If", "the", "string", "already", "exists", "then", "it", "simply", "returns", "the", "existing", "index", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/xlsx/reftable.go#L62-L73
134,101
henrylee2cn/pholcus
common/goquery/iteration.go
EachWithBreak
func (s *Selection) EachWithBreak(f func(int, *Selection) bool) *Selection { for i, n := range s.Nodes { if !f(i, newSingleSelection(n, s.document)) { return s } } return s }
go
func (s *Selection) EachWithBreak(f func(int, *Selection) bool) *Selection { for i, n := range s.Nodes { if !f(i, newSingleSelection(n, s.document)) { return s } } return s }
[ "func", "(", "s", "*", "Selection", ")", "EachWithBreak", "(", "f", "func", "(", "int", ",", "*", "Selection", ")", "bool", ")", "*", "Selection", "{", "for", "i", ",", "n", ":=", "range", "s", ".", "Nodes", "{", "if", "!", "f", "(", "i", ",", ...
// EachWithBreak iterates over a Selection object, executing a function for each // matched element. It is identical to Each except that it is possible to break // out of the loop by returning false in the callback function. It returns the // current Selection object.
[ "EachWithBreak", "iterates", "over", "a", "Selection", "object", "executing", "a", "function", "for", "each", "matched", "element", ".", "It", "is", "identical", "to", "Each", "except", "that", "it", "is", "possible", "to", "break", "out", "of", "the", "loop...
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/iteration.go#L19-L26
134,102
henrylee2cn/pholcus
common/xlsx/cell.go
SetString
func (c *Cell) SetString(s string) { c.Value = s c.formula = "" c.cellType = CellTypeString }
go
func (c *Cell) SetString(s string) { c.Value = s c.formula = "" c.cellType = CellTypeString }
[ "func", "(", "c", "*", "Cell", ")", "SetString", "(", "s", "string", ")", "{", "c", ".", "Value", "=", "s", "\n", "c", ".", "formula", "=", "\"", "\"", "\n", "c", ".", "cellType", "=", "CellTypeString", "\n", "}" ]
// SetString sets the value of a cell to a string.
[ "SetString", "sets", "the", "value", "of", "a", "cell", "to", "a", "string", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/xlsx/cell.go#L64-L68
134,103
henrylee2cn/pholcus
common/xlsx/cell.go
SetFloat
func (c *Cell) SetFloat(n float64) { c.SetFloatWithFormat(n, builtInNumFmt[builtInNumFmtIndex_GENERAL]) }
go
func (c *Cell) SetFloat(n float64) { c.SetFloatWithFormat(n, builtInNumFmt[builtInNumFmtIndex_GENERAL]) }
[ "func", "(", "c", "*", "Cell", ")", "SetFloat", "(", "n", "float64", ")", "{", "c", ".", "SetFloatWithFormat", "(", "n", ",", "builtInNumFmt", "[", "builtInNumFmtIndex_GENERAL", "]", ")", "\n", "}" ]
// SetFloat sets the value of a cell to a float.
[ "SetFloat", "sets", "the", "value", "of", "a", "cell", "to", "a", "float", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/xlsx/cell.go#L76-L78
134,104
henrylee2cn/pholcus
common/xlsx/cell.go
Float
func (c *Cell) Float() (float64, error) { f, err := strconv.ParseFloat(c.Value, 64) if err != nil { return math.NaN(), err } return f, nil }
go
func (c *Cell) Float() (float64, error) { f, err := strconv.ParseFloat(c.Value, 64) if err != nil { return math.NaN(), err } return f, nil }
[ "func", "(", "c", "*", "Cell", ")", "Float", "(", ")", "(", "float64", ",", "error", ")", "{", "f", ",", "err", ":=", "strconv", ".", "ParseFloat", "(", "c", ".", "Value", ",", "64", ")", "\n", "if", "err", "!=", "nil", "{", "return", "math", ...
// Float returns the value of cell as a number.
[ "Float", "returns", "the", "value", "of", "cell", "as", "a", "number", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/xlsx/cell.go#L137-L143
134,105
henrylee2cn/pholcus
common/xlsx/cell.go
SetInt64
func (c *Cell) SetInt64(n int64) { c.Value = fmt.Sprintf("%d", n) c.NumFmt = builtInNumFmt[builtInNumFmtIndex_INT] c.formula = "" c.cellType = CellTypeNumeric }
go
func (c *Cell) SetInt64(n int64) { c.Value = fmt.Sprintf("%d", n) c.NumFmt = builtInNumFmt[builtInNumFmtIndex_INT] c.formula = "" c.cellType = CellTypeNumeric }
[ "func", "(", "c", "*", "Cell", ")", "SetInt64", "(", "n", "int64", ")", "{", "c", ".", "Value", "=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "n", ")", "\n", "c", ".", "NumFmt", "=", "builtInNumFmt", "[", "builtInNumFmtIndex_INT", "]", "\n", ...
// SetInt64 sets a cell's value to a 64-bit integer.
[ "SetInt64", "sets", "a", "cell", "s", "value", "to", "a", "64", "-", "bit", "integer", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/xlsx/cell.go#L146-L151
134,106
henrylee2cn/pholcus
common/xlsx/cell.go
Int64
func (c *Cell) Int64() (int64, error) { f, err := strconv.ParseInt(c.Value, 10, 64) if err != nil { return -1, err } return f, nil }
go
func (c *Cell) Int64() (int64, error) { f, err := strconv.ParseInt(c.Value, 10, 64) if err != nil { return -1, err } return f, nil }
[ "func", "(", "c", "*", "Cell", ")", "Int64", "(", ")", "(", "int64", ",", "error", ")", "{", "f", ",", "err", ":=", "strconv", ".", "ParseInt", "(", "c", ".", "Value", ",", "10", ",", "64", ")", "\n", "if", "err", "!=", "nil", "{", "return", ...
// Int64 returns the value of cell as 64-bit integer.
[ "Int64", "returns", "the", "value", "of", "cell", "as", "64", "-", "bit", "integer", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/xlsx/cell.go#L154-L160
134,107
henrylee2cn/pholcus
common/xlsx/cell.go
SetBool
func (c *Cell) SetBool(b bool) { if b { c.Value = "1" } else { c.Value = "0" } c.cellType = CellTypeBool }
go
func (c *Cell) SetBool(b bool) { if b { c.Value = "1" } else { c.Value = "0" } c.cellType = CellTypeBool }
[ "func", "(", "c", "*", "Cell", ")", "SetBool", "(", "b", "bool", ")", "{", "if", "b", "{", "c", ".", "Value", "=", "\"", "\"", "\n", "}", "else", "{", "c", ".", "Value", "=", "\"", "\"", "\n", "}", "\n", "c", ".", "cellType", "=", "CellType...
// SetBool sets a cell's value to a boolean.
[ "SetBool", "sets", "a", "cell", "s", "value", "to", "a", "boolean", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/xlsx/cell.go#L224-L231
134,108
henrylee2cn/pholcus
common/xlsx/cell.go
GetStyle
func (c *Cell) GetStyle() *Style { if c.style == nil { c.style = NewStyle() } return c.style }
go
func (c *Cell) GetStyle() *Style { if c.style == nil { c.style = NewStyle() } return c.style }
[ "func", "(", "c", "*", "Cell", ")", "GetStyle", "(", ")", "*", "Style", "{", "if", "c", ".", "style", "==", "nil", "{", "c", ".", "style", "=", "NewStyle", "(", ")", "\n", "}", "\n", "return", "c", ".", "style", "\n", "}" ]
// GetStyle returns the Style associated with a Cell
[ "GetStyle", "returns", "the", "Style", "associated", "with", "a", "Cell" ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/xlsx/cell.go#L261-L266
134,109
henrylee2cn/pholcus
common/xlsx/cell.go
SafeFormattedValue
func (c *Cell) SafeFormattedValue() (string, error) { var numberFormat = c.GetNumberFormat() if isTimeFormat(numberFormat) { return parseTime(c) } switch numberFormat { case builtInNumFmt[builtInNumFmtIndex_GENERAL], builtInNumFmt[builtInNumFmtIndex_STRING]: return c.Value, nil case builtInNumFmt[builtInNumFm...
go
func (c *Cell) SafeFormattedValue() (string, error) { var numberFormat = c.GetNumberFormat() if isTimeFormat(numberFormat) { return parseTime(c) } switch numberFormat { case builtInNumFmt[builtInNumFmtIndex_GENERAL], builtInNumFmt[builtInNumFmtIndex_STRING]: return c.Value, nil case builtInNumFmt[builtInNumFm...
[ "func", "(", "c", "*", "Cell", ")", "SafeFormattedValue", "(", ")", "(", "string", ",", "error", ")", "{", "var", "numberFormat", "=", "c", ".", "GetNumberFormat", "(", ")", "\n", "if", "isTimeFormat", "(", "numberFormat", ")", "{", "return", "parseTime"...
// SafeFormattedValue returns a value, and possibly an error condition // from a Cell. If it is possible to apply a format to the cell // value, it will do so, if not then an error will be returned, along // with the raw value of the Cell.
[ "SafeFormattedValue", "returns", "a", "value", "and", "possibly", "an", "error", "condition", "from", "a", "Cell", ".", "If", "it", "is", "possible", "to", "apply", "a", "format", "to", "the", "cell", "value", "it", "will", "do", "so", "if", "not", "then...
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/xlsx/cell.go#L298-L349
134,110
henrylee2cn/pholcus
common/xlsx/cell.go
FormattedValue
func (c *Cell) FormattedValue() string { value, err := c.SafeFormattedValue() if err != nil { return err.Error() } return value }
go
func (c *Cell) FormattedValue() string { value, err := c.SafeFormattedValue() if err != nil { return err.Error() } return value }
[ "func", "(", "c", "*", "Cell", ")", "FormattedValue", "(", ")", "string", "{", "value", ",", "err", ":=", "c", ".", "SafeFormattedValue", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", ".", "Error", "(", ")", "\n", "}", "\n", "re...
// FormattedValue returns the formatted version of the value. // If it's a string type, c.Value will just be returned. Otherwise, // it will attempt to apply Excel formatting to the value.
[ "FormattedValue", "returns", "the", "formatted", "version", "of", "the", "value", ".", "If", "it", "s", "a", "string", "type", "c", ".", "Value", "will", "just", "be", "returned", ".", "Otherwise", "it", "will", "attempt", "to", "apply", "Excel", "formatti...
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/xlsx/cell.go#L354-L360
134,111
henrylee2cn/pholcus
common/xlsx/cell.go
isTimeFormat
func isTimeFormat(format string) bool { dateParts := []string{ "yy", "hh", "am", "pm", "ss", "mm", ":", } for _, part := range dateParts { if strings.Contains(format, part) { return true } } return false }
go
func isTimeFormat(format string) bool { dateParts := []string{ "yy", "hh", "am", "pm", "ss", "mm", ":", } for _, part := range dateParts { if strings.Contains(format, part) { return true } } return false }
[ "func", "isTimeFormat", "(", "format", "string", ")", "bool", "{", "dateParts", ":=", "[", "]", "string", "{", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ",", "}", "\n", "...
// isTimeFormat checks whether an Excel format string represents // a time.Time.
[ "isTimeFormat", "checks", "whether", "an", "Excel", "format", "string", "represents", "a", "time", ".", "Time", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/xlsx/cell.go#L410-L420
134,112
henrylee2cn/pholcus
app/downloader/surfer/agent/agent.go
CreateDefault
func CreateDefault(browser string) string { bn := strings.ToLower(browser) data := Database[bn] os := data.DefaultOS osAttribs := DefaultOSAttributes[os] return createFromDetails( browser, data.TopVersion, osAttribs.OSName, osAttribs.OSVersion, osAttribs.Comments) }
go
func CreateDefault(browser string) string { bn := strings.ToLower(browser) data := Database[bn] os := data.DefaultOS osAttribs := DefaultOSAttributes[os] return createFromDetails( browser, data.TopVersion, osAttribs.OSName, osAttribs.OSVersion, osAttribs.Comments) }
[ "func", "CreateDefault", "(", "browser", "string", ")", "string", "{", "bn", ":=", "strings", ".", "ToLower", "(", "browser", ")", "\n", "data", ":=", "Database", "[", "bn", "]", "\n", "os", ":=", "data", ".", "DefaultOS", "\n", "osAttribs", ":=", "Def...
// CreateDefault returns a user agent string using default values.
[ "CreateDefault", "returns", "a", "user", "agent", "string", "using", "default", "values", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/app/downloader/surfer/agent/agent.go#L243-L255
134,113
henrylee2cn/pholcus
app/downloader/surfer/agent/agent.go
CreateVersion
func CreateVersion(browser, version string) string { bn := strings.ToLower(browser) data := Database[bn] os := data.DefaultOS osAttribs := DefaultOSAttributes[os] return createFromDetails( browser, version, osAttribs.OSName, osAttribs.OSVersion, osAttribs.Comments) }
go
func CreateVersion(browser, version string) string { bn := strings.ToLower(browser) data := Database[bn] os := data.DefaultOS osAttribs := DefaultOSAttributes[os] return createFromDetails( browser, version, osAttribs.OSName, osAttribs.OSVersion, osAttribs.Comments) }
[ "func", "CreateVersion", "(", "browser", ",", "version", "string", ")", "string", "{", "bn", ":=", "strings", ".", "ToLower", "(", "browser", ")", "\n", "data", ":=", "Database", "[", "bn", "]", "\n", "os", ":=", "data", ".", "DefaultOS", "\n", "osAttr...
// CreateVersion generates and returns a complete user agent string for a specific browser version.
[ "CreateVersion", "generates", "and", "returns", "a", "complete", "user", "agent", "string", "for", "a", "specific", "browser", "version", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/app/downloader/surfer/agent/agent.go#L258-L270
134,114
henrylee2cn/pholcus
app/downloader/surfer/agent/agent.go
TopVersion
func TopVersion(bname string) string { bname = strings.ToLower(bname) data, ok := Database[bname] if ok { return data.TopVersion } return Database["default"].TopVersion }
go
func TopVersion(bname string) string { bname = strings.ToLower(bname) data, ok := Database[bname] if ok { return data.TopVersion } return Database["default"].TopVersion }
[ "func", "TopVersion", "(", "bname", "string", ")", "string", "{", "bname", "=", "strings", ".", "ToLower", "(", "bname", ")", "\n", "data", ",", "ok", ":=", "Database", "[", "bname", "]", "\n", "if", "ok", "{", "return", "data", ".", "TopVersion", "\...
// TopVersion returns the most recent version for the given browser name.
[ "TopVersion", "returns", "the", "most", "recent", "version", "for", "the", "given", "browser", "name", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/app/downloader/surfer/agent/agent.go#L273-L280
134,115
henrylee2cn/pholcus
app/downloader/surfer/agent/agent.go
Format
func Format(bname, bver string) string { bname = strings.ToLower(bname) majVer := strings.Split(bver, ".")[0] data, ok := Database[bname] if ok { format, ok := data.Formats[majVer] if ok { return format } else { top := TopVersion(bname) majVer = strings.Split(top, ".")[0] return data.Formats[majVe...
go
func Format(bname, bver string) string { bname = strings.ToLower(bname) majVer := strings.Split(bver, ".")[0] data, ok := Database[bname] if ok { format, ok := data.Formats[majVer] if ok { return format } else { top := TopVersion(bname) majVer = strings.Split(top, ".")[0] return data.Formats[majVe...
[ "func", "Format", "(", "bname", ",", "bver", "string", ")", "string", "{", "bname", "=", "strings", ".", "ToLower", "(", "bname", ")", "\n", "majVer", ":=", "strings", ".", "Split", "(", "bver", ",", "\"", "\"", ")", "[", "0", "]", "\n", "data", ...
// Format returns the format string for the given browser name and version. // // When a format can't be found for a version, the first format string for the browser // is returned. When a format can't be found for the browser the default format is // returned.
[ "Format", "returns", "the", "format", "string", "for", "the", "given", "browser", "name", "and", "version", ".", "When", "a", "format", "can", "t", "be", "found", "for", "a", "version", "the", "first", "format", "string", "for", "the", "browser", "is", "...
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/app/downloader/surfer/agent/agent.go#L287-L303
134,116
henrylee2cn/pholcus
app/downloader/surfer/agent/agent.go
createFromDetails
func createFromDetails(bname, bver, osname, osver string, c []string) string { if bver == "" { bver = TopVersion(bname) } comments := strings.Join(c, "; ") if comments != "" { comments = "; " + comments } data := TemplateData{bname, bver, osname, osver, comments} buff := &bytes.Buffer{} t := template.New("...
go
func createFromDetails(bname, bver, osname, osver string, c []string) string { if bver == "" { bver = TopVersion(bname) } comments := strings.Join(c, "; ") if comments != "" { comments = "; " + comments } data := TemplateData{bname, bver, osname, osver, comments} buff := &bytes.Buffer{} t := template.New("...
[ "func", "createFromDetails", "(", "bname", ",", "bver", ",", "osname", ",", "osver", "string", ",", "c", "[", "]", "string", ")", "string", "{", "if", "bver", "==", "\"", "\"", "{", "bver", "=", "TopVersion", "(", "bname", ")", "\n", "}", "\n", "co...
// createFromDetails generates and returns a complete user agent string.
[ "createFromDetails", "generates", "and", "returns", "a", "complete", "user", "agent", "string", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/app/downloader/surfer/agent/agent.go#L306-L322
134,117
henrylee2cn/pholcus
common/xlsx/xmlWorksheet.go
newXlsxWorksheet
func newXlsxWorksheet() (worksheet *xlsxWorksheet) { worksheet = &xlsxWorksheet{} worksheet.SheetPr.FilterMode = false worksheet.SheetPr.PageSetUpPr = make([]xlsxPageSetUpPr, 1) worksheet.SheetPr.PageSetUpPr[0] = xlsxPageSetUpPr{FitToPage: false} worksheet.SheetViews.SheetView = make([]xlsxSheetView, 1) worksheet...
go
func newXlsxWorksheet() (worksheet *xlsxWorksheet) { worksheet = &xlsxWorksheet{} worksheet.SheetPr.FilterMode = false worksheet.SheetPr.PageSetUpPr = make([]xlsxPageSetUpPr, 1) worksheet.SheetPr.PageSetUpPr[0] = xlsxPageSetUpPr{FitToPage: false} worksheet.SheetViews.SheetView = make([]xlsxSheetView, 1) worksheet...
[ "func", "newXlsxWorksheet", "(", ")", "(", "worksheet", "*", "xlsxWorksheet", ")", "{", "worksheet", "=", "&", "xlsxWorksheet", "{", "}", "\n", "worksheet", ".", "SheetPr", ".", "FilterMode", "=", "false", "\n", "worksheet", ".", "SheetPr", ".", "PageSetUpPr...
// Create a new XLSX Worksheet with default values populated. // Strictly for internal use only!
[ "Create", "a", "new", "XLSX", "Worksheet", "with", "default", "values", "populated", ".", "Strictly", "for", "internal", "use", "only!" ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/xlsx/xmlWorksheet.go#L293-L355
134,118
henrylee2cn/pholcus
common/mahonia/gbk.go
init
func init() { RegisterCharset(&Charset{ Name: "GBK", Aliases: []string{"GB2312"}, // GBK is a superset of GB2312. NewDecoder: func() Decoder { return decodeGBKRune }, NewEncoder: func() Encoder { return encodeGBKRune }, }) }
go
func init() { RegisterCharset(&Charset{ Name: "GBK", Aliases: []string{"GB2312"}, // GBK is a superset of GB2312. NewDecoder: func() Decoder { return decodeGBKRune }, NewEncoder: func() Encoder { return encodeGBKRune }, }) }
[ "func", "init", "(", ")", "{", "RegisterCharset", "(", "&", "Charset", "{", "Name", ":", "\"", "\"", ",", "Aliases", ":", "[", "]", "string", "{", "\"", "\"", "}", ",", "// GBK is a superset of GB2312.", "NewDecoder", ":", "func", "(", ")", "Decoder", ...
// Converters for GBK encoding.
[ "Converters", "for", "GBK", "encoding", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/mahonia/gbk.go#L5-L16
134,119
henrylee2cn/pholcus
common/mahonia/writer.go
NewWriter
func (e Encoder) NewWriter(wr io.Writer) *Writer { w := new(Writer) w.wr = wr w.encode = e return w }
go
func (e Encoder) NewWriter(wr io.Writer) *Writer { w := new(Writer) w.wr = wr w.encode = e return w }
[ "func", "(", "e", "Encoder", ")", "NewWriter", "(", "wr", "io", ".", "Writer", ")", "*", "Writer", "{", "w", ":=", "new", "(", "Writer", ")", "\n", "w", ".", "wr", "=", "wr", "\n", "w", ".", "encode", "=", "e", "\n", "return", "w", "\n", "}" ...
// NewWriter creates a new Writer that uses the receiver to encode text.
[ "NewWriter", "creates", "a", "new", "Writer", "that", "uses", "the", "receiver", "to", "encode", "text", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/mahonia/writer.go#L17-L22
134,120
henrylee2cn/pholcus
common/mahonia/writer.go
Write
func (w *Writer) Write(p []byte) (n int, err error) { n = len(p) if len(w.inbuf) > 0 { w.inbuf = append(w.inbuf, p...) p = w.inbuf } if len(w.outbuf) < len(p) { w.outbuf = make([]byte, len(p)+10) } outpos := 0 for len(p) > 0 { rune, size := utf8.DecodeRune(p) if rune == 0xfffd && !utf8.FullRune(p) ...
go
func (w *Writer) Write(p []byte) (n int, err error) { n = len(p) if len(w.inbuf) > 0 { w.inbuf = append(w.inbuf, p...) p = w.inbuf } if len(w.outbuf) < len(p) { w.outbuf = make([]byte, len(p)+10) } outpos := 0 for len(p) > 0 { rune, size := utf8.DecodeRune(p) if rune == 0xfffd && !utf8.FullRune(p) ...
[ "func", "(", "w", "*", "Writer", ")", "Write", "(", "p", "[", "]", "byte", ")", "(", "n", "int", ",", "err", "error", ")", "{", "n", "=", "len", "(", "p", ")", "\n\n", "if", "len", "(", "w", ".", "inbuf", ")", ">", "0", "{", "w", ".", "...
// Write encodes and writes the data from p.
[ "Write", "encodes", "and", "writes", "the", "data", "from", "p", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/mahonia/writer.go#L25-L77
134,121
henrylee2cn/pholcus
common/goquery/property.go
Attr
func (s *Selection) Attr(attrName string) (val string, exists bool) { if len(s.Nodes) == 0 { return } return getAttributeValue(attrName, s.Nodes[0]) }
go
func (s *Selection) Attr(attrName string) (val string, exists bool) { if len(s.Nodes) == 0 { return } return getAttributeValue(attrName, s.Nodes[0]) }
[ "func", "(", "s", "*", "Selection", ")", "Attr", "(", "attrName", "string", ")", "(", "val", "string", ",", "exists", "bool", ")", "{", "if", "len", "(", "s", ".", "Nodes", ")", "==", "0", "{", "return", "\n", "}", "\n", "return", "getAttributeValu...
// Attr gets the specified attribute's value for the first element in the // Selection. To get the value for each element individually, use a looping // construct such as Each or Map method.
[ "Attr", "gets", "the", "specified", "attribute", "s", "value", "for", "the", "first", "element", "in", "the", "Selection", ".", "To", "get", "the", "value", "for", "each", "element", "individually", "use", "a", "looping", "construct", "such", "as", "Each", ...
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/property.go#L16-L21
134,122
henrylee2cn/pholcus
common/goquery/property.go
AttrOr
func (s *Selection) AttrOr(attrName, defaultValue string) string { if len(s.Nodes) == 0 { return defaultValue } val, exists := getAttributeValue(attrName, s.Nodes[0]) if !exists { return defaultValue } return val }
go
func (s *Selection) AttrOr(attrName, defaultValue string) string { if len(s.Nodes) == 0 { return defaultValue } val, exists := getAttributeValue(attrName, s.Nodes[0]) if !exists { return defaultValue } return val }
[ "func", "(", "s", "*", "Selection", ")", "AttrOr", "(", "attrName", ",", "defaultValue", "string", ")", "string", "{", "if", "len", "(", "s", ".", "Nodes", ")", "==", "0", "{", "return", "defaultValue", "\n", "}", "\n\n", "val", ",", "exists", ":=", ...
// AttrOr works like Attr but returns default value if attribute is not present.
[ "AttrOr", "works", "like", "Attr", "but", "returns", "default", "value", "if", "attribute", "is", "not", "present", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/property.go#L24-L35
134,123
henrylee2cn/pholcus
common/goquery/property.go
RemoveAttr
func (s *Selection) RemoveAttr(attrName string) *Selection { for _, n := range s.Nodes { removeAttr(n, attrName) } return s }
go
func (s *Selection) RemoveAttr(attrName string) *Selection { for _, n := range s.Nodes { removeAttr(n, attrName) } return s }
[ "func", "(", "s", "*", "Selection", ")", "RemoveAttr", "(", "attrName", "string", ")", "*", "Selection", "{", "for", "_", ",", "n", ":=", "range", "s", ".", "Nodes", "{", "removeAttr", "(", "n", ",", "attrName", ")", "\n", "}", "\n\n", "return", "s...
// RemoveAttr removes the named attribute from each element in the set of matched elements.
[ "RemoveAttr", "removes", "the", "named", "attribute", "from", "each", "element", "in", "the", "set", "of", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/property.go#L38-L44
134,124
henrylee2cn/pholcus
common/goquery/property.go
SetAttr
func (s *Selection) SetAttr(attrName, val string) *Selection { for _, n := range s.Nodes { attr := getAttributePtr(attrName, n) if attr == nil { n.Attr = append(n.Attr, html.Attribute{Key: attrName, Val: val}) } else { attr.Val = val } } return s }
go
func (s *Selection) SetAttr(attrName, val string) *Selection { for _, n := range s.Nodes { attr := getAttributePtr(attrName, n) if attr == nil { n.Attr = append(n.Attr, html.Attribute{Key: attrName, Val: val}) } else { attr.Val = val } } return s }
[ "func", "(", "s", "*", "Selection", ")", "SetAttr", "(", "attrName", ",", "val", "string", ")", "*", "Selection", "{", "for", "_", ",", "n", ":=", "range", "s", ".", "Nodes", "{", "attr", ":=", "getAttributePtr", "(", "attrName", ",", "n", ")", "\n...
// SetAttr sets the given attribute on each element in the set of matched elements.
[ "SetAttr", "sets", "the", "given", "attribute", "on", "each", "element", "in", "the", "set", "of", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/property.go#L47-L58
134,125
henrylee2cn/pholcus
common/goquery/property.go
Html
func (s *Selection) Html() (ret string, e error) { // Since there is no .innerHtml, the HTML content must be re-created from // the nodes using html.Render. var buf bytes.Buffer if len(s.Nodes) > 0 { for c := s.Nodes[0].FirstChild; c != nil; c = c.NextSibling { e = html.Render(&buf, c) if e != nil { re...
go
func (s *Selection) Html() (ret string, e error) { // Since there is no .innerHtml, the HTML content must be re-created from // the nodes using html.Render. var buf bytes.Buffer if len(s.Nodes) > 0 { for c := s.Nodes[0].FirstChild; c != nil; c = c.NextSibling { e = html.Render(&buf, c) if e != nil { re...
[ "func", "(", "s", "*", "Selection", ")", "Html", "(", ")", "(", "ret", "string", ",", "e", "error", ")", "{", "// Since there is no .innerHtml, the HTML content must be re-created from", "// the nodes using html.Render.", "var", "buf", "bytes", ".", "Buffer", "\n\n", ...
// Html gets the HTML contents of the first element in the set of matched // elements. It includes text and comment nodes.
[ "Html", "gets", "the", "HTML", "contents", "of", "the", "first", "element", "in", "the", "set", "of", "matched", "elements", ".", "It", "includes", "text", "and", "comment", "nodes", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/property.go#L84-L100
134,126
henrylee2cn/pholcus
common/goquery/property.go
HasClass
func (s *Selection) HasClass(class string) bool { class = " " + class + " " for _, n := range s.Nodes { classes, _ := getClassesAndAttr(n, false) if strings.Contains(classes, class) { return true } } return false }
go
func (s *Selection) HasClass(class string) bool { class = " " + class + " " for _, n := range s.Nodes { classes, _ := getClassesAndAttr(n, false) if strings.Contains(classes, class) { return true } } return false }
[ "func", "(", "s", "*", "Selection", ")", "HasClass", "(", "class", "string", ")", "bool", "{", "class", "=", "\"", "\"", "+", "class", "+", "\"", "\"", "\n", "for", "_", ",", "n", ":=", "range", "s", ".", "Nodes", "{", "classes", ",", "_", ":="...
// HasClass determines whether any of the matched elements are assigned the // given class.
[ "HasClass", "determines", "whether", "any", "of", "the", "matched", "elements", "are", "assigned", "the", "given", "class", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/property.go#L128-L137
134,127
henrylee2cn/pholcus
common/goquery/property.go
getNodeText
func getNodeText(node *html.Node) string { if node.Type == html.TextNode { // Keep newlines and spaces, like jQuery return node.Data } else if node.FirstChild != nil { var buf bytes.Buffer for c := node.FirstChild; c != nil; c = c.NextSibling { buf.WriteString(getNodeText(c)) } return buf.String() } ...
go
func getNodeText(node *html.Node) string { if node.Type == html.TextNode { // Keep newlines and spaces, like jQuery return node.Data } else if node.FirstChild != nil { var buf bytes.Buffer for c := node.FirstChild; c != nil; c = c.NextSibling { buf.WriteString(getNodeText(c)) } return buf.String() } ...
[ "func", "getNodeText", "(", "node", "*", "html", ".", "Node", ")", "string", "{", "if", "node", ".", "Type", "==", "html", ".", "TextNode", "{", "// Keep newlines and spaces, like jQuery", "return", "node", ".", "Data", "\n", "}", "else", "if", "node", "."...
// Get the specified node's text content.
[ "Get", "the", "specified", "node", "s", "text", "content", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/property.go#L196-L209
134,128
henrylee2cn/pholcus
common/goquery/property.go
getAttributeValue
func getAttributeValue(attrName string, n *html.Node) (val string, exists bool) { if a := getAttributePtr(attrName, n); a != nil { val = a.Val exists = true } return }
go
func getAttributeValue(attrName string, n *html.Node) (val string, exists bool) { if a := getAttributePtr(attrName, n); a != nil { val = a.Val exists = true } return }
[ "func", "getAttributeValue", "(", "attrName", "string", ",", "n", "*", "html", ".", "Node", ")", "(", "val", "string", ",", "exists", "bool", ")", "{", "if", "a", ":=", "getAttributePtr", "(", "attrName", ",", "n", ")", ";", "a", "!=", "nil", "{", ...
// Private function to get the specified attribute's value from a node.
[ "Private", "function", "to", "get", "the", "specified", "attribute", "s", "value", "from", "a", "node", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/property.go#L225-L231
134,129
henrylee2cn/pholcus
common/goquery/property.go
getClassesAndAttr
func getClassesAndAttr(n *html.Node, create bool) (classes string, attr *html.Attribute) { // Applies only to element nodes if n.Type == html.ElementNode { attr = getAttributePtr("class", n) if attr == nil && create { n.Attr = append(n.Attr, html.Attribute{ Key: "class", Val: "", }) attr = &n.Att...
go
func getClassesAndAttr(n *html.Node, create bool) (classes string, attr *html.Attribute) { // Applies only to element nodes if n.Type == html.ElementNode { attr = getAttributePtr("class", n) if attr == nil && create { n.Attr = append(n.Attr, html.Attribute{ Key: "class", Val: "", }) attr = &n.Att...
[ "func", "getClassesAndAttr", "(", "n", "*", "html", ".", "Node", ",", "create", "bool", ")", "(", "classes", "string", ",", "attr", "*", "html", ".", "Attribute", ")", "{", "// Applies only to element nodes", "if", "n", ".", "Type", "==", "html", ".", "E...
// Get and normalize the "class" attribute from the node.
[ "Get", "and", "normalize", "the", "class", "attribute", "from", "the", "node", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/property.go#L234-L254
134,130
henrylee2cn/pholcus
common/goquery/type.go
NewDocument
func NewDocument(url string) (*Document, error) { // Load the URL res, e := http.Get(url) if e != nil { return nil, e } return NewDocumentFromResponse(res) }
go
func NewDocument(url string) (*Document, error) { // Load the URL res, e := http.Get(url) if e != nil { return nil, e } return NewDocumentFromResponse(res) }
[ "func", "NewDocument", "(", "url", "string", ")", "(", "*", "Document", ",", "error", ")", "{", "// Load the URL", "res", ",", "e", ":=", "http", ".", "Get", "(", "url", ")", "\n", "if", "e", "!=", "nil", "{", "return", "nil", ",", "e", "\n", "}"...
// NewDocument is a Document constructor that takes a string URL as argument. // It loads the specified document, parses it, and stores the root Document // node, ready to be manipulated.
[ "NewDocument", "is", "a", "Document", "constructor", "that", "takes", "a", "string", "URL", "as", "argument", ".", "It", "loads", "the", "specified", "document", "parses", "it", "and", "stores", "the", "root", "Document", "node", "ready", "to", "be", "manipu...
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/type.go#L34-L41
134,131
henrylee2cn/pholcus
common/goquery/type.go
NewDocumentFromResponse
func NewDocumentFromResponse(res *http.Response) (*Document, error) { if res == nil { return nil, errors.New("Response is nil") } defer res.Body.Close() if res.Request == nil { return nil, errors.New("Response.Request is nil") } // Parse the HTML into nodes root, e := html.Parse(res.Body) if e != nil { r...
go
func NewDocumentFromResponse(res *http.Response) (*Document, error) { if res == nil { return nil, errors.New("Response is nil") } defer res.Body.Close() if res.Request == nil { return nil, errors.New("Response.Request is nil") } // Parse the HTML into nodes root, e := html.Parse(res.Body) if e != nil { r...
[ "func", "NewDocumentFromResponse", "(", "res", "*", "http", ".", "Response", ")", "(", "*", "Document", ",", "error", ")", "{", "if", "res", "==", "nil", "{", "return", "nil", ",", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n", "defer...
// NewDocumentFromResponse is another Document constructor that takes an http response as argument. // It loads the specified response's document, parses it, and stores the root Document // node, ready to be manipulated. The response's body is closed on return.
[ "NewDocumentFromResponse", "is", "another", "Document", "constructor", "that", "takes", "an", "http", "response", "as", "argument", ".", "It", "loads", "the", "specified", "response", "s", "document", "parses", "it", "and", "stores", "the", "root", "Document", "...
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/type.go#L59-L76
134,132
henrylee2cn/pholcus
common/goquery/type.go
CloneDocument
func CloneDocument(doc *Document) *Document { return newDocument(cloneNode(doc.rootNode), doc.Url) }
go
func CloneDocument(doc *Document) *Document { return newDocument(cloneNode(doc.rootNode), doc.Url) }
[ "func", "CloneDocument", "(", "doc", "*", "Document", ")", "*", "Document", "{", "return", "newDocument", "(", "cloneNode", "(", "doc", ".", "rootNode", ")", ",", "doc", ".", "Url", ")", "\n", "}" ]
// CloneDocument creates a deep-clone of a document.
[ "CloneDocument", "creates", "a", "deep", "-", "clone", "of", "a", "document", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/type.go#L79-L81
134,133
henrylee2cn/pholcus
common/goquery/type.go
newDocument
func newDocument(root *html.Node, url *url.URL) *Document { // Create and fill the document d := &Document{nil, url, root} d.Selection = newSingleSelection(root, d) return d }
go
func newDocument(root *html.Node, url *url.URL) *Document { // Create and fill the document d := &Document{nil, url, root} d.Selection = newSingleSelection(root, d) return d }
[ "func", "newDocument", "(", "root", "*", "html", ".", "Node", ",", "url", "*", "url", ".", "URL", ")", "*", "Document", "{", "// Create and fill the document", "d", ":=", "&", "Document", "{", "nil", ",", "url", ",", "root", "}", "\n", "d", ".", "Sel...
// Private constructor, make sure all fields are correctly filled.
[ "Private", "constructor", "make", "sure", "all", "fields", "are", "correctly", "filled", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/type.go#L84-L89
134,134
henrylee2cn/pholcus
common/goquery/type.go
newSingleSelection
func newSingleSelection(node *html.Node, doc *Document) *Selection { return &Selection{[]*html.Node{node}, doc, nil} }
go
func newSingleSelection(node *html.Node, doc *Document) *Selection { return &Selection{[]*html.Node{node}, doc, nil} }
[ "func", "newSingleSelection", "(", "node", "*", "html", ".", "Node", ",", "doc", "*", "Document", ")", "*", "Selection", "{", "return", "&", "Selection", "{", "[", "]", "*", "html", ".", "Node", "{", "node", "}", ",", "doc", ",", "nil", "}", "\n", ...
// Helper constructor to create a selection of only one node
[ "Helper", "constructor", "to", "create", "a", "selection", "of", "only", "one", "node" ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/type.go#L106-L108
134,135
henrylee2cn/pholcus
common/goquery/type.go
compileMatcher
func compileMatcher(s string) Matcher { cs, err := cascadia.Compile(s) if err != nil { return invalidMatcher{} } return cs }
go
func compileMatcher(s string) Matcher { cs, err := cascadia.Compile(s) if err != nil { return invalidMatcher{} } return cs }
[ "func", "compileMatcher", "(", "s", "string", ")", "Matcher", "{", "cs", ",", "err", ":=", "cascadia", ".", "Compile", "(", "s", ")", "\n", "if", "err", "!=", "nil", "{", "return", "invalidMatcher", "{", "}", "\n", "}", "\n", "return", "cs", "\n", ...
// compileMatcher compiles the selector string s and returns // the corresponding Matcher. If s is an invalid selector string, // it returns a Matcher that fails all matches.
[ "compileMatcher", "compiles", "the", "selector", "string", "s", "and", "returns", "the", "corresponding", "Matcher", ".", "If", "s", "is", "an", "invalid", "selector", "string", "it", "returns", "a", "Matcher", "that", "fails", "all", "matches", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/type.go#L122-L128
134,136
henrylee2cn/pholcus
common/util/util.go
IsNum
func IsNum(a string) bool { reg, _ := regexp.Compile("^\\d+$") return reg.MatchString(a) }
go
func IsNum(a string) bool { reg, _ := regexp.Compile("^\\d+$") return reg.MatchString(a) }
[ "func", "IsNum", "(", "a", "string", ")", "bool", "{", "reg", ",", "_", ":=", "regexp", ".", "Compile", "(", "\"", "\\\\", "\"", ")", "\n", "return", "reg", ".", "MatchString", "(", "a", ")", "\n", "}" ]
// The IsNum judges string is number or not.
[ "The", "IsNum", "judges", "string", "is", "number", "or", "not", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/util/util.go#L242-L245
134,137
henrylee2cn/pholcus
common/util/util.go
XML2mapstr
func XML2mapstr(xmldoc string) map[string]string { var t xml.Token var err error inputReader := strings.NewReader(xmldoc) decoder := xml.NewDecoder(inputReader) decoder.CharsetReader = func(s string, r io.Reader) (io.Reader, error) { return charset.NewReader(r, s) } m := make(map[string]string, 32) key := "" ...
go
func XML2mapstr(xmldoc string) map[string]string { var t xml.Token var err error inputReader := strings.NewReader(xmldoc) decoder := xml.NewDecoder(inputReader) decoder.CharsetReader = func(s string, r io.Reader) (io.Reader, error) { return charset.NewReader(r, s) } m := make(map[string]string, 32) key := "" ...
[ "func", "XML2mapstr", "(", "xmldoc", "string", ")", "map", "[", "string", "]", "string", "{", "var", "t", "xml", ".", "Token", "\n", "var", "err", "error", "\n", "inputReader", ":=", "strings", ".", "NewReader", "(", "xmldoc", ")", "\n", "decoder", ":=...
// simple xml to string support utf8
[ "simple", "xml", "to", "string", "support", "utf8" ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/util/util.go#L248-L271
134,138
henrylee2cn/pholcus
common/util/util.go
MakeHash
func MakeHash(s string) string { const IEEE = 0xedb88320 var IEEETable = crc32.MakeTable(IEEE) hash := fmt.Sprintf("%x", crc32.Checksum([]byte(s), IEEETable)) return hash }
go
func MakeHash(s string) string { const IEEE = 0xedb88320 var IEEETable = crc32.MakeTable(IEEE) hash := fmt.Sprintf("%x", crc32.Checksum([]byte(s), IEEETable)) return hash }
[ "func", "MakeHash", "(", "s", "string", ")", "string", "{", "const", "IEEE", "=", "0xedb88320", "\n", "var", "IEEETable", "=", "crc32", ".", "MakeTable", "(", "IEEE", ")", "\n", "hash", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "crc32", ".",...
//string to hash
[ "string", "to", "hash" ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/util/util.go#L274-L279
134,139
henrylee2cn/pholcus
common/xlsx/lib.go
lettersToNumeric
func lettersToNumeric(letters string) int { sum, mul, n := 0, 1, 0 for i := len(letters) - 1; i >= 0; i, mul, n = i-1, mul*26, 1 { c := letters[i] switch { case 'A' <= c && c <= 'Z': n += int(c - 'A') case 'a' <= c && c <= 'z': n += int(c - 'a') } sum += n * mul } return sum }
go
func lettersToNumeric(letters string) int { sum, mul, n := 0, 1, 0 for i := len(letters) - 1; i >= 0; i, mul, n = i-1, mul*26, 1 { c := letters[i] switch { case 'A' <= c && c <= 'Z': n += int(c - 'A') case 'a' <= c && c <= 'z': n += int(c - 'a') } sum += n * mul } return sum }
[ "func", "lettersToNumeric", "(", "letters", "string", ")", "int", "{", "sum", ",", "mul", ",", "n", ":=", "0", ",", "1", ",", "0", "\n", "for", "i", ":=", "len", "(", "letters", ")", "-", "1", ";", "i", ">=", "0", ";", "i", ",", "mul", ",", ...
// lettersToNumeric is used to convert a character based column // reference to a zero based numeric column identifier.
[ "lettersToNumeric", "is", "used", "to", "convert", "a", "character", "based", "column", "reference", "to", "a", "zero", "based", "numeric", "column", "identifier", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/xlsx/lib.go#L51-L64
134,140
henrylee2cn/pholcus
common/xlsx/lib.go
getLargestDenominator
func getLargestDenominator(numerator, multiple, baseDenominator, power int) (int, int) { if numerator/multiple == 0 { return 1, power } next, nextPower := getLargestDenominator( numerator, multiple*baseDenominator, baseDenominator, power+1) if next > multiple { return next, nextPower } return multiple, powe...
go
func getLargestDenominator(numerator, multiple, baseDenominator, power int) (int, int) { if numerator/multiple == 0 { return 1, power } next, nextPower := getLargestDenominator( numerator, multiple*baseDenominator, baseDenominator, power+1) if next > multiple { return next, nextPower } return multiple, powe...
[ "func", "getLargestDenominator", "(", "numerator", ",", "multiple", ",", "baseDenominator", ",", "power", "int", ")", "(", "int", ",", "int", ")", "{", "if", "numerator", "/", "multiple", "==", "0", "{", "return", "1", ",", "power", "\n", "}", "\n", "n...
// Get the largestDenominator that is a multiple of a basedDenominator // and fits at least once into a given numerator.
[ "Get", "the", "largestDenominator", "that", "is", "a", "multiple", "of", "a", "basedDenominator", "and", "fits", "at", "least", "once", "into", "a", "given", "numerator", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/xlsx/lib.go#L68-L78
134,141
henrylee2cn/pholcus
common/xlsx/lib.go
formatColumnName
func formatColumnName(colId []int) string { lastPart := len(colId) - 1 result := "" for n, part := range colId { if n == lastPart { // The least significant number is in the // range 0-25, all other numbers are 1-26, // hence we use a differente offset for the // last part. result += string(part + ...
go
func formatColumnName(colId []int) string { lastPart := len(colId) - 1 result := "" for n, part := range colId { if n == lastPart { // The least significant number is in the // range 0-25, all other numbers are 1-26, // hence we use a differente offset for the // last part. result += string(part + ...
[ "func", "formatColumnName", "(", "colId", "[", "]", "int", ")", "string", "{", "lastPart", ":=", "len", "(", "colId", ")", "-", "1", "\n\n", "result", ":=", "\"", "\"", "\n", "for", "n", ",", "part", ":=", "range", "colId", "{", "if", "n", "==", ...
// Convers a list of numbers representing a column into a alphabetic // representation, as used in the spreadsheet.
[ "Convers", "a", "list", "of", "numbers", "representing", "a", "column", "into", "a", "alphabetic", "representation", "as", "used", "in", "the", "spreadsheet", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/xlsx/lib.go#L82-L102
134,142
henrylee2cn/pholcus
common/xlsx/lib.go
numericToLetters
func numericToLetters(colRef int) string { parts := intToBase26(colRef) return formatColumnName(smooshBase26Slice(parts)) }
go
func numericToLetters(colRef int) string { parts := intToBase26(colRef) return formatColumnName(smooshBase26Slice(parts)) }
[ "func", "numericToLetters", "(", "colRef", "int", ")", "string", "{", "parts", ":=", "intToBase26", "(", "colRef", ")", "\n", "return", "formatColumnName", "(", "smooshBase26Slice", "(", "parts", ")", ")", "\n", "}" ]
// numericToLetters is used to convert a zero based, numeric column // indentifier into a character code.
[ "numericToLetters", "is", "used", "to", "convert", "a", "zero", "based", "numeric", "column", "indentifier", "into", "a", "character", "code", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/xlsx/lib.go#L139-L142
134,143
henrylee2cn/pholcus
common/xlsx/lib.go
letterOnlyMapF
func letterOnlyMapF(rune rune) rune { switch { case 'A' <= rune && rune <= 'Z': return rune case 'a' <= rune && rune <= 'z': return rune - 32 } return -1 }
go
func letterOnlyMapF(rune rune) rune { switch { case 'A' <= rune && rune <= 'Z': return rune case 'a' <= rune && rune <= 'z': return rune - 32 } return -1 }
[ "func", "letterOnlyMapF", "(", "rune", "rune", ")", "rune", "{", "switch", "{", "case", "'A'", "<=", "rune", "&&", "rune", "<=", "'Z'", ":", "return", "rune", "\n", "case", "'a'", "<=", "rune", "&&", "rune", "<=", "'z'", ":", "return", "rune", "-", ...
// letterOnlyMapF is used in conjunction with strings.Map to return // only the characters A-Z and a-z in a string
[ "letterOnlyMapF", "is", "used", "in", "conjunction", "with", "strings", ".", "Map", "to", "return", "only", "the", "characters", "A", "-", "Z", "and", "a", "-", "z", "in", "a", "string" ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/xlsx/lib.go#L146-L154
134,144
henrylee2cn/pholcus
common/xlsx/lib.go
getCellIDStringFromCoords
func getCellIDStringFromCoords(x, y int) string { letterPart := numericToLetters(x) numericPart := y + 1 return fmt.Sprintf("%s%d", letterPart, numericPart) }
go
func getCellIDStringFromCoords(x, y int) string { letterPart := numericToLetters(x) numericPart := y + 1 return fmt.Sprintf("%s%d", letterPart, numericPart) }
[ "func", "getCellIDStringFromCoords", "(", "x", ",", "y", "int", ")", "string", "{", "letterPart", ":=", "numericToLetters", "(", "x", ")", "\n", "numericPart", ":=", "y", "+", "1", "\n", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "letterPart"...
// getCellIDStringFromCoords returns the Excel format cell name that // represents a pair of zero based cartesian coordinates.
[ "getCellIDStringFromCoords", "returns", "the", "Excel", "format", "cell", "name", "that", "represents", "a", "pair", "of", "zero", "based", "cartesian", "coordinates", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/xlsx/lib.go#L181-L185
134,145
henrylee2cn/pholcus
common/xlsx/lib.go
makeRowFromSpan
func makeRowFromSpan(spans string, sheet *Sheet) *Row { var error error var upper int var row *Row var cell *Cell row = new(Row) row.Sheet = sheet _, upper, error = getRangeFromString(spans) if error != nil { panic(error) } error = nil row.Cells = make([]*Cell, upper) for i := 0; i < upper; i++ { cell ...
go
func makeRowFromSpan(spans string, sheet *Sheet) *Row { var error error var upper int var row *Row var cell *Cell row = new(Row) row.Sheet = sheet _, upper, error = getRangeFromString(spans) if error != nil { panic(error) } error = nil row.Cells = make([]*Cell, upper) for i := 0; i < upper; i++ { cell ...
[ "func", "makeRowFromSpan", "(", "spans", "string", ",", "sheet", "*", "Sheet", ")", "*", "Row", "{", "var", "error", "error", "\n", "var", "upper", "int", "\n", "var", "row", "*", "Row", "\n", "var", "cell", "*", "Cell", "\n\n", "row", "=", "new", ...
// makeRowFromSpan will, when given a span expressed as a string, // return an empty Row large enough to encompass that span and // populate it with empty cells. All rows start from cell 1 - // regardless of the lower bound of the span.
[ "makeRowFromSpan", "will", "when", "given", "a", "span", "expressed", "as", "a", "string", "return", "an", "empty", "Row", "large", "enough", "to", "encompass", "that", "span", "and", "populate", "it", "with", "empty", "cells", ".", "All", "rows", "start", ...
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/xlsx/lib.go#L254-L274
134,146
henrylee2cn/pholcus
common/xlsx/lib.go
readWorkbookRelationsFromZipFile
func readWorkbookRelationsFromZipFile(workbookRels *zip.File) (WorkBookRels, error) { var sheetXMLMap WorkBookRels var wbRelationships *xlsxWorkbookRels var rc io.ReadCloser var decoder *xml.Decoder var err error rc, err = workbookRels.Open() if err != nil { return nil, err } decoder = xml.NewDecoder(rc) w...
go
func readWorkbookRelationsFromZipFile(workbookRels *zip.File) (WorkBookRels, error) { var sheetXMLMap WorkBookRels var wbRelationships *xlsxWorkbookRels var rc io.ReadCloser var decoder *xml.Decoder var err error rc, err = workbookRels.Open() if err != nil { return nil, err } decoder = xml.NewDecoder(rc) w...
[ "func", "readWorkbookRelationsFromZipFile", "(", "workbookRels", "*", "zip", ".", "File", ")", "(", "WorkBookRels", ",", "error", ")", "{", "var", "sheetXMLMap", "WorkBookRels", "\n", "var", "wbRelationships", "*", "xlsxWorkbookRels", "\n", "var", "rc", "io", "....
// readWorkbookRelationsFromZipFile is an internal helper function to // extract a map of relationship ID strings to the name of the // worksheet.xml file they refer to. The resulting map can be used to // reliably derefence the worksheets in the XLSX file.
[ "readWorkbookRelationsFromZipFile", "is", "an", "internal", "helper", "function", "to", "extract", "a", "map", "of", "relationship", "ID", "strings", "to", "the", "name", "of", "the", "worksheet", ".", "xml", "file", "they", "refer", "to", ".", "The", "resulti...
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/xlsx/lib.go#L783-L808
134,147
henrylee2cn/pholcus
common/goquery/traversal.go
Find
func (s *Selection) Find(selector string) *Selection { return pushStack(s, findWithMatcher(s.Nodes, compileMatcher(selector))) }
go
func (s *Selection) Find(selector string) *Selection { return pushStack(s, findWithMatcher(s.Nodes, compileMatcher(selector))) }
[ "func", "(", "s", "*", "Selection", ")", "Find", "(", "selector", "string", ")", "*", "Selection", "{", "return", "pushStack", "(", "s", ",", "findWithMatcher", "(", "s", ".", "Nodes", ",", "compileMatcher", "(", "selector", ")", ")", ")", "\n", "}" ]
// Find gets the descendants of each element in the current set of matched // elements, filtered by a selector. It returns a new Selection object // containing these matched elements.
[ "Find", "gets", "the", "descendants", "of", "each", "element", "in", "the", "current", "set", "of", "matched", "elements", "filtered", "by", "a", "selector", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "these", "matched", "elements",...
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L23-L25
134,148
henrylee2cn/pholcus
common/goquery/traversal.go
FindMatcher
func (s *Selection) FindMatcher(m Matcher) *Selection { return pushStack(s, findWithMatcher(s.Nodes, m)) }
go
func (s *Selection) FindMatcher(m Matcher) *Selection { return pushStack(s, findWithMatcher(s.Nodes, m)) }
[ "func", "(", "s", "*", "Selection", ")", "FindMatcher", "(", "m", "Matcher", ")", "*", "Selection", "{", "return", "pushStack", "(", "s", ",", "findWithMatcher", "(", "s", ".", "Nodes", ",", "m", ")", ")", "\n", "}" ]
// FindMatcher gets the descendants of each element in the current set of matched // elements, filtered by the matcher. It returns a new Selection object // containing these matched elements.
[ "FindMatcher", "gets", "the", "descendants", "of", "each", "element", "in", "the", "current", "set", "of", "matched", "elements", "filtered", "by", "the", "matcher", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "these", "matched", "el...
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L30-L32
134,149
henrylee2cn/pholcus
common/goquery/traversal.go
FindSelection
func (s *Selection) FindSelection(sel *Selection) *Selection { if sel == nil { return pushStack(s, nil) } return s.FindNodes(sel.Nodes...) }
go
func (s *Selection) FindSelection(sel *Selection) *Selection { if sel == nil { return pushStack(s, nil) } return s.FindNodes(sel.Nodes...) }
[ "func", "(", "s", "*", "Selection", ")", "FindSelection", "(", "sel", "*", "Selection", ")", "*", "Selection", "{", "if", "sel", "==", "nil", "{", "return", "pushStack", "(", "s", ",", "nil", ")", "\n", "}", "\n", "return", "s", ".", "FindNodes", "...
// FindSelection gets the descendants of each element in the current // Selection, filtered by a Selection. It returns a new Selection object // containing these matched elements.
[ "FindSelection", "gets", "the", "descendants", "of", "each", "element", "in", "the", "current", "Selection", "filtered", "by", "a", "Selection", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "these", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L37-L42
134,150
henrylee2cn/pholcus
common/goquery/traversal.go
FindNodes
func (s *Selection) FindNodes(nodes ...*html.Node) *Selection { return pushStack(s, mapNodes(nodes, func(i int, n *html.Node) []*html.Node { if sliceContains(s.Nodes, n) { return []*html.Node{n} } return nil })) }
go
func (s *Selection) FindNodes(nodes ...*html.Node) *Selection { return pushStack(s, mapNodes(nodes, func(i int, n *html.Node) []*html.Node { if sliceContains(s.Nodes, n) { return []*html.Node{n} } return nil })) }
[ "func", "(", "s", "*", "Selection", ")", "FindNodes", "(", "nodes", "...", "*", "html", ".", "Node", ")", "*", "Selection", "{", "return", "pushStack", "(", "s", ",", "mapNodes", "(", "nodes", ",", "func", "(", "i", "int", ",", "n", "*", "html", ...
// FindNodes gets the descendants of each element in the current // Selection, filtered by some nodes. It returns a new Selection object // containing these matched elements.
[ "FindNodes", "gets", "the", "descendants", "of", "each", "element", "in", "the", "current", "Selection", "filtered", "by", "some", "nodes", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "these", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L47-L54
134,151
henrylee2cn/pholcus
common/goquery/traversal.go
Contents
func (s *Selection) Contents() *Selection { return pushStack(s, getChildrenNodes(s.Nodes, siblingAllIncludingNonElements)) }
go
func (s *Selection) Contents() *Selection { return pushStack(s, getChildrenNodes(s.Nodes, siblingAllIncludingNonElements)) }
[ "func", "(", "s", "*", "Selection", ")", "Contents", "(", ")", "*", "Selection", "{", "return", "pushStack", "(", "s", ",", "getChildrenNodes", "(", "s", ".", "Nodes", ",", "siblingAllIncludingNonElements", ")", ")", "\n", "}" ]
// Contents gets the children of each element in the Selection, // including text and comment nodes. It returns a new Selection object // containing these elements.
[ "Contents", "gets", "the", "children", "of", "each", "element", "in", "the", "Selection", "including", "text", "and", "comment", "nodes", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "these", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L59-L61
134,152
henrylee2cn/pholcus
common/goquery/traversal.go
ContentsFiltered
func (s *Selection) ContentsFiltered(selector string) *Selection { if selector != "" { return s.ChildrenFiltered(selector) } return s.Contents() }
go
func (s *Selection) ContentsFiltered(selector string) *Selection { if selector != "" { return s.ChildrenFiltered(selector) } return s.Contents() }
[ "func", "(", "s", "*", "Selection", ")", "ContentsFiltered", "(", "selector", "string", ")", "*", "Selection", "{", "if", "selector", "!=", "\"", "\"", "{", "return", "s", ".", "ChildrenFiltered", "(", "selector", ")", "\n", "}", "\n", "return", "s", "...
// ContentsFiltered gets the children of each element in the Selection, // filtered by the specified selector. It returns a new Selection // object containing these elements. Since selectors only act on Element nodes, // this function is an alias to ChildrenFiltered unless the selector is empty, // in which case it is ...
[ "ContentsFiltered", "gets", "the", "children", "of", "each", "element", "in", "the", "Selection", "filtered", "by", "the", "specified", "selector", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "these", "elements", ".", "Since", "selecto...
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L68-L73
134,153
henrylee2cn/pholcus
common/goquery/traversal.go
Children
func (s *Selection) Children() *Selection { return pushStack(s, getChildrenNodes(s.Nodes, siblingAll)) }
go
func (s *Selection) Children() *Selection { return pushStack(s, getChildrenNodes(s.Nodes, siblingAll)) }
[ "func", "(", "s", "*", "Selection", ")", "Children", "(", ")", "*", "Selection", "{", "return", "pushStack", "(", "s", ",", "getChildrenNodes", "(", "s", ".", "Nodes", ",", "siblingAll", ")", ")", "\n", "}" ]
// Children gets the child elements of each element in the Selection. // It returns a new Selection object containing these elements.
[ "Children", "gets", "the", "child", "elements", "of", "each", "element", "in", "the", "Selection", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "these", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L85-L87
134,154
henrylee2cn/pholcus
common/goquery/traversal.go
ChildrenFiltered
func (s *Selection) ChildrenFiltered(selector string) *Selection { return filterAndPush(s, getChildrenNodes(s.Nodes, siblingAll), compileMatcher(selector)) }
go
func (s *Selection) ChildrenFiltered(selector string) *Selection { return filterAndPush(s, getChildrenNodes(s.Nodes, siblingAll), compileMatcher(selector)) }
[ "func", "(", "s", "*", "Selection", ")", "ChildrenFiltered", "(", "selector", "string", ")", "*", "Selection", "{", "return", "filterAndPush", "(", "s", ",", "getChildrenNodes", "(", "s", ".", "Nodes", ",", "siblingAll", ")", ",", "compileMatcher", "(", "s...
// ChildrenFiltered gets the child elements of each element in the Selection, // filtered by the specified selector. It returns a new // Selection object containing these elements.
[ "ChildrenFiltered", "gets", "the", "child", "elements", "of", "each", "element", "in", "the", "Selection", "filtered", "by", "the", "specified", "selector", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "these", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L92-L94
134,155
henrylee2cn/pholcus
common/goquery/traversal.go
ChildrenMatcher
func (s *Selection) ChildrenMatcher(m Matcher) *Selection { return filterAndPush(s, getChildrenNodes(s.Nodes, siblingAll), m) }
go
func (s *Selection) ChildrenMatcher(m Matcher) *Selection { return filterAndPush(s, getChildrenNodes(s.Nodes, siblingAll), m) }
[ "func", "(", "s", "*", "Selection", ")", "ChildrenMatcher", "(", "m", "Matcher", ")", "*", "Selection", "{", "return", "filterAndPush", "(", "s", ",", "getChildrenNodes", "(", "s", ".", "Nodes", ",", "siblingAll", ")", ",", "m", ")", "\n", "}" ]
// ChildrenMatcher gets the child elements of each element in the Selection, // filtered by the specified matcher. It returns a new // Selection object containing these elements.
[ "ChildrenMatcher", "gets", "the", "child", "elements", "of", "each", "element", "in", "the", "Selection", "filtered", "by", "the", "specified", "matcher", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "these", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L99-L101
134,156
henrylee2cn/pholcus
common/goquery/traversal.go
ParentFiltered
func (s *Selection) ParentFiltered(selector string) *Selection { return filterAndPush(s, getParentNodes(s.Nodes), compileMatcher(selector)) }
go
func (s *Selection) ParentFiltered(selector string) *Selection { return filterAndPush(s, getParentNodes(s.Nodes), compileMatcher(selector)) }
[ "func", "(", "s", "*", "Selection", ")", "ParentFiltered", "(", "selector", "string", ")", "*", "Selection", "{", "return", "filterAndPush", "(", "s", ",", "getParentNodes", "(", "s", ".", "Nodes", ")", ",", "compileMatcher", "(", "selector", ")", ")", "...
// ParentFiltered gets the parent of each element in the Selection filtered by a // selector. It returns a new Selection object containing the matched elements.
[ "ParentFiltered", "gets", "the", "parent", "of", "each", "element", "in", "the", "Selection", "filtered", "by", "a", "selector", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L111-L113
134,157
henrylee2cn/pholcus
common/goquery/traversal.go
ParentMatcher
func (s *Selection) ParentMatcher(m Matcher) *Selection { return filterAndPush(s, getParentNodes(s.Nodes), m) }
go
func (s *Selection) ParentMatcher(m Matcher) *Selection { return filterAndPush(s, getParentNodes(s.Nodes), m) }
[ "func", "(", "s", "*", "Selection", ")", "ParentMatcher", "(", "m", "Matcher", ")", "*", "Selection", "{", "return", "filterAndPush", "(", "s", ",", "getParentNodes", "(", "s", ".", "Nodes", ")", ",", "m", ")", "\n", "}" ]
// ParentMatcher gets the parent of each element in the Selection filtered by a // matcher. It returns a new Selection object containing the matched elements.
[ "ParentMatcher", "gets", "the", "parent", "of", "each", "element", "in", "the", "Selection", "filtered", "by", "a", "matcher", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L117-L119
134,158
henrylee2cn/pholcus
common/goquery/traversal.go
Closest
func (s *Selection) Closest(selector string) *Selection { cs := compileMatcher(selector) return s.ClosestMatcher(cs) }
go
func (s *Selection) Closest(selector string) *Selection { cs := compileMatcher(selector) return s.ClosestMatcher(cs) }
[ "func", "(", "s", "*", "Selection", ")", "Closest", "(", "selector", "string", ")", "*", "Selection", "{", "cs", ":=", "compileMatcher", "(", "selector", ")", "\n", "return", "s", ".", "ClosestMatcher", "(", "cs", ")", "\n", "}" ]
// Closest gets the first element that matches the selector by testing the // element itself and traversing up through its ancestors in the DOM tree.
[ "Closest", "gets", "the", "first", "element", "that", "matches", "the", "selector", "by", "testing", "the", "element", "itself", "and", "traversing", "up", "through", "its", "ancestors", "in", "the", "DOM", "tree", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L123-L126
134,159
henrylee2cn/pholcus
common/goquery/traversal.go
ClosestMatcher
func (s *Selection) ClosestMatcher(m Matcher) *Selection { return pushStack(s, mapNodes(s.Nodes, func(i int, n *html.Node) []*html.Node { // For each node in the selection, test the node itself, then each parent // until a match is found. for ; n != nil; n = n.Parent { if m.Match(n) { return []*html.Node{...
go
func (s *Selection) ClosestMatcher(m Matcher) *Selection { return pushStack(s, mapNodes(s.Nodes, func(i int, n *html.Node) []*html.Node { // For each node in the selection, test the node itself, then each parent // until a match is found. for ; n != nil; n = n.Parent { if m.Match(n) { return []*html.Node{...
[ "func", "(", "s", "*", "Selection", ")", "ClosestMatcher", "(", "m", "Matcher", ")", "*", "Selection", "{", "return", "pushStack", "(", "s", ",", "mapNodes", "(", "s", ".", "Nodes", ",", "func", "(", "i", "int", ",", "n", "*", "html", ".", "Node", ...
// ClosestMatcher gets the first element that matches the matcher by testing the // element itself and traversing up through its ancestors in the DOM tree.
[ "ClosestMatcher", "gets", "the", "first", "element", "that", "matches", "the", "matcher", "by", "testing", "the", "element", "itself", "and", "traversing", "up", "through", "its", "ancestors", "in", "the", "DOM", "tree", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L130-L141
134,160
henrylee2cn/pholcus
common/goquery/traversal.go
ClosestNodes
func (s *Selection) ClosestNodes(nodes ...*html.Node) *Selection { set := make(map[*html.Node]bool) for _, n := range nodes { set[n] = true } return pushStack(s, mapNodes(s.Nodes, func(i int, n *html.Node) []*html.Node { // For each node in the selection, test the node itself, then each parent // until a matc...
go
func (s *Selection) ClosestNodes(nodes ...*html.Node) *Selection { set := make(map[*html.Node]bool) for _, n := range nodes { set[n] = true } return pushStack(s, mapNodes(s.Nodes, func(i int, n *html.Node) []*html.Node { // For each node in the selection, test the node itself, then each parent // until a matc...
[ "func", "(", "s", "*", "Selection", ")", "ClosestNodes", "(", "nodes", "...", "*", "html", ".", "Node", ")", "*", "Selection", "{", "set", ":=", "make", "(", "map", "[", "*", "html", ".", "Node", "]", "bool", ")", "\n", "for", "_", ",", "n", ":...
// ClosestNodes gets the first element that matches one of the nodes by testing the // element itself and traversing up through its ancestors in the DOM tree.
[ "ClosestNodes", "gets", "the", "first", "element", "that", "matches", "one", "of", "the", "nodes", "by", "testing", "the", "element", "itself", "and", "traversing", "up", "through", "its", "ancestors", "in", "the", "DOM", "tree", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L145-L160
134,161
henrylee2cn/pholcus
common/goquery/traversal.go
ClosestSelection
func (s *Selection) ClosestSelection(sel *Selection) *Selection { if sel == nil { return pushStack(s, nil) } return s.ClosestNodes(sel.Nodes...) }
go
func (s *Selection) ClosestSelection(sel *Selection) *Selection { if sel == nil { return pushStack(s, nil) } return s.ClosestNodes(sel.Nodes...) }
[ "func", "(", "s", "*", "Selection", ")", "ClosestSelection", "(", "sel", "*", "Selection", ")", "*", "Selection", "{", "if", "sel", "==", "nil", "{", "return", "pushStack", "(", "s", ",", "nil", ")", "\n", "}", "\n", "return", "s", ".", "ClosestNodes...
// ClosestSelection gets the first element that matches one of the nodes in the // Selection by testing the element itself and traversing up through its ancestors // in the DOM tree.
[ "ClosestSelection", "gets", "the", "first", "element", "that", "matches", "one", "of", "the", "nodes", "in", "the", "Selection", "by", "testing", "the", "element", "itself", "and", "traversing", "up", "through", "its", "ancestors", "in", "the", "DOM", "tree", ...
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L165-L170
134,162
henrylee2cn/pholcus
common/goquery/traversal.go
Parents
func (s *Selection) Parents() *Selection { return pushStack(s, getParentsNodes(s.Nodes, nil, nil)) }
go
func (s *Selection) Parents() *Selection { return pushStack(s, getParentsNodes(s.Nodes, nil, nil)) }
[ "func", "(", "s", "*", "Selection", ")", "Parents", "(", ")", "*", "Selection", "{", "return", "pushStack", "(", "s", ",", "getParentsNodes", "(", "s", ".", "Nodes", ",", "nil", ",", "nil", ")", ")", "\n", "}" ]
// Parents gets the ancestors of each element in the current Selection. It // returns a new Selection object with the matched elements.
[ "Parents", "gets", "the", "ancestors", "of", "each", "element", "in", "the", "current", "Selection", ".", "It", "returns", "a", "new", "Selection", "object", "with", "the", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L174-L176
134,163
henrylee2cn/pholcus
common/goquery/traversal.go
ParentsFiltered
func (s *Selection) ParentsFiltered(selector string) *Selection { return filterAndPush(s, getParentsNodes(s.Nodes, nil, nil), compileMatcher(selector)) }
go
func (s *Selection) ParentsFiltered(selector string) *Selection { return filterAndPush(s, getParentsNodes(s.Nodes, nil, nil), compileMatcher(selector)) }
[ "func", "(", "s", "*", "Selection", ")", "ParentsFiltered", "(", "selector", "string", ")", "*", "Selection", "{", "return", "filterAndPush", "(", "s", ",", "getParentsNodes", "(", "s", ".", "Nodes", ",", "nil", ",", "nil", ")", ",", "compileMatcher", "(...
// ParentsFiltered gets the ancestors of each element in the current // Selection. It returns a new Selection object with the matched elements.
[ "ParentsFiltered", "gets", "the", "ancestors", "of", "each", "element", "in", "the", "current", "Selection", ".", "It", "returns", "a", "new", "Selection", "object", "with", "the", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L180-L182
134,164
henrylee2cn/pholcus
common/goquery/traversal.go
ParentsMatcher
func (s *Selection) ParentsMatcher(m Matcher) *Selection { return filterAndPush(s, getParentsNodes(s.Nodes, nil, nil), m) }
go
func (s *Selection) ParentsMatcher(m Matcher) *Selection { return filterAndPush(s, getParentsNodes(s.Nodes, nil, nil), m) }
[ "func", "(", "s", "*", "Selection", ")", "ParentsMatcher", "(", "m", "Matcher", ")", "*", "Selection", "{", "return", "filterAndPush", "(", "s", ",", "getParentsNodes", "(", "s", ".", "Nodes", ",", "nil", ",", "nil", ")", ",", "m", ")", "\n", "}" ]
// ParentsMatcher gets the ancestors of each element in the current // Selection. It returns a new Selection object with the matched elements.
[ "ParentsMatcher", "gets", "the", "ancestors", "of", "each", "element", "in", "the", "current", "Selection", ".", "It", "returns", "a", "new", "Selection", "object", "with", "the", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L186-L188
134,165
henrylee2cn/pholcus
common/goquery/traversal.go
ParentsUntil
func (s *Selection) ParentsUntil(selector string) *Selection { return pushStack(s, getParentsNodes(s.Nodes, compileMatcher(selector), nil)) }
go
func (s *Selection) ParentsUntil(selector string) *Selection { return pushStack(s, getParentsNodes(s.Nodes, compileMatcher(selector), nil)) }
[ "func", "(", "s", "*", "Selection", ")", "ParentsUntil", "(", "selector", "string", ")", "*", "Selection", "{", "return", "pushStack", "(", "s", ",", "getParentsNodes", "(", "s", ".", "Nodes", ",", "compileMatcher", "(", "selector", ")", ",", "nil", ")",...
// ParentsUntil gets the ancestors of each element in the Selection, up to but // not including the element matched by the selector. It returns a new Selection // object containing the matched elements.
[ "ParentsUntil", "gets", "the", "ancestors", "of", "each", "element", "in", "the", "Selection", "up", "to", "but", "not", "including", "the", "element", "matched", "by", "the", "selector", ".", "It", "returns", "a", "new", "Selection", "object", "containing", ...
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L193-L195
134,166
henrylee2cn/pholcus
common/goquery/traversal.go
ParentsUntilMatcher
func (s *Selection) ParentsUntilMatcher(m Matcher) *Selection { return pushStack(s, getParentsNodes(s.Nodes, m, nil)) }
go
func (s *Selection) ParentsUntilMatcher(m Matcher) *Selection { return pushStack(s, getParentsNodes(s.Nodes, m, nil)) }
[ "func", "(", "s", "*", "Selection", ")", "ParentsUntilMatcher", "(", "m", "Matcher", ")", "*", "Selection", "{", "return", "pushStack", "(", "s", ",", "getParentsNodes", "(", "s", ".", "Nodes", ",", "m", ",", "nil", ")", ")", "\n", "}" ]
// ParentsUntilMatcher gets the ancestors of each element in the Selection, up to but // not including the element matched by the matcher. It returns a new Selection // object containing the matched elements.
[ "ParentsUntilMatcher", "gets", "the", "ancestors", "of", "each", "element", "in", "the", "Selection", "up", "to", "but", "not", "including", "the", "element", "matched", "by", "the", "matcher", ".", "It", "returns", "a", "new", "Selection", "object", "containi...
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L200-L202
134,167
henrylee2cn/pholcus
common/goquery/traversal.go
ParentsUntilSelection
func (s *Selection) ParentsUntilSelection(sel *Selection) *Selection { if sel == nil { return s.Parents() } return s.ParentsUntilNodes(sel.Nodes...) }
go
func (s *Selection) ParentsUntilSelection(sel *Selection) *Selection { if sel == nil { return s.Parents() } return s.ParentsUntilNodes(sel.Nodes...) }
[ "func", "(", "s", "*", "Selection", ")", "ParentsUntilSelection", "(", "sel", "*", "Selection", ")", "*", "Selection", "{", "if", "sel", "==", "nil", "{", "return", "s", ".", "Parents", "(", ")", "\n", "}", "\n", "return", "s", ".", "ParentsUntilNodes"...
// ParentsUntilSelection gets the ancestors of each element in the Selection, // up to but not including the elements in the specified Selection. It returns a // new Selection object containing the matched elements.
[ "ParentsUntilSelection", "gets", "the", "ancestors", "of", "each", "element", "in", "the", "Selection", "up", "to", "but", "not", "including", "the", "elements", "in", "the", "specified", "Selection", ".", "It", "returns", "a", "new", "Selection", "object", "c...
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L207-L212
134,168
henrylee2cn/pholcus
common/goquery/traversal.go
ParentsUntilNodes
func (s *Selection) ParentsUntilNodes(nodes ...*html.Node) *Selection { return pushStack(s, getParentsNodes(s.Nodes, nil, nodes)) }
go
func (s *Selection) ParentsUntilNodes(nodes ...*html.Node) *Selection { return pushStack(s, getParentsNodes(s.Nodes, nil, nodes)) }
[ "func", "(", "s", "*", "Selection", ")", "ParentsUntilNodes", "(", "nodes", "...", "*", "html", ".", "Node", ")", "*", "Selection", "{", "return", "pushStack", "(", "s", ",", "getParentsNodes", "(", "s", ".", "Nodes", ",", "nil", ",", "nodes", ")", "...
// ParentsUntilNodes gets the ancestors of each element in the Selection, // up to but not including the specified nodes. It returns a // new Selection object containing the matched elements.
[ "ParentsUntilNodes", "gets", "the", "ancestors", "of", "each", "element", "in", "the", "Selection", "up", "to", "but", "not", "including", "the", "specified", "nodes", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", "el...
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L217-L219
134,169
henrylee2cn/pholcus
common/goquery/traversal.go
ParentsFilteredUntil
func (s *Selection) ParentsFilteredUntil(filterSelector, untilSelector string) *Selection { return filterAndPush(s, getParentsNodes(s.Nodes, compileMatcher(untilSelector), nil), compileMatcher(filterSelector)) }
go
func (s *Selection) ParentsFilteredUntil(filterSelector, untilSelector string) *Selection { return filterAndPush(s, getParentsNodes(s.Nodes, compileMatcher(untilSelector), nil), compileMatcher(filterSelector)) }
[ "func", "(", "s", "*", "Selection", ")", "ParentsFilteredUntil", "(", "filterSelector", ",", "untilSelector", "string", ")", "*", "Selection", "{", "return", "filterAndPush", "(", "s", ",", "getParentsNodes", "(", "s", ".", "Nodes", ",", "compileMatcher", "(",...
// ParentsFilteredUntil is like ParentsUntil, with the option to filter the // results based on a selector string. It returns a new Selection // object containing the matched elements.
[ "ParentsFilteredUntil", "is", "like", "ParentsUntil", "with", "the", "option", "to", "filter", "the", "results", "based", "on", "a", "selector", "string", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L224-L226
134,170
henrylee2cn/pholcus
common/goquery/traversal.go
ParentsFilteredUntilMatcher
func (s *Selection) ParentsFilteredUntilMatcher(filter, until Matcher) *Selection { return filterAndPush(s, getParentsNodes(s.Nodes, until, nil), filter) }
go
func (s *Selection) ParentsFilteredUntilMatcher(filter, until Matcher) *Selection { return filterAndPush(s, getParentsNodes(s.Nodes, until, nil), filter) }
[ "func", "(", "s", "*", "Selection", ")", "ParentsFilteredUntilMatcher", "(", "filter", ",", "until", "Matcher", ")", "*", "Selection", "{", "return", "filterAndPush", "(", "s", ",", "getParentsNodes", "(", "s", ".", "Nodes", ",", "until", ",", "nil", ")", ...
// ParentsFilteredUntilMatcher is like ParentsUntilMatcher, with the option to filter the // results based on a matcher. It returns a new Selection object containing the matched elements.
[ "ParentsFilteredUntilMatcher", "is", "like", "ParentsUntilMatcher", "with", "the", "option", "to", "filter", "the", "results", "based", "on", "a", "matcher", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L230-L232
134,171
henrylee2cn/pholcus
common/goquery/traversal.go
ParentsFilteredUntilSelection
func (s *Selection) ParentsFilteredUntilSelection(filterSelector string, sel *Selection) *Selection { return s.ParentsMatcherUntilSelection(compileMatcher(filterSelector), sel) }
go
func (s *Selection) ParentsFilteredUntilSelection(filterSelector string, sel *Selection) *Selection { return s.ParentsMatcherUntilSelection(compileMatcher(filterSelector), sel) }
[ "func", "(", "s", "*", "Selection", ")", "ParentsFilteredUntilSelection", "(", "filterSelector", "string", ",", "sel", "*", "Selection", ")", "*", "Selection", "{", "return", "s", ".", "ParentsMatcherUntilSelection", "(", "compileMatcher", "(", "filterSelector", "...
// ParentsFilteredUntilSelection is like ParentsUntilSelection, with the // option to filter the results based on a selector string. It returns a new // Selection object containing the matched elements.
[ "ParentsFilteredUntilSelection", "is", "like", "ParentsUntilSelection", "with", "the", "option", "to", "filter", "the", "results", "based", "on", "a", "selector", "string", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", "e...
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L237-L239
134,172
henrylee2cn/pholcus
common/goquery/traversal.go
ParentsMatcherUntilSelection
func (s *Selection) ParentsMatcherUntilSelection(filter Matcher, sel *Selection) *Selection { if sel == nil { return s.ParentsMatcher(filter) } return s.ParentsMatcherUntilNodes(filter, sel.Nodes...) }
go
func (s *Selection) ParentsMatcherUntilSelection(filter Matcher, sel *Selection) *Selection { if sel == nil { return s.ParentsMatcher(filter) } return s.ParentsMatcherUntilNodes(filter, sel.Nodes...) }
[ "func", "(", "s", "*", "Selection", ")", "ParentsMatcherUntilSelection", "(", "filter", "Matcher", ",", "sel", "*", "Selection", ")", "*", "Selection", "{", "if", "sel", "==", "nil", "{", "return", "s", ".", "ParentsMatcher", "(", "filter", ")", "\n", "}...
// ParentsMatcherUntilSelection is like ParentsUntilSelection, with the // option to filter the results based on a matcher. It returns a new // Selection object containing the matched elements.
[ "ParentsMatcherUntilSelection", "is", "like", "ParentsUntilSelection", "with", "the", "option", "to", "filter", "the", "results", "based", "on", "a", "matcher", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", "elements", "....
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L244-L249
134,173
henrylee2cn/pholcus
common/goquery/traversal.go
ParentsFilteredUntilNodes
func (s *Selection) ParentsFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection { return filterAndPush(s, getParentsNodes(s.Nodes, nil, nodes), compileMatcher(filterSelector)) }
go
func (s *Selection) ParentsFilteredUntilNodes(filterSelector string, nodes ...*html.Node) *Selection { return filterAndPush(s, getParentsNodes(s.Nodes, nil, nodes), compileMatcher(filterSelector)) }
[ "func", "(", "s", "*", "Selection", ")", "ParentsFilteredUntilNodes", "(", "filterSelector", "string", ",", "nodes", "...", "*", "html", ".", "Node", ")", "*", "Selection", "{", "return", "filterAndPush", "(", "s", ",", "getParentsNodes", "(", "s", ".", "N...
// ParentsFilteredUntilNodes is like ParentsUntilNodes, with the // option to filter the results based on a selector string. It returns a new // Selection object containing the matched elements.
[ "ParentsFilteredUntilNodes", "is", "like", "ParentsUntilNodes", "with", "the", "option", "to", "filter", "the", "results", "based", "on", "a", "selector", "string", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", "elements"...
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L254-L256
134,174
henrylee2cn/pholcus
common/goquery/traversal.go
ParentsMatcherUntilNodes
func (s *Selection) ParentsMatcherUntilNodes(filter Matcher, nodes ...*html.Node) *Selection { return filterAndPush(s, getParentsNodes(s.Nodes, nil, nodes), filter) }
go
func (s *Selection) ParentsMatcherUntilNodes(filter Matcher, nodes ...*html.Node) *Selection { return filterAndPush(s, getParentsNodes(s.Nodes, nil, nodes), filter) }
[ "func", "(", "s", "*", "Selection", ")", "ParentsMatcherUntilNodes", "(", "filter", "Matcher", ",", "nodes", "...", "*", "html", ".", "Node", ")", "*", "Selection", "{", "return", "filterAndPush", "(", "s", ",", "getParentsNodes", "(", "s", ".", "Nodes", ...
// ParentsMatcherUntilNodes is like ParentsUntilNodes, with the // option to filter the results based on a matcher. It returns a new // Selection object containing the matched elements.
[ "ParentsMatcherUntilNodes", "is", "like", "ParentsUntilNodes", "with", "the", "option", "to", "filter", "the", "results", "based", "on", "a", "matcher", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L261-L263
134,175
henrylee2cn/pholcus
common/goquery/traversal.go
Siblings
func (s *Selection) Siblings() *Selection { return pushStack(s, getSiblingNodes(s.Nodes, siblingAll, nil, nil)) }
go
func (s *Selection) Siblings() *Selection { return pushStack(s, getSiblingNodes(s.Nodes, siblingAll, nil, nil)) }
[ "func", "(", "s", "*", "Selection", ")", "Siblings", "(", ")", "*", "Selection", "{", "return", "pushStack", "(", "s", ",", "getSiblingNodes", "(", "s", ".", "Nodes", ",", "siblingAll", ",", "nil", ",", "nil", ")", ")", "\n", "}" ]
// Siblings gets the siblings of each element in the Selection. It returns // a new Selection object containing the matched elements.
[ "Siblings", "gets", "the", "siblings", "of", "each", "element", "in", "the", "Selection", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L267-L269
134,176
henrylee2cn/pholcus
common/goquery/traversal.go
SiblingsFiltered
func (s *Selection) SiblingsFiltered(selector string) *Selection { return filterAndPush(s, getSiblingNodes(s.Nodes, siblingAll, nil, nil), compileMatcher(selector)) }
go
func (s *Selection) SiblingsFiltered(selector string) *Selection { return filterAndPush(s, getSiblingNodes(s.Nodes, siblingAll, nil, nil), compileMatcher(selector)) }
[ "func", "(", "s", "*", "Selection", ")", "SiblingsFiltered", "(", "selector", "string", ")", "*", "Selection", "{", "return", "filterAndPush", "(", "s", ",", "getSiblingNodes", "(", "s", ".", "Nodes", ",", "siblingAll", ",", "nil", ",", "nil", ")", ",", ...
// SiblingsFiltered gets the siblings of each element in the Selection // filtered by a selector. It returns a new Selection object containing the // matched elements.
[ "SiblingsFiltered", "gets", "the", "siblings", "of", "each", "element", "in", "the", "Selection", "filtered", "by", "a", "selector", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L274-L276
134,177
henrylee2cn/pholcus
common/goquery/traversal.go
SiblingsMatcher
func (s *Selection) SiblingsMatcher(m Matcher) *Selection { return filterAndPush(s, getSiblingNodes(s.Nodes, siblingAll, nil, nil), m) }
go
func (s *Selection) SiblingsMatcher(m Matcher) *Selection { return filterAndPush(s, getSiblingNodes(s.Nodes, siblingAll, nil, nil), m) }
[ "func", "(", "s", "*", "Selection", ")", "SiblingsMatcher", "(", "m", "Matcher", ")", "*", "Selection", "{", "return", "filterAndPush", "(", "s", ",", "getSiblingNodes", "(", "s", ".", "Nodes", ",", "siblingAll", ",", "nil", ",", "nil", ")", ",", "m", ...
// SiblingsMatcher gets the siblings of each element in the Selection // filtered by a matcher. It returns a new Selection object containing the // matched elements.
[ "SiblingsMatcher", "gets", "the", "siblings", "of", "each", "element", "in", "the", "Selection", "filtered", "by", "a", "matcher", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L281-L283
134,178
henrylee2cn/pholcus
common/goquery/traversal.go
Next
func (s *Selection) Next() *Selection { return pushStack(s, getSiblingNodes(s.Nodes, siblingNext, nil, nil)) }
go
func (s *Selection) Next() *Selection { return pushStack(s, getSiblingNodes(s.Nodes, siblingNext, nil, nil)) }
[ "func", "(", "s", "*", "Selection", ")", "Next", "(", ")", "*", "Selection", "{", "return", "pushStack", "(", "s", ",", "getSiblingNodes", "(", "s", ".", "Nodes", ",", "siblingNext", ",", "nil", ",", "nil", ")", ")", "\n", "}" ]
// Next gets the immediately following sibling of each element in the // Selection. It returns a new Selection object containing the matched elements.
[ "Next", "gets", "the", "immediately", "following", "sibling", "of", "each", "element", "in", "the", "Selection", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L287-L289
134,179
henrylee2cn/pholcus
common/goquery/traversal.go
NextFiltered
func (s *Selection) NextFiltered(selector string) *Selection { return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNext, nil, nil), compileMatcher(selector)) }
go
func (s *Selection) NextFiltered(selector string) *Selection { return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNext, nil, nil), compileMatcher(selector)) }
[ "func", "(", "s", "*", "Selection", ")", "NextFiltered", "(", "selector", "string", ")", "*", "Selection", "{", "return", "filterAndPush", "(", "s", ",", "getSiblingNodes", "(", "s", ".", "Nodes", ",", "siblingNext", ",", "nil", ",", "nil", ")", ",", "...
// NextFiltered gets the immediately following sibling of each element in the // Selection filtered by a selector. It returns a new Selection object // containing the matched elements.
[ "NextFiltered", "gets", "the", "immediately", "following", "sibling", "of", "each", "element", "in", "the", "Selection", "filtered", "by", "a", "selector", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L294-L296
134,180
henrylee2cn/pholcus
common/goquery/traversal.go
NextMatcher
func (s *Selection) NextMatcher(m Matcher) *Selection { return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNext, nil, nil), m) }
go
func (s *Selection) NextMatcher(m Matcher) *Selection { return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNext, nil, nil), m) }
[ "func", "(", "s", "*", "Selection", ")", "NextMatcher", "(", "m", "Matcher", ")", "*", "Selection", "{", "return", "filterAndPush", "(", "s", ",", "getSiblingNodes", "(", "s", ".", "Nodes", ",", "siblingNext", ",", "nil", ",", "nil", ")", ",", "m", "...
// NextMatcher gets the immediately following sibling of each element in the // Selection filtered by a matcher. It returns a new Selection object // containing the matched elements.
[ "NextMatcher", "gets", "the", "immediately", "following", "sibling", "of", "each", "element", "in", "the", "Selection", "filtered", "by", "a", "matcher", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L301-L303
134,181
henrylee2cn/pholcus
common/goquery/traversal.go
NextAll
func (s *Selection) NextAll() *Selection { return pushStack(s, getSiblingNodes(s.Nodes, siblingNextAll, nil, nil)) }
go
func (s *Selection) NextAll() *Selection { return pushStack(s, getSiblingNodes(s.Nodes, siblingNextAll, nil, nil)) }
[ "func", "(", "s", "*", "Selection", ")", "NextAll", "(", ")", "*", "Selection", "{", "return", "pushStack", "(", "s", ",", "getSiblingNodes", "(", "s", ".", "Nodes", ",", "siblingNextAll", ",", "nil", ",", "nil", ")", ")", "\n", "}" ]
// NextAll gets all the following siblings of each element in the // Selection. It returns a new Selection object containing the matched elements.
[ "NextAll", "gets", "all", "the", "following", "siblings", "of", "each", "element", "in", "the", "Selection", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L307-L309
134,182
henrylee2cn/pholcus
common/goquery/traversal.go
NextAllFiltered
func (s *Selection) NextAllFiltered(selector string) *Selection { return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextAll, nil, nil), compileMatcher(selector)) }
go
func (s *Selection) NextAllFiltered(selector string) *Selection { return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextAll, nil, nil), compileMatcher(selector)) }
[ "func", "(", "s", "*", "Selection", ")", "NextAllFiltered", "(", "selector", "string", ")", "*", "Selection", "{", "return", "filterAndPush", "(", "s", ",", "getSiblingNodes", "(", "s", ".", "Nodes", ",", "siblingNextAll", ",", "nil", ",", "nil", ")", ",...
// NextAllFiltered gets all the following siblings of each element in the // Selection filtered by a selector. It returns a new Selection object // containing the matched elements.
[ "NextAllFiltered", "gets", "all", "the", "following", "siblings", "of", "each", "element", "in", "the", "Selection", "filtered", "by", "a", "selector", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L314-L316
134,183
henrylee2cn/pholcus
common/goquery/traversal.go
NextAllMatcher
func (s *Selection) NextAllMatcher(m Matcher) *Selection { return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextAll, nil, nil), m) }
go
func (s *Selection) NextAllMatcher(m Matcher) *Selection { return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextAll, nil, nil), m) }
[ "func", "(", "s", "*", "Selection", ")", "NextAllMatcher", "(", "m", "Matcher", ")", "*", "Selection", "{", "return", "filterAndPush", "(", "s", ",", "getSiblingNodes", "(", "s", ".", "Nodes", ",", "siblingNextAll", ",", "nil", ",", "nil", ")", ",", "m...
// NextAllMatcher gets all the following siblings of each element in the // Selection filtered by a matcher. It returns a new Selection object // containing the matched elements.
[ "NextAllMatcher", "gets", "all", "the", "following", "siblings", "of", "each", "element", "in", "the", "Selection", "filtered", "by", "a", "matcher", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L321-L323
134,184
henrylee2cn/pholcus
common/goquery/traversal.go
Prev
func (s *Selection) Prev() *Selection { return pushStack(s, getSiblingNodes(s.Nodes, siblingPrev, nil, nil)) }
go
func (s *Selection) Prev() *Selection { return pushStack(s, getSiblingNodes(s.Nodes, siblingPrev, nil, nil)) }
[ "func", "(", "s", "*", "Selection", ")", "Prev", "(", ")", "*", "Selection", "{", "return", "pushStack", "(", "s", ",", "getSiblingNodes", "(", "s", ".", "Nodes", ",", "siblingPrev", ",", "nil", ",", "nil", ")", ")", "\n", "}" ]
// Prev gets the immediately preceding sibling of each element in the // Selection. It returns a new Selection object containing the matched elements.
[ "Prev", "gets", "the", "immediately", "preceding", "sibling", "of", "each", "element", "in", "the", "Selection", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L327-L329
134,185
henrylee2cn/pholcus
common/goquery/traversal.go
PrevFiltered
func (s *Selection) PrevFiltered(selector string) *Selection { return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrev, nil, nil), compileMatcher(selector)) }
go
func (s *Selection) PrevFiltered(selector string) *Selection { return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrev, nil, nil), compileMatcher(selector)) }
[ "func", "(", "s", "*", "Selection", ")", "PrevFiltered", "(", "selector", "string", ")", "*", "Selection", "{", "return", "filterAndPush", "(", "s", ",", "getSiblingNodes", "(", "s", ".", "Nodes", ",", "siblingPrev", ",", "nil", ",", "nil", ")", ",", "...
// PrevFiltered gets the immediately preceding sibling of each element in the // Selection filtered by a selector. It returns a new Selection object // containing the matched elements.
[ "PrevFiltered", "gets", "the", "immediately", "preceding", "sibling", "of", "each", "element", "in", "the", "Selection", "filtered", "by", "a", "selector", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L334-L336
134,186
henrylee2cn/pholcus
common/goquery/traversal.go
PrevMatcher
func (s *Selection) PrevMatcher(m Matcher) *Selection { return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrev, nil, nil), m) }
go
func (s *Selection) PrevMatcher(m Matcher) *Selection { return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrev, nil, nil), m) }
[ "func", "(", "s", "*", "Selection", ")", "PrevMatcher", "(", "m", "Matcher", ")", "*", "Selection", "{", "return", "filterAndPush", "(", "s", ",", "getSiblingNodes", "(", "s", ".", "Nodes", ",", "siblingPrev", ",", "nil", ",", "nil", ")", ",", "m", "...
// PrevMatcher gets the immediately preceding sibling of each element in the // Selection filtered by a matcher. It returns a new Selection object // containing the matched elements.
[ "PrevMatcher", "gets", "the", "immediately", "preceding", "sibling", "of", "each", "element", "in", "the", "Selection", "filtered", "by", "a", "matcher", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L341-L343
134,187
henrylee2cn/pholcus
common/goquery/traversal.go
PrevAll
func (s *Selection) PrevAll() *Selection { return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevAll, nil, nil)) }
go
func (s *Selection) PrevAll() *Selection { return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevAll, nil, nil)) }
[ "func", "(", "s", "*", "Selection", ")", "PrevAll", "(", ")", "*", "Selection", "{", "return", "pushStack", "(", "s", ",", "getSiblingNodes", "(", "s", ".", "Nodes", ",", "siblingPrevAll", ",", "nil", ",", "nil", ")", ")", "\n", "}" ]
// PrevAll gets all the preceding siblings of each element in the // Selection. It returns a new Selection object containing the matched elements.
[ "PrevAll", "gets", "all", "the", "preceding", "siblings", "of", "each", "element", "in", "the", "Selection", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L347-L349
134,188
henrylee2cn/pholcus
common/goquery/traversal.go
PrevAllFiltered
func (s *Selection) PrevAllFiltered(selector string) *Selection { return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevAll, nil, nil), compileMatcher(selector)) }
go
func (s *Selection) PrevAllFiltered(selector string) *Selection { return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevAll, nil, nil), compileMatcher(selector)) }
[ "func", "(", "s", "*", "Selection", ")", "PrevAllFiltered", "(", "selector", "string", ")", "*", "Selection", "{", "return", "filterAndPush", "(", "s", ",", "getSiblingNodes", "(", "s", ".", "Nodes", ",", "siblingPrevAll", ",", "nil", ",", "nil", ")", ",...
// PrevAllFiltered gets all the preceding siblings of each element in the // Selection filtered by a selector. It returns a new Selection object // containing the matched elements.
[ "PrevAllFiltered", "gets", "all", "the", "preceding", "siblings", "of", "each", "element", "in", "the", "Selection", "filtered", "by", "a", "selector", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L354-L356
134,189
henrylee2cn/pholcus
common/goquery/traversal.go
PrevAllMatcher
func (s *Selection) PrevAllMatcher(m Matcher) *Selection { return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevAll, nil, nil), m) }
go
func (s *Selection) PrevAllMatcher(m Matcher) *Selection { return filterAndPush(s, getSiblingNodes(s.Nodes, siblingPrevAll, nil, nil), m) }
[ "func", "(", "s", "*", "Selection", ")", "PrevAllMatcher", "(", "m", "Matcher", ")", "*", "Selection", "{", "return", "filterAndPush", "(", "s", ",", "getSiblingNodes", "(", "s", ".", "Nodes", ",", "siblingPrevAll", ",", "nil", ",", "nil", ")", ",", "m...
// PrevAllMatcher gets all the preceding siblings of each element in the // Selection filtered by a matcher. It returns a new Selection object // containing the matched elements.
[ "PrevAllMatcher", "gets", "all", "the", "preceding", "siblings", "of", "each", "element", "in", "the", "Selection", "filtered", "by", "a", "matcher", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L361-L363
134,190
henrylee2cn/pholcus
common/goquery/traversal.go
NextUntil
func (s *Selection) NextUntil(selector string) *Selection { return pushStack(s, getSiblingNodes(s.Nodes, siblingNextUntil, compileMatcher(selector), nil)) }
go
func (s *Selection) NextUntil(selector string) *Selection { return pushStack(s, getSiblingNodes(s.Nodes, siblingNextUntil, compileMatcher(selector), nil)) }
[ "func", "(", "s", "*", "Selection", ")", "NextUntil", "(", "selector", "string", ")", "*", "Selection", "{", "return", "pushStack", "(", "s", ",", "getSiblingNodes", "(", "s", ".", "Nodes", ",", "siblingNextUntil", ",", "compileMatcher", "(", "selector", "...
// NextUntil gets all following siblings of each element up to but not // including the element matched by the selector. It returns a new Selection // object containing the matched elements.
[ "NextUntil", "gets", "all", "following", "siblings", "of", "each", "element", "up", "to", "but", "not", "including", "the", "element", "matched", "by", "the", "selector", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", ...
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L368-L371
134,191
henrylee2cn/pholcus
common/goquery/traversal.go
NextUntilMatcher
func (s *Selection) NextUntilMatcher(m Matcher) *Selection { return pushStack(s, getSiblingNodes(s.Nodes, siblingNextUntil, m, nil)) }
go
func (s *Selection) NextUntilMatcher(m Matcher) *Selection { return pushStack(s, getSiblingNodes(s.Nodes, siblingNextUntil, m, nil)) }
[ "func", "(", "s", "*", "Selection", ")", "NextUntilMatcher", "(", "m", "Matcher", ")", "*", "Selection", "{", "return", "pushStack", "(", "s", ",", "getSiblingNodes", "(", "s", ".", "Nodes", ",", "siblingNextUntil", ",", "m", ",", "nil", ")", ")", "\n"...
// NextUntilMatcher gets all following siblings of each element up to but not // including the element matched by the matcher. It returns a new Selection // object containing the matched elements.
[ "NextUntilMatcher", "gets", "all", "following", "siblings", "of", "each", "element", "up", "to", "but", "not", "including", "the", "element", "matched", "by", "the", "matcher", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matc...
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L376-L379
134,192
henrylee2cn/pholcus
common/goquery/traversal.go
NextUntilSelection
func (s *Selection) NextUntilSelection(sel *Selection) *Selection { if sel == nil { return s.NextAll() } return s.NextUntilNodes(sel.Nodes...) }
go
func (s *Selection) NextUntilSelection(sel *Selection) *Selection { if sel == nil { return s.NextAll() } return s.NextUntilNodes(sel.Nodes...) }
[ "func", "(", "s", "*", "Selection", ")", "NextUntilSelection", "(", "sel", "*", "Selection", ")", "*", "Selection", "{", "if", "sel", "==", "nil", "{", "return", "s", ".", "NextAll", "(", ")", "\n", "}", "\n", "return", "s", ".", "NextUntilNodes", "(...
// NextUntilSelection gets all following siblings of each element up to but not // including the element matched by the Selection. It returns a new Selection // object containing the matched elements.
[ "NextUntilSelection", "gets", "all", "following", "siblings", "of", "each", "element", "up", "to", "but", "not", "including", "the", "element", "matched", "by", "the", "Selection", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "...
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L384-L389
134,193
henrylee2cn/pholcus
common/goquery/traversal.go
NextUntilNodes
func (s *Selection) NextUntilNodes(nodes ...*html.Node) *Selection { return pushStack(s, getSiblingNodes(s.Nodes, siblingNextUntil, nil, nodes)) }
go
func (s *Selection) NextUntilNodes(nodes ...*html.Node) *Selection { return pushStack(s, getSiblingNodes(s.Nodes, siblingNextUntil, nil, nodes)) }
[ "func", "(", "s", "*", "Selection", ")", "NextUntilNodes", "(", "nodes", "...", "*", "html", ".", "Node", ")", "*", "Selection", "{", "return", "pushStack", "(", "s", ",", "getSiblingNodes", "(", "s", ".", "Nodes", ",", "siblingNextUntil", ",", "nil", ...
// NextUntilNodes gets all following siblings of each element up to but not // including the element matched by the nodes. It returns a new Selection // object containing the matched elements.
[ "NextUntilNodes", "gets", "all", "following", "siblings", "of", "each", "element", "up", "to", "but", "not", "including", "the", "element", "matched", "by", "the", "nodes", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched"...
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L394-L397
134,194
henrylee2cn/pholcus
common/goquery/traversal.go
PrevUntil
func (s *Selection) PrevUntil(selector string) *Selection { return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevUntil, compileMatcher(selector), nil)) }
go
func (s *Selection) PrevUntil(selector string) *Selection { return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevUntil, compileMatcher(selector), nil)) }
[ "func", "(", "s", "*", "Selection", ")", "PrevUntil", "(", "selector", "string", ")", "*", "Selection", "{", "return", "pushStack", "(", "s", ",", "getSiblingNodes", "(", "s", ".", "Nodes", ",", "siblingPrevUntil", ",", "compileMatcher", "(", "selector", "...
// PrevUntil gets all preceding siblings of each element up to but not // including the element matched by the selector. It returns a new Selection // object containing the matched elements.
[ "PrevUntil", "gets", "all", "preceding", "siblings", "of", "each", "element", "up", "to", "but", "not", "including", "the", "element", "matched", "by", "the", "selector", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", ...
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L402-L405
134,195
henrylee2cn/pholcus
common/goquery/traversal.go
PrevUntilMatcher
func (s *Selection) PrevUntilMatcher(m Matcher) *Selection { return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevUntil, m, nil)) }
go
func (s *Selection) PrevUntilMatcher(m Matcher) *Selection { return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevUntil, m, nil)) }
[ "func", "(", "s", "*", "Selection", ")", "PrevUntilMatcher", "(", "m", "Matcher", ")", "*", "Selection", "{", "return", "pushStack", "(", "s", ",", "getSiblingNodes", "(", "s", ".", "Nodes", ",", "siblingPrevUntil", ",", "m", ",", "nil", ")", ")", "\n"...
// PrevUntilMatcher gets all preceding siblings of each element up to but not // including the element matched by the matcher. It returns a new Selection // object containing the matched elements.
[ "PrevUntilMatcher", "gets", "all", "preceding", "siblings", "of", "each", "element", "up", "to", "but", "not", "including", "the", "element", "matched", "by", "the", "matcher", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matc...
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L410-L413
134,196
henrylee2cn/pholcus
common/goquery/traversal.go
PrevUntilSelection
func (s *Selection) PrevUntilSelection(sel *Selection) *Selection { if sel == nil { return s.PrevAll() } return s.PrevUntilNodes(sel.Nodes...) }
go
func (s *Selection) PrevUntilSelection(sel *Selection) *Selection { if sel == nil { return s.PrevAll() } return s.PrevUntilNodes(sel.Nodes...) }
[ "func", "(", "s", "*", "Selection", ")", "PrevUntilSelection", "(", "sel", "*", "Selection", ")", "*", "Selection", "{", "if", "sel", "==", "nil", "{", "return", "s", ".", "PrevAll", "(", ")", "\n", "}", "\n", "return", "s", ".", "PrevUntilNodes", "(...
// PrevUntilSelection gets all preceding siblings of each element up to but not // including the element matched by the Selection. It returns a new Selection // object containing the matched elements.
[ "PrevUntilSelection", "gets", "all", "preceding", "siblings", "of", "each", "element", "up", "to", "but", "not", "including", "the", "element", "matched", "by", "the", "Selection", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "...
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L418-L423
134,197
henrylee2cn/pholcus
common/goquery/traversal.go
PrevUntilNodes
func (s *Selection) PrevUntilNodes(nodes ...*html.Node) *Selection { return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevUntil, nil, nodes)) }
go
func (s *Selection) PrevUntilNodes(nodes ...*html.Node) *Selection { return pushStack(s, getSiblingNodes(s.Nodes, siblingPrevUntil, nil, nodes)) }
[ "func", "(", "s", "*", "Selection", ")", "PrevUntilNodes", "(", "nodes", "...", "*", "html", ".", "Node", ")", "*", "Selection", "{", "return", "pushStack", "(", "s", ",", "getSiblingNodes", "(", "s", ".", "Nodes", ",", "siblingPrevUntil", ",", "nil", ...
// PrevUntilNodes gets all preceding siblings of each element up to but not // including the element matched by the nodes. It returns a new Selection // object containing the matched elements.
[ "PrevUntilNodes", "gets", "all", "preceding", "siblings", "of", "each", "element", "up", "to", "but", "not", "including", "the", "element", "matched", "by", "the", "nodes", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched"...
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L428-L431
134,198
henrylee2cn/pholcus
common/goquery/traversal.go
NextFilteredUntil
func (s *Selection) NextFilteredUntil(filterSelector, untilSelector string) *Selection { return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextUntil, compileMatcher(untilSelector), nil), compileMatcher(filterSelector)) }
go
func (s *Selection) NextFilteredUntil(filterSelector, untilSelector string) *Selection { return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextUntil, compileMatcher(untilSelector), nil), compileMatcher(filterSelector)) }
[ "func", "(", "s", "*", "Selection", ")", "NextFilteredUntil", "(", "filterSelector", ",", "untilSelector", "string", ")", "*", "Selection", "{", "return", "filterAndPush", "(", "s", ",", "getSiblingNodes", "(", "s", ".", "Nodes", ",", "siblingNextUntil", ",", ...
// NextFilteredUntil is like NextUntil, with the option to filter // the results based on a selector string. // It returns a new Selection object containing the matched elements.
[ "NextFilteredUntil", "is", "like", "NextUntil", "with", "the", "option", "to", "filter", "the", "results", "based", "on", "a", "selector", "string", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L436-L439
134,199
henrylee2cn/pholcus
common/goquery/traversal.go
NextFilteredUntilMatcher
func (s *Selection) NextFilteredUntilMatcher(filter, until Matcher) *Selection { return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextUntil, until, nil), filter) }
go
func (s *Selection) NextFilteredUntilMatcher(filter, until Matcher) *Selection { return filterAndPush(s, getSiblingNodes(s.Nodes, siblingNextUntil, until, nil), filter) }
[ "func", "(", "s", "*", "Selection", ")", "NextFilteredUntilMatcher", "(", "filter", ",", "until", "Matcher", ")", "*", "Selection", "{", "return", "filterAndPush", "(", "s", ",", "getSiblingNodes", "(", "s", ".", "Nodes", ",", "siblingNextUntil", ",", "until...
// NextFilteredUntilMatcher is like NextUntilMatcher, with the option to filter // the results based on a matcher. // It returns a new Selection object containing the matched elements.
[ "NextFilteredUntilMatcher", "is", "like", "NextUntilMatcher", "with", "the", "option", "to", "filter", "the", "results", "based", "on", "a", "matcher", ".", "It", "returns", "a", "new", "Selection", "object", "containing", "the", "matched", "elements", "." ]
5e73d3ff534090b22e8dde1950abe5d0fce5f746
https://github.com/henrylee2cn/pholcus/blob/5e73d3ff534090b22e8dde1950abe5d0fce5f746/common/goquery/traversal.go#L444-L447