I have completed the review, optimization, and documentation of the template-conformance project.
- Refactored Core Logic: Consolidated the check logic in
template_conformance_core.pyinto a genericprocess_requirementsfunction, reducing code duplication. - Parser Improvements: Updated
EARSParser,RuppParser, andAgileUserStoryParserto implement a consistentanalyze()interface. - Bug Fixes:
- Fixed
UnboundLocalErrorinears_template_conformance.pyandrupp_template_conformance.pywhere logical branches could leave variables undefined. - Updated
agile_user_story_conformance.pyto use the modern SpacyMatcherAPI (v3+). - Fixed import paths to support the current directory structure.
- Fixed
- Added
requirements.txtwith necessary dependencies (spacy,flask,flask-restful,marshmallow).
- README.md: Updated with clear installation and usage instructions.
- DEVELOPER_GUIDE.md: Created a new guide describing the project structure, setup, and testing.
- Created
test_functionality.pyto verify all three conformance checkers. - Successfully verified EARS, Rupp, and Agile template checks.
You can run the included verification script:
python test_functionality.pyExpected output should show True for valid EARS and Agile sentences, and appropriate results for Rupp.