# carlos-sd/resume_analysis- architecture

> Architecture diagram of the GitHub repository carlos-sd/resume_analysis-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/carlos-sd/resume_analysis-
- Repository: https://github.com/carlos-sd/resume_analysis-

## Overview

##### Project Type & Core Purpose
- This is a resume screening and evaluation application that leverages DFA for classification, FST for ranking, and CFG for validating resume structures.

##### Main Components
- Input/Data Layer:
- “data/sample_resumes”: Represents the source of resumes (PDF, DOCX, TXT) used for testing and demonstration.
- User Interface & Entry Point:
- “src/main.py”: The main program that drives the interactive CLI, presenting options for using a predefined resume or uploading one.
- Configuration:
- “src/config/regex_config.py”: Provides rules and settings (regular expressions) that guide the parsing and classification processes.
- Core Processing Modules (Models):
- “src/models/resume_parser.py”: Handles resume processing and extraction of information.
- “src/models/resume_classifier.py”: Uses deterministic finite automata (DFA) to classify resumes against specific roles.
- “src/models/resume_grammar.py”: Applies context-free grammars (CFG) for structural validation of the resume content.
- “src/models/resume_ranker.py”: Implements finite state transducers (FST) to assign scores and rank candidates.
- Supporting and Documentation/Testing:
- “tests/”: Indicates there are unit tests to verify each module.
- “docs/”: Provides supporting documents like the test plan and theoretical foundation, which might feed into architectural decisions.
- External Libraries & Dependencies:

##### Relationships & Data Flow
- How the “main entry point” passes a selected resume (from the data layer) into the processing pipeline.
- The Resume Parser extracts raw data,
- Then sends it to the Resume Classifier (DFA based analysis),
- Alongside validation by the Resume Grammar module (ensuring document structure as per CFG),
- And eventually passes information to the Resume Ranker (using FST to generate candidate scores).
- Also, include a feedback loop or reporting module showing how the ranked and classified results are then output as summaries (HTML/Markdown) and presented to the user.

##### Architectural Patterns & Design Principles
- Layered Architecture:
- Clearly separate the data ingestion (inputs), business logic (parsing, classification, ranking, grammar checking), and presentation logic (CLI/UI).
- Modularity & Separation of Concerns:
- Each module (parser, classifier, ranker, grammar validator) is stand-alone with a clearly defined input/output interface. This enables independent testing and maintenance.
- Pipeline/Sequential Processing:
- Sequential nature of the resume processing—from feature extraction to classification and ranking.
- Testing & Documentation:
- Although not a direct part of runtime architecture, the inclusion of a “tests” directory emphasizes quality assurance. You might include a note that these ensure reliability of each processing module.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Input Layer
    subgraph "Input Layer"
        DataResumes("Input: Sample Resumes"):::data
        MainUI("CLI Interface"):::ui
    end
    DataResumes -->|"provides_resume"| MainUI

    %% Configuration Module
    subgraph "Configuration"
        Config("Configuration Module"):::config
    end
    MainUI -->|"load_config"| Config

    %% Processing Pipeline
    subgraph "Processing Pipeline"
        Parser("Resume Parser"):::proc
        Classifier("DFA-based Classifier"):::proc
        Grammar("CFG Validator"):::proc
        Ranker("FST Ranker"):::proc
        Summary("Output: Summary Report"):::ui
    end
    MainUI -->|"submit_resume"| Parser
    Config -->|"config_dependency"| Parser
    Parser -->|"extracts_data"| Classifier
    Parser -->|"extracts_data"| Grammar
    Classifier -->|"sends_classification"| Ranker
    Grammar -->|"sends_validation"| Ranker
    Ranker -->|"sends_scored_results"| Summary
    Summary -->|"display_output"| MainUI

    %% Support & Dependencies
    subgraph "Support & Dependencies"
        External("External Libraries: textx,pyformlang,python-docx,PyPDF2,tkinter"):::external
        Testing("Testing Suite"):::testdoc
        Documentation("Documentation"):::testdoc
    end
    External --- Parser
    Testing --- Documentation

    %% Click Events
    click DataResumes "https://github.com/carlos-sd/resume_analysis-/tree/main/data/sample_resumes"
    click MainUI "https://github.com/carlos-sd/resume_analysis-/blob/main/src/main.py"
    click Config "https://github.com/carlos-sd/resume_analysis-/blob/main/src/config/regex_config.py"
    click Parser "https://github.com/carlos-sd/resume_analysis-/blob/main/src/models/resume_parser.py"
    click Classifier "https://github.com/carlos-sd/resume_analysis-/blob/main/src/models/resume_classifier.py"
    click Grammar "https://github.com/carlos-sd/resume_analysis-/blob/main/src/models/resume_grammar.py"
    click Ranker "https://github.com/carlos-sd/resume_analysis-/blob/main/src/models/resume_ranker.py"
    click Testing "https://github.com/carlos-sd/resume_analysis-/tree/main/tests/"
    click Documentation "https://github.com/carlos-sd/resume_analysis-/tree/main/docs/"

    %% Styles
    classDef data fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef ui fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef config fill:#FFA07A,stroke:#000,stroke-width:2px;
    classDef proc fill:#D8BFD8,stroke:#000,stroke-width:2px;
    classDef external fill:#D3D3D3,stroke:#000,stroke-width:2px;
    classDef testdoc fill:#FFB6C1,stroke:#000,stroke-width:2px;
```
