code: func NewAttributeSourceWith(factory AttributeFactory) *AttributeSource {
  	// Note that Lucene Java use LinkedHashMap to keep insert order.
  	// But it's used by Solr only and GoLucene doesn't have plan to
  	// port GoSolr. So we use plain map here.
  	return &AttributeSource{
  		attributes:     make(map[string]AttributeImpl),
  		attributeImpls: make(map[reflect.Type]AttributeImpl),
  		_currentState:  make([]*AttributeState, 1),
  		factory:        factory,
  	}
  }
docs: /* An AttributeSource using the supplied AttributeFactory for creating new Attribute instance. */