aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2022-06-17 22:01:21 +1000
committerTerry Truong <terry06890@gmail.com>2022-06-17 22:01:21 +1000
commitb77f9028cc7c65a31b19d46f6aa123f8d4eaa40f (patch)
treea73dcdff4a7d761fc39b9457db8ed0052e7a01df /backend
parent71ba62c24e99935c0ba81dd6a07eef5746a86575 (diff)
Avoid alt-names with many words
Without this, taxa like 'Amphibia' may get preferred-names like 'frogs, salamanders, and caecilians'
Diffstat (limited to 'backend')
-rwxr-xr-xbackend/data/genEolNameData.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/backend/data/genEolNameData.py b/backend/data/genEolNameData.py
index cd3247d..aa3905e 100755
--- a/backend/data/genEolNameData.py
+++ b/backend/data/genEolNameData.py
@@ -104,6 +104,8 @@ def addToDb(nodeName, pidToUse):
preferredName = pidToPreferred[pidToUse] if (pidToUse in pidToPreferred) else None
dbCur.execute("INSERT INTO eol_ids VALUES (?, ?)", (pidToUse, nodeName))
for n in pidToNames[pidToUse]:
+ if len(n.split(" ")) > 3:
+ continue
if dbCur.execute("SELECT name FROM nodes WHERE name = ?", (n,)).fetchone() != None:
continue
if nodeName in nameToBadAlts and n in nameToBadAlts[nodeName]: