CléfistAI is a French-language AI generator for the ClemScript programming language. It provides a Streamlit-based web interface that allows users to input natural French language prompts and automatically generates corresponding ClemScript code. The application analyzes user prompts to identify programming concepts like variables, console output, conditions, loops, user input, mathematical operations, colors, quizzes, and interactive elements, then generates appropriate ClemScript syntax.
Preferred communication style: Simple, everyday language.
- Framework: Streamlit web application with a clean, user-friendly interface
- Layout: Two-column design with prompt input on the left and generated code output on the right
- Sidebar: Contains usage guides, examples, and supported features documentation
- Internationalization: Fully French-language interface with French prompt processing
- Modular Design: Split into three core components for separation of concerns:
ClemScriptAnalyzer: Natural language processing for French promptsCodeGenerator: Code generation engine using template-based approachClemScriptTemplates: Template repository for various ClemScript constructs
- Analysis Pipeline:
- Prompt preprocessing and normalization
- Concept detection using keyword matching
- Value extraction using regex patterns
- Code generation using predefined templates
- Template-Based Generation: Uses a comprehensive template system for different ClemScript constructs (variables, loops, conditions, etc.)
- Concept Mapping: Maps French keywords to programming concepts (e.g., "variable" → variable declaration, "affiche" → console output)
- Value Extraction: Regex-based extraction of specific values like variable names, numbers, strings, and comparison operators
- Fallback Mechanism: Provides default code generation when specific concepts aren't detected
- Enhanced French NLP: Extensive keyword dictionary with 200+ French terms mapping to programming concepts
- Advanced Pattern Recognition: Sophisticated regex patterns for extracting values, ranges, operations, and contextual information
- Supported Concepts: Variables, console output, conditionals, loops, user input, advanced math operations, colors, quizzes, interactive adventures, random generation, comments, and functions
- Precision Improvements: Better extraction of variable names, values, loop ranges, mathematical operations, and interaction keywords
- Streamlit: Web application framework for the user interface
- Python Standard Library: Uses
remodule for regex-based text processing
- ClemScript Language: Custom programming language with French-inspired syntax
- Template System: Internal templating system for code generation patterns
- Python Runtime: Requires Python environment for execution
- Streamlit Server: Built-in development server for local hosting
Note: The application is entirely self-contained with no external APIs, databases, or third-party services beyond the core Streamlit framework.