mirror of
https://github.com/evennia/evennia.git
synced 2026-03-30 12:37:16 +02:00
OBS: run migrations! This changes the Msg model to work with ManyToManyFields rather than with custom string representations for storing multiple receivers or channels. It also expands the Msg object with a "title" field and various filter options. This should make it easier to implement mail-like operations using the comms system.
This commit is contained in:
parent
7995c91eee
commit
dcc7f29a91
8 changed files with 656 additions and 381 deletions
|
|
@ -724,7 +724,5 @@ def string_suggestions(string, vocabulary, cutoff=0.6, maxnum=3):
|
|||
Returns:
|
||||
list of suggestions from vocabulary (could be empty if there are no matches)
|
||||
"""
|
||||
#if string in vocabulary:
|
||||
# return [string]
|
||||
return [tup[1] for tup in sorted([(string_similarity(string, sugg), sugg) for sugg in vocabulary],
|
||||
key=lambda tup: tup[0], reverse=True) if tup[0] >= cutoff][:maxnum]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue