code: func CosineSimilarity(a, b []string) float64 {
  	countsA := make([]float64, 0)
  	countsB := make([]float64, 0)
  	uniques := make(map[string]int)
  
  	// index the strings first
  	for _, st := range a {
  		s := strings.ToLower(st)
  		id, ok := uniques[s]
  		if !ok {
  			uniques[s] = len(countsA)
  			countsA = append(countsA, 1)
  			countsB = append(countsB, 0) // create for countsB, but don't add
  		} else {
  			countsA[id]++
  		}
  	}
  
  	for _, st := range b {
  		s := strings.ToLower(st)
  		id, ok := uniques[s]
  		if !ok {
  			uniques[s] = len(countsA)
  			countsA = append(countsA, 0)
  			countsB = append(countsB, 1)
  		} else {
  			countsB[id]++
  		}
  	}
  
  	magA, err := mag(countsA)
  	if err != nil {
  		panic(err)
  	}
  
  	magB, err := mag(countsB)
  	if err != nil {
  		panic(err)
  	}
  
  	dotProd, err := dot(countsA, countsB)
  	if err != nil {
  		panic(err)
  	}
  
  	return dotProd / (magA * magB)
  
  }
docs: // CosineSimilarity measures the cosine similarity of two strings.