You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: by_specificity.go
    path of file: ./repos/syft/syft/cpe
    
    the code of the file until where you have to start completion: package cpe

import (
	"sort"
)

var _ sort.Interface = (*BySpecificity)(nil)

type BySpecificity []Attributes

func (c BySpecificity) Len() int { return len(c) }

func (c BySpecificity) Swap(i, j int) { c[i], c[j] = c
    
func isMoreSpecific(i, j Attributes) bool {
	iScore := weightedCountForSpecifiedFields(i)
	jScore := weightedCountForSpecifiedFields(j)

	// check weighted sort first
	if iScore != jScore {
		return iScore > jScore
	}

	// sort longer fields to top
	if countFieldLength(i) != countFieldLength(j) {
		return countFieldLength(i) > countFieldLength(j)
	}

	// if score and length are equal then text sort
	// note that we are not using String from the syft pkg
	// as we are not encoding/decoding this Attributes string so we don't
	// need the proper quoted version of the Attributes.
	return i.BindToFmtString() < j.BindToFmtString()
}