package
Version:
v0.0.0-...-a989888
Opens a new window with list of versions in this module.
Published: Nov 28, 2023
License: MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package decoder implements a high performance decoder for wiki pages.
It uses xml.Decoder.RawToken to speed up parsing and Page.UnmarshalXML
to reduce allocation.
Decoder is an XML decoder tailored to the Wikipedia dataset.
New instanciates a new Decoder.
It fail if it cannot find the mediawiki and siteinfo elements from the dataset.
Err returns any error encountered by Next.
Next moves to the next element.
Scan scans an element.
Beware, UnmarshalXML must be implemented by calling RawToken.
type Page struct {
ID int64 `xml:"-"`
UpdatedAt time.Time `xml:"revision>timestamp"`
Title string `xml:"title"`
Text string `xml:"revision>text"`
}
Page represents a page from Wikipedia.
UnmarshalXML unmarshals an XML element into the page.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.