# Run the script
python compare_md_sim.py <file1.md> <file2.md>
# Install dependencies
pip install -r requirements.txtCurrently no automated tests exist. Future tests should use pytest.
- Imports: Organize as (stdlib, third-party, local). Use explicit imports, avoid
import *. - Formatting: Follow PEP 8. Use 4-space indentation.
- Naming:
- Functions/variables:
snake_case - Classes:
PascalCase - Constants:
UPPER_SNAKE_CASE
- Functions/variables:
- Type hints: Not currently used; add when refactoring.
- Docstrings: Use triple-quoted format with description of parameters and return values (as shown in existing code).
- Error handling: Use try/except for external operations (file I/O, model loading); propagate context in error messages.
- Comments: Use for complex logic and non-obvious intent. Comments are in Chinese; maintain consistency with existing codebase.
compare_md.py: Main script that compares semantic similarity of two Markdown filesrequirements.txt: Python dependencies (markdown-it-py, beautifulsoup4, sentence-transformers, torch).gitignore: Standard Python ignore patterns