Skip to content

Commit

Permalink
refactor: Similarity strips any http/https/www. before comparing
Browse files Browse the repository at this point in the history
  • Loading branch information
caffeine-addictt committed Apr 14, 2024
1 parent 22b8cce commit 5d1b8a4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ var getCommand = &cobra.Command{
}

for nonURL, curr := range nonURLSet {
similar := int8(utils.SimilarityScore(nonURL, scanner.Text()))
stripProtocol := regexp.MustCompile(`^(https?://)?(www\.)?`)
similar := int8(utils.SimilarityScore(nonURL, stripProtocol.ReplaceAllString(scanner.Text(), "")))
if similar == 0 {
continue
}
Expand Down

0 comments on commit 5d1b8a4

Please sign in to comment.