Correction3
This commit is contained in:
parent
fd61dcbeeb
commit
768f743462
@ -39,8 +39,8 @@ class UseSource():
|
|||||||
|
|
||||||
def stripped(self, input_string) -> str:
|
def stripped(self, input_string) -> str:
|
||||||
unitext = unidecode(input_string)
|
unitext = unidecode(input_string)
|
||||||
unitext = re.sub(r'[^a-zA-Z0-9\s]', '', unitext)
|
unitext = re.sub(r'[^a-zA-Z0-9\s]', ' ', unitext)
|
||||||
unitext = re.sub(r'\s{2,}', '', unitext)
|
unitext = re.sub(r'\s{2,}', ' ', unitext)
|
||||||
return unitext
|
return unitext
|
||||||
|
|
||||||
def __perform_search(self, title)-> List[WeightedData]:
|
def __perform_search(self, title)-> List[WeightedData]:
|
||||||
@ -97,14 +97,14 @@ class UseSource():
|
|||||||
bt = baseNameScoreResult[0]
|
bt = baseNameScoreResult[0]
|
||||||
if (bt is not None and ht is not None):
|
if (bt is not None and ht is not None):
|
||||||
if (bt.score >= ht.score):
|
if (bt.score >= ht.score):
|
||||||
selected = NamedDataResult(self.baseName, bt)
|
selected = NamedDataResult(self.baseName, bt.result)
|
||||||
else:
|
else:
|
||||||
selected = NamedDataResult(self.title, ht)
|
selected = NamedDataResult(self.title, ht.result)
|
||||||
else:
|
else:
|
||||||
if len(titleScoreResult) > 0:
|
if len(titleScoreResult) > 0:
|
||||||
selected = NamedDataResult(self.title, titleScoreResult[0])
|
selected = NamedDataResult(self.title, titleScoreResult[0].result)
|
||||||
elif len(baseNameScoreResult) > 0:
|
elif len(baseNameScoreResult) > 0:
|
||||||
selected = NamedDataResult(self.baseName, baseNameScoreResult[0])
|
selected = NamedDataResult(self.baseName, baseNameScoreResult[0].result)
|
||||||
else:
|
else:
|
||||||
selected = None
|
selected = None
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user