feat: Initialized Project
Build / test-and-build (scribblers-linux-x64, ubuntu-latest) (push) Has been cancelled
Build / test-and-build (scribblers-macos-x64, macos-latest) (push) Has been cancelled
Build / test-and-build (scribblers-x64.exe, windows-latest) (push) Has been cancelled

This commit is contained in:
2026-05-09 09:36:38 +03:30
commit ff300a5e84
121 changed files with 46171 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
# Sanitizer
This tool lowercases, deduplicates, sorts and cleans the word lists.
First argument is expected to be the wordlist and second argument the language shortcut, for example `en` for english.
Don't pipe into the same file that you are reading from ;)
+62
View File
@@ -0,0 +1,62 @@
package main
import (
"bufio"
"fmt"
"io"
"os"
"sort"
"strings"
"golang.org/x/text/cases"
"golang.org/x/text/language"
)
func main() {
languageFile, err := os.Open(os.Args[len(os.Args)-2])
if err != nil {
panic(err)
}
lowercaser := cases.Lower(language.Make(os.Args[len(os.Args)-1]))
reader := bufio.NewReader(languageFile)
var words []string
for {
line, _, err := reader.ReadLine()
if err != nil {
if err == io.EOF {
break
}
panic(err)
}
lineAsString := string(line)
// Remove previously edited difficulty indicators, we don't really need it anymore.
difficultyIndicatorIndex := strings.IndexRune(lineAsString, '#')
if difficultyIndicatorIndex != -1 {
lineAsString = lineAsString[:difficultyIndicatorIndex]
}
// Lowercase and trim, to make sure we can compare them without errors
words = append(words, strings.TrimSpace(lowercaser.String(lineAsString)))
}
var filteredWords []string
WORDS:
for _, word := range words {
for _, filteredWord := range filteredWords {
if filteredWord == word {
continue WORDS
}
}
filteredWords = append(filteredWords, word)
}
// Filter for niceness
sort.Strings(filteredWords)
for _, word := range filteredWords {
fmt.Println(word)
}
}