A smart text editor with AI-powered autocomplete support for both Tibetan and English languages. The editor uses Claude AI (Anthropic's API) to provide context-aware sentence completions and detect gibberish text.
- Real-time sentence completion for Tibetan and English text
- Smart prediction after 1.5 seconds of typing pause
- Gibberish detection for both languages
- UTF-8 support for proper Tibetan text handling
- File operations (Open/Save) with UTF-8 encoding
- Undo/Redo functionality
- Clean and intuitive user interface
- Python 3.x
- Anthropic API key
- Noto Serif Tibetan font (for Tibetan text rendering)
- Clone the repository:
git clone https://github.com/yourusername/tibetan_autocomplete.git
cd tibetan_autocomplete- Install required packages:
pip install anthropic- Set up your Anthropic API key:
export ANTHROPIC_API_KEY='your-api-key-here'- Start the editor:
python editor.py-
Writing and Autocomplete:
- Type any text in Tibetan or English
- After 1.5 seconds of pause in typing, a grey-colored suggestion appears
- Press the Tab key to accept and insert the suggested completion
- If you don't want the suggestion, just keep typing and it will disappear
-
File Operations:
- Save your work using File → Save or File → Save As...
- Files are saved as .txt format with full UTF-8 support
- You can write and save any type of text content
- Open existing .txt files using File → Open
- Create new documents with File → New
-
Additional Features:
- Undo/Redo support for all text operations
- Real-time gibberish detection
- Clean interface with intuitive controls
editor.py: Main text editor implementation with GUIpredict.py: AI prediction logic using Claude APIget_tibetan_completion(): Get completion for Tibetan textget_english_completion(): Get completion for English textis_gibberish(): Check if input text is gibberish
Contributions are welcome! Please feel free to submit a Pull Request. <<<<<<< Updated upstream
Stashed changes
