summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaximilian Möhring2021-01-21 19:59:02 +0100
committerMaximilian Möhring2021-01-21 19:59:02 +0100
commit8ddc20450040543d8ec2f854943272c94565685e (patch)
tree4ec7000f7c333d102b0b7771b4d8079fa38752f5
parentd1699faff96bf5f9778113a426735646c8c08f4e (diff)
downloadalkobote-8ddc20450040543d8ec2f854943272c94565685e.tar.gz
Detects Rye/Bourbon as Whisky.
-rw-r--r--crawler/utility.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/crawler/utility.go b/crawler/utility.go
index b7ae958..5b91c51 100644
--- a/crawler/utility.go
+++ b/crawler/utility.go
@@ -57,6 +57,13 @@ func detect_spirit_type(name string) string {
if matched {
return "Whisky"
}
+ matched, err = regexp.MatchString(`(^|\s)(bourbon|rye)(\s|$)`, name)
+ if err != nil {
+ Fatal(err, "Bourbon|Rye regex failed")
+ }
+ if matched {
+ return "Whisky"
+ }
matched, err = regexp.MatchString(`(^|\s)weine?(\s|$)`, name)
if err != nil {
Fatal(err, "Wein regex failed")