Enabled fuzzy matching by default.
This commit is contained in:
parent
8ffeabed8b
commit
f0284bb8a6
1 changed files with 4 additions and 3 deletions
|
@ -17,6 +17,7 @@ import re
|
|||
import os
|
||||
from . import config
|
||||
from collections import defaultdict
|
||||
from fuzzywuzzy import fuzz
|
||||
from operator import attrgetter
|
||||
|
||||
RE_WIKILINKS = re.compile('\[\[(.*?)\]\]')
|
||||
|
@ -146,10 +147,10 @@ def nodes_by_wikilink(wikilink):
|
|||
nodes = [node for node in all_nodes() if node.wikilink == wikilink]
|
||||
return nodes
|
||||
|
||||
def subnodes_by_wikilink(wikilink, fuzzy=True):
|
||||
if fuzzy:
|
||||
def subnodes_by_wikilink(wikilink, fuzzy_matching=True):
|
||||
if fuzzy_matching:
|
||||
# TODO
|
||||
subnodes = [subnode for subnode in all_subnodes() if subnode.wikilink == wikilink]
|
||||
subnodes = [subnode for subnode in all_subnodes() if fuzz.ratio(subnode.wikilink, wikilink) > 90]
|
||||
else:
|
||||
subnodes = [subnode for subnode in all_subnodes() if subnode.wikilink == wikilink]
|
||||
return subnodes
|
||||
|
|
Loading…
Reference in a new issue