|
|
|
@ -12,19 +12,15 @@ import ( |
|
|
|
_ "github.com/mattn/go-sqlite3" |
|
|
|
_ "github.com/mattn/go-sqlite3" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
var symbols = []string{ |
|
|
|
|
|
|
|
".", ",", "!", ";", "?", "(", ")", "'", "\"", |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func main() { |
|
|
|
func main() { |
|
|
|
// Define a command-line flag for the filename
|
|
|
|
// Define a command-line flags
|
|
|
|
|
|
|
|
dbPtr := flag.String("db", "./english_words.db", "SQLite3 DB file to use") |
|
|
|
filenamePtr := flag.String("file", "results.txt", "Name of the file to write results to") |
|
|
|
filenamePtr := flag.String("file", "results.txt", "Name of the file to write results to") |
|
|
|
pwdPtr := flag.String("pwd", "", "Enter a password") |
|
|
|
pwdPtr := flag.String("pwd", "", "Enter a password") |
|
|
|
flag.Parse()
|
|
|
|
flag.Parse()
|
|
|
|
|
|
|
|
|
|
|
|
// Open the SQLite3 database file
|
|
|
|
// Open the SQLite3 database file
|
|
|
|
db, err := sql.Open("sqlite3", "./english_words.db") |
|
|
|
db, err := sql.Open("sqlite3", *dbPtr) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
log.Fatal(err) |
|
|
|
log.Fatal(err) |
|
|
|
} |
|
|
|
} |
|
|
|
|