From 3bdf73ccad90781af5ca75c8f7b311a95f073cb1 Mon Sep 17 00:00:00 2001
From: Philip Sargent
Date: Sun, 2 Mar 2025 00:37:28 +0000
Subject: improving cave identification in logbooks
---
parsers/logbooks.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
(limited to 'parsers/logbooks.py')
diff --git a/parsers/logbooks.py b/parsers/logbooks.py
index ae6c75f..be9fccc 100644
--- a/parsers/logbooks.py
+++ b/parsers/logbooks.py
@@ -453,9 +453,13 @@ def parser_html(year, expedition, txt, seq=""):
tid = reset_trip_id(ldate)
triptitles = triptitle.split(" - ")
if len(triptitles) >= 2:
- place = triptitles[0]
+ place = triptitles[0].split()[0]
else:
- place = "Unknown"
+ p = triptitle.split()
+ if len(p) >= 2:
+ place = p[0]
+ else:
+ place = triptitle
# tripcontent = re.sub(r"
", "", triptext)
# tripcontent = re.sub(r"", "
", tripcontent).strip()
tripcontent = triptext.strip()
--
cgit v1.2.3