When trying to get the data of such a string 'hello 𝙎𝙈𝙈 world' using token_set_ratio(), no problems arise, but there is an error when calling process.extract().
If you remove the incomprehensible characters "SMM" from the line, then there is no error
Example:
strtest = 'hello 𝙎𝙈𝙈 world'
stroka = "word"
print(str(fuzz.token_set_ratio(stroka, strtest))) # OK
for message in process.extract(stroka, [strtest, 'sss'], limit=1): # ERROR
pass
Error:
Traceback (most recent call last):
File "C:\Users\Alexey\AppData\Local\Programs\Python\Python39\lib\site-packages\fuzzywuzzy\process.py", line 108, in extractWithoutOrder
for key, choice in choices.items():
AttributeError: 'list' object has no attribute 'items'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Alexey\Documents\fuzzywuzzy\index.py", line 191, in <module>
for message in process.extract(stroka, [strtest, 'sss'], limit=1): # ERROR
File "C:\Users\Alexey\AppData\Local\Programs\Python\Python39\lib\site-packages\fuzzywuzzy\process.py", line 168, in extract
return heapq.nlargest(limit, sl, key=lambda i: i[1]) if limit is not None else \
File "C:\Users\Alexey\AppData\Local\Programs\Python\Python39\lib\heapq.py", line 531, in nlargest
result = max(it, default=sentinel, key=key)
File "C:\Users\Alexey\AppData\Local\Programs\Python\Python39\lib\site-packages\fuzzywuzzy\process.py", line 117, in extractWithoutOrder
score = scorer(processed_query, processed)
File "C:\Users\Alexey\AppData\Local\Programs\Python\Python39\lib\site-packages\fuzzywuzzy\fuzz.py", line 288, in WRatio
partial = partial_ratio(p1, p2) * partial_scale
File "C:\Users\Alexey\AppData\Local\Programs\Python\Python39\lib\site-packages\fuzzywuzzy\utils.py", line 38, in decorator
return func(*args, **kwargs)
File "C:\Users\Alexey\AppData\Local\Programs\Python\Python39\lib\site-packages\fuzzywuzzy\utils.py", line 29, in decorator
return func(*args, **kwargs)
File "C:\Users\Alexey\AppData\Local\Programs\Python\Python39\lib\site-packages\fuzzywuzzy\utils.py", line 47, in decorator
return func(*args, **kwargs)
File "C:\Users\Alexey\AppData\Local\Programs\Python\Python39\lib\site-packages\fuzzywuzzy\fuzz.py", line 47, in partial_ratio
blocks = m.get_matching_blocks()
File "C:\Users\Alexey\AppData\Local\Programs\Python\Python39\lib\site-packages\fuzzywuzzy\StringMatcher.py", line 58, in get_matching_blocks
self._matching_blocks = matching_blocks(self.get_opcodes(),
ValueError: apply_edit edit operations are invalid or inapplicable
When trying to get the data of such a string 'hello 𝙎𝙈𝙈 world' using
token_set_ratio()
, no problems arise, but there is an error when callingprocess.extract()
.If you remove the incomprehensible characters "SMM" from the line, then there is no error
Example:
Error: