Skip to content

fix: update Chinese semantic search pattern rules#358

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
Johnson-zs:master
Jul 17, 2026
Merged

fix: update Chinese semantic search pattern rules#358
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
Johnson-zs:master

Conversation

@Johnson-zs

Copy link
Copy Markdown
Contributor
  1. Added "数据" to spreadsheet keywords for better coverage
  2. Updated time patterns to include "去年一整年" for better matching
  3. Modified year-month pattern to recognize "月" and "月份" variations
  4. These changes improve recognition of common Chinese expressions in
    file types and time references

Log: Improved Chinese search pattern matching for spreadsheets and time
references

Influence:

  1. Test search with new spreadsheet keywords
  2. Verify time period matching with "去年一整年"
  3. Check year-month pattern recognition with different formats
  4. Validate existing patterns still work as expected

fix: 更新中文语义搜索匹配规则

  1. 在电子表格关键词中增加"数据"以提高覆盖率
  2. 更新时间模式匹配增加"去年一整年"支持
  3. 修改年月识别模式以支持"月"和"月份"两种写法
  4. 这些修改提升了中文文件类型和时间表达式的识别准确度

Log: 改进电子表格和时间相关的中文搜索匹配

Influence:

  1. 测试新的电子表格关键词匹配
  2. 验证"去年一整年"时间段的识别
  3. 检查不同格式的年月模式识别
  4. 确保现有模式仍能正常工作

Fixes: #370467 #370395 #370583

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @Johnson-zs, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Johnson-zs

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

1. Added "数据" to spreadsheet keywords for better coverage
2. Updated time patterns to include "去年一整年" for better matching
3. Modified year-month pattern to recognize "月" and "月份" variations
4. These changes improve recognition of common Chinese expressions in
file types and time references

Log: Improved Chinese search pattern matching for spreadsheets and time
references

Influence:
1. Test search with new spreadsheet keywords
2. Verify time period matching with "去年一整年"
3. Check year-month pattern recognition with different formats
4. Validate existing patterns still work as expected

fix: 更新中文语义搜索匹配规则

1. 在电子表格关键词中增加"数据"以提高覆盖率
2. 更新时间模式匹配增加"去年一整年"支持
3. 修改年月识别模式以支持"月"和"月份"两种写法
4. 这些修改提升了中文文件类型和时间表达式的识别准确度

Log: 改进电子表格和时间相关的中文搜索匹配

Influence:
1. 测试新的电子表格关键词匹配
2. 验证"去年一整年"时间段的识别
3. 检查不同格式的年月模式识别
4. 确保现有模式仍能正常工作

Fixes: #370467 #370395 #370583
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

★ 总体评分:95分

■ 【总体评价】

代码优化了中文语义搜索的正则表达式规则,提升了时间词和连接词的识别覆盖率。
逻辑正确且无安全漏洞,但通用词汇的增加可能略微提升搜索误报率。

■ 【详细分析】

  • 1.语法逻辑完全正确✓

JSON 格式合法,正则表达式语法无误。time_rules.json 中将 去年一整年 置于 去年 之前符合正则匹配的优先级原则,能正确捕获完整词组;月? 修改为 月份? 扩展了兼容性。
潜在问题:filetype_rules.json 中新增的 数据 作为一个极为通用的词汇,可能导致大量非表格文件被误判为表格类型。
建议:为 数据 增加上下文限制,或使用更具体的组合词如 数据报表,以降低误报率。

  • 2.代码质量良好✓

修改内容清晰,遵循了现有的配置文件结构和命名规范,description 字段准确描述了规则用途。
潜在问题:无
建议:无

  • 3.代码性能无性能问题✓

正则表达式的调整仅增加了少量分支和字符匹配,对整体搜索性能的影响微乎其微。
潜在问题:无
建议:无

  • 4.代码安全存在0个安全漏洞✓

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
本次修改仅涉及静态 JSON 配置文件中的正则字符串调整,不存在外部输入直接执行或拼接的风险,无安全攻击面。

  • 建议:无需安全修复,继续保持配置文件的只读权限管理。

■ 【改进建议代码示例】

{
    "id": "filetype_spreadsheet_general",
    "pattern": "表格|统计表|报表|名单|数据表|数据报表|明细",
    "description": "Generic spreadsheets (fallback)",
    "enabled": true,
    "priority": 100
}

@Johnson-zs

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

This pr force merged! (status: blocked)

@deepin-bot
deepin-bot Bot merged commit ef02d96 into linuxdeepin:master Jul 17, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants