func NewEngine(joiner string, defaultTemplate *Template, templates []string) (*Engine, error) {
	engine := Engine{
		joiner:  joiner,
		matcher: newMatcher(defaultTemplate),
	}
	templateSpecs := parseTemplateSpecs(templates)
	for _, templateSpec := range templateSpecs {
		if err := engine.matcher.addSpec(templateSpec); err != nil {
			return nil, err
		}
	}
	return &engine, nil
}
NewEngine creates a new templating engine
package templating
import (
	"sort"
	"strings"
)
const (
	DefaultSeparator = "."
)
type Engine struct {
	joiner  string
	matcher *matcher
}
func (e *Engine) Apply(line string) (string, map[string]string, string, error) {
	return e.matcher.match(line).Apply(line, e.joiner)
}