feat: Phase 2 complete — 13 Phases of COBOL type classification and test benchmark
P0.6: gcov infrastructure P1: extract_structure output expansion (11 new feature fields) P2: Confusion group rule engine (8 pairs + contradiction + backtrack) P3: 4-factor confidence calculation + quality gate update P4: 33+2 COBOL program type test samples (22 files, 7 categories) P5: parametrized/ test data generation engine P6: japanese_data.py lookup tables P7-10: Type-specific test suites (~159 parametrized tests) P11: Full classification pipeline (classify_program) + orchestrator integration P12: Documentation (module-interfaces, test-plan v3.0, coverage-matrix) Architecture decisions: - classification_pipeline/ merged to hina/pipeline/ - parametrized/ as independent module - japanese_data.py as root-level file - hina/__all__ only exports classify_program() Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+18
-3
@@ -388,17 +388,32 @@ def parse_data_division(data_div_text: str) -> list[FieldDef]:
|
||||
|
||||
|
||||
def parse_file_control(source: str) -> dict:
|
||||
"""?? FILE-CONTROL??? {?????: ?????}"""
|
||||
"""Parse FILE-CONTROL paragraph.
|
||||
|
||||
Returns dict:
|
||||
{filename: {"assign_to": str, "organization": str | None}}
|
||||
"""
|
||||
m = re.search(r'FILE-CONTROL\.(.*?)(?=DATA\s+DIVISION|\Z)', source, re.DOTALL | re.IGNORECASE)
|
||||
if not m:
|
||||
return {}
|
||||
fc = m.group(1)
|
||||
result = {}
|
||||
for m in re.finditer(
|
||||
for sel_m in re.finditer(
|
||||
r'SELECT\s+(\w[\w-]*)\s+[^.]*?\bASSIGN\s+TO\s+(["\'])(.*?)\2',
|
||||
fc, re.IGNORECASE
|
||||
):
|
||||
result[m.group(1).upper()] = m.group(3).upper()
|
||||
fname = sel_m.group(1).upper()
|
||||
assign_to = sel_m.group(3).upper()
|
||||
# Extract ORGANIZATION clause within this SELECT statement
|
||||
org_m = re.search(
|
||||
r'ORGANIZATION\s+(?:IS\s+)?(\w[\w-]*)',
|
||||
sel_m.group(0), re.IGNORECASE
|
||||
)
|
||||
org = org_m.group(1).upper() if org_m else None
|
||||
result[fname] = {
|
||||
"assign_to": assign_to,
|
||||
"organization": org,
|
||||
}
|
||||
return result
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user