Thu 1 Aug 15:42:49 CEST 2024

This commit is contained in:
Thomas Avé 2024-08-01 15:42:49 +02:00
parent c21c237959
commit 3e6e578a54
2 changed files with 9 additions and 312627 deletions

13
data.go
View File

@ -32,14 +32,19 @@ func computeScore(term string, s string) float64 {
term_splits := strings.Split(term, "/")
score := 1.0 / float64(len(splits))
for _, term := range term_splits {
for i, c := range splits {
used := make([]bool, len(term_splits))
for i, term := range term_splits {
if used[i] {
continue
}
for j, c := range splits {
if len(term) == 0 {
continue
}
if strings.Contains(c, term) {
score += 1.0/float64(i)
splits = splits[i:]
used[i] = true
score += 1.0/float64(j)
splits = splits[j+1:]
break
}
}

312623
out

File diff suppressed because it is too large Load Diff