<commit_before>/*
	Package h5 implements an html5 parser for the go language.

    import "h5"
 	p := h5.NewParser(rdr)
    err := p.Parse()
    tree := p.Tree()
 */
package h5

import (
	"bufio"
	"fmt"
	"os"
	"io"
	"strings"
)

// Represents an html5 parsing error. holds a message and the current html5 node
// when the error occured.
type ParseError struct {
	msg string
	node *Node
}

// Constructor for an html5 parsing error
func NewParseError(n *Node, msg string, args... interface{}) *ParseError {
	return &ParseError{node:n, msg:fmt.Sprintf(msg, args...)}
}

// Represent the parse error as a string
func (e ParseError) String() string {
	return e.msg
}

// The html5 insertion mode for parsing
type InsertionMode int<commit_msg>Fleshed out package documentation a little more.<commit_after>/*
	Package h5 implements an html5 parser for the go language.

 	p := h5.NewParser(rdr)
    err := p.Parse()
    tree := p.Tree()

    ...
    tree.Walk(func(n *Node) {
       // do something with the node
    })

   tree2 := tree.Clone()
 */
package h5

import (
	"bufio"
	"fmt"
	"os"
	"io"
	"strings"
)

// Represents an html5 parsing error. holds a message and the current html5 node
// when the error occured.
type ParseError struct {
	msg string
	node *Node
}

// Constructor for an html5 parsing error
func NewParseError(n *Node, msg string, args... interface{}) *ParseError {
	return &ParseError{node:n, msg:fmt.Sprintf(msg, args...)}
}

// Represent the parse error as a string
func (e ParseError) String() string {
	return e.msg
}

// The html5 insertion mode for parsing
type InsertionMode int
{'fraction_non_alphanumeric': 0.11658354114713217, 'fraction_numerical': 0.011221945137157107, 'mean_word_length': 3.2572944297082227, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5019956', 'n_tokens_mistral': 540, 'n_tokens_neox': 526, 'n_words': 196}