feat: SheetDetector 类型识别(名称/表头关键词)

This commit is contained in:
lhl
2026-08-08 16:59:17 +08:00
parent df9427c76e
commit 66753e425d
2 changed files with 72 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
from genesis.data_models import SheetType
from genesis.parsers.sheet_detector import detect_sheet_type
def test_detect_by_sheet_name():
assert detect_sheet_type("機能一覧", []) == SheetType.FUNCTION
assert detect_sheet_type("画面一覧", []) == SheetType.SCREEN
assert detect_sheet_type("帳票一覧", []) == SheetType.REPORT
assert detect_sheet_type("DB定義", []) == SheetType.DATABASE
assert detect_sheet_type("IF定義", []) == SheetType.INTERFACE
assert detect_sheet_type("バッチ一覧", []) == SheetType.BATCH
assert detect_sheet_type("コード管理", []) == SheetType.MASTER
def test_detect_by_header_keyword():
matrix = [["帳票ID", "帳票名"], ["TB1", "月次"]]
assert detect_sheet_type("補充シート", matrix) == SheetType.REPORT
def test_unknown_is_generic():
assert detect_sheet_type("メモ", [["随筆"]]) == SheetType.GENERIC