# -*- coding: utf-8 -*- # 规则文件:排名识别 # 源:template_extract/template_extractor.py get_rank() 第 96-102 行 # 迁移日期:2026-08-12 Phase 7 version: 1 category: RANK description: | 排名识别(第 1/2/3 名 → win_tenderer/second_tenderer/third_tenderer)。 原 template_extractor.get_rank() 函数,使用 re.match(头部匹配)。 迁移后 get_rank() 改为遍历 RuleLoader.get_pattern(id).match(text)。 patterns: - id: rank_first description: 第 1 名/中标人 → win_tenderer pattern: '第?[1一](名|((中标|成交|中选)?(候选人|供应商))?)?$|首选供应商$' method: match golden_examples: - input: "第1名" should_match: true - input: "第一名" should_match: true - input: "1" should_match: true - input: "一" should_match: true - input: "1中标候选人" should_match: true - input: "首选供应商" should_match: true - input: "第2名" should_match: false - input: "中标候选人" should_match: false - input: "第一名候选人" should_match: false - id: rank_second description: 第 2 名 → second_tenderer pattern: '第?[2二](名|((中标|成交|中选)?(候选人|供应商))?)?$' method: match golden_examples: - input: "第2名" should_match: true - input: "第二名" should_match: true - input: "2" should_match: true - input: "第二中标候选人" should_match: true - input: "第1名" should_match: false - input: "第3名" should_match: false - id: rank_third description: 第 3 名 → third_tenderer pattern: '第?[3三](名|((中标|成交|中选)?(候选人|供应商))?)?$' method: match golden_examples: - input: "第3名" should_match: true - input: "第三名" should_match: true - input: "3" should_match: true - input: "第三中标候选人" should_match: true - input: "第1名" should_match: false - input: "第2名" should_match: false