mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-16 22:27:14 +00:00
Improve README
Make new style QMs from survexfiles work
This commit is contained in:
@@ -14,6 +14,7 @@ import csv
|
||||
import re
|
||||
import datetime
|
||||
import os
|
||||
from fuzzywuzzy import fuzz
|
||||
|
||||
from utils import save_carefully
|
||||
|
||||
@@ -42,6 +43,15 @@ def GetTripPersons(trippeople, expedition, logtime_underground):
|
||||
print(" - No name match for: '%s'" % tripperson)
|
||||
message = "No name match for: '%s' in year '%s'" % (tripperson, expedition.year)
|
||||
models.DataIssue.objects.create(parser='logbooks', message=message)
|
||||
print(' - Lets try something fuzzy')
|
||||
fuzzy_matches = {}
|
||||
for person in GetPersonExpeditionNameLookup(expedition):
|
||||
fuzz_num = fuzz.ratio(tripperson.lower(), person)
|
||||
if fuzz_num > 50:
|
||||
#print(" - %s -> %s = %d" % (tripperson.lower(), person, fuzz_num))
|
||||
fuzzy_matches[person] = fuzz_num
|
||||
for i in sorted(fuzzy_matches.items(), key = lambda kv:(kv[1]), reverse=True):
|
||||
print(' - %s -> %s' % (i[0], i[1]))
|
||||
res.append((personyear, logtime_underground))
|
||||
if mul:
|
||||
author = personyear
|
||||
|
||||
Reference in New Issue
Block a user