python - FuzzyWuzzy partial_ratio 字符串匹配
问题描述
我有一个需要对照 main-string 检查的子字符串,我使用了 FuzzyMatch Partial Ratio 算法,但不知何故,分数似乎不合适
子字符串:
Aspire 1 14
主弦:
Acer Aspire 1 14 Inch Celeron 4GB 64GB Cloudbook - Red This sleek HD Acer Aspire 1 delivers an inviting tactile finish, featuring 4GB of RAM and an Intel Celeron Processor complete daily tasks and surf the internet seamlessly. Whilst 64GB of storage gives you enough space to easily store and share your important media and documents. #||#The classy look of the Aspire 1 is matched only by the convenience of its thin, easily portable design. #||#The Precision Touch-pad is more responsive than traditional touch-pads helping you work more effectively. #||#Model number: A114-32. #||#General features:#||#Size H1.79, W34.3, D24.5cm. #||#Weight 1.65kg. #||#Up to 10 hours battery life. #||#CPU, Memory and Operating System:#||#Intel Celeron N4000 processor. #||#Dual core processor. #||#1.1GHz processor speed with a burst speed of 2.6GHz. #||#4GB RAM DDR4. #||#64GB eMMC storage. #||#Microsoft Windows 10 S. #||#Display features:#||#14 inch screen. #||#High definition display. #||#Resolution 1366 x 768 pixels. #||#DVD optical drives:#||#Disc drive not included. #||#Graphics:#||#Intel UHD Graphics 600 graphics card. #||#Shared graphics card. #||#Interfaces and connectivity:#||#SD media card reader. #||#Secure Digital (SD), . #||#2 USB 2.0 ports. #||#1 USB 3.0 port. #||#1 Ethernet port. #||#1 HDMI port. #||#Bluetooth. #||#Wi-Fi enabled. #||#Multimedia features:#||#HD webcam. #||#Built-in mic. #||#Built-in audio sound system. #||#30 days Norton Security. #||#General information:#||#Manufacturer's 1 year guarantee. #||#EAN: 4710180446104. Size H1.79, W34.3, D24.5cm.#||#Weight 1.65kg.#||#Up to 10 hours battery life.#||#Intel Celeron N4000 processor.#||#Dual core processor.#||#1.1GHz processor speed with a burst speed of 2.6GHz.#||#4GB RAM DDR4.#||#64GB eMMC storage.#||#Microsoft Windows 10 S.#||#14 inch screen.#||#High definition display.#||#Resolution 1366 x 768 pixels.#||#Disc drive not included.#||#Intel UHD Graphics 600 graphics card.#||#Shared graphics card.#||#SD media card reader.#||#Secure Digital (SD), .#||#2 USB 2.0 ports.#||#1 USB 3.0 port.#||#1 Ethernet port.#||#1 HDMI port.#||#Bluetooth.#||#Wi-Fi enabled.#||#HD webcam.#||#Built-in mic.#||#Built-in audio sound system.#||#30 days Norton Security.#||#Manufacturer's 1 year guarantee.#||#EAN: 4710180446104.
预期分数是 100,但只有 55
欢迎任何建议!提前致谢!
标题
解决方案
发现如果任何一个字符串长度(字符数)超过阈值,partial_ratio 将 Sequence Matcher 设置为 false,即使存在部分字符串匹配,分数也不是 100%
推荐阅读
- c# - 在不同的、独立的对象上工作的 C# 任务,仍然会出现同步错误,为什么?
- react-native - 在图标旁边的 FlatList 中居中文本 - React Native
- c - 可以覆盖指向字符串的指针数组的值吗?
- ios - Swift:在从初始化程序返回之前,不会在所有路径上调用“super.init”?
- php - 推荐奖金计算两次
- javascript - firebase 和 Angular 7 中文档中的集合
- width - Fabric.js:以编程方式更新其尺寸后未渲染的部分 Line
- php - 开发中的 Symfony 4 资产响应错误,需要哪个 php 扩展?
- pandas - 如何获取一列的行,然后对 Pandas 中特定列中的行求和
- json - 通过“powershell”命令从 json 文件中提取数据