// NewMapping returns a column mapping
NewMapping returns a column mapping
// NewMapping returns a column mapping
func NewMapping(rules []*Rule) (*Mapping, error) {
	m := &Mapping{
		Selector: selector.NewTrieSelector(),
	}
	m.resetCache()
	for _, rule := range rules {
		if err := m.AddRule(rule); err != nil {
			return nil, errors.Annotatef(err, "initial rule %+v in mapping", rule)
		}
	}
	return m, nil
}
func NewMapping ( rules [ ] * Rule ) ( * Mapping , error ) { m := & Mapping { Selector : selector . NewTrieSelector ( ) , } m . resetCache ( ) for _ , rule := range rules { if err := m . AddRule ( rule ) ; err != nil { return nil , errors . Annotatef ( err , " " , rule ) } } return m , nil }
NewMapping returns a column mapping
NewMapping returns a column mapping