Skip to content

clem27dev/ClemScriptGen

Repository files navigation

CléfistAI - ClemScript Generator

Overview

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.

User Preferences

Preferred communication style: Simple, everyday language.

System Architecture

Frontend Architecture

  • 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

Backend Architecture

  • Modular Design: Split into three core components for separation of concerns:
    • ClemScriptAnalyzer: Natural language processing for French prompts
    • CodeGenerator: Code generation engine using template-based approach
    • ClemScriptTemplates: 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

Code Generation System

  • 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

Language Processing

  • 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

External Dependencies

Core Framework

  • Streamlit: Web application framework for the user interface
  • Python Standard Library: Uses re module for regex-based text processing

Language Features

  • ClemScript Language: Custom programming language with French-inspired syntax
  • Template System: Internal templating system for code generation patterns

Development Environment

  • 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.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages