Skip to content

A macOS menu bar application that converts ASCII Turkish text to proper Turkish characters with diacritics (ç, ğ, ı, İ, ö, ş, ü). Perfect for Turkish speakers living abroad using English keyboards.

License

Notifications You must be signed in to change notification settings

armish/TurkishDeasciifier

Repository files navigation

Turkish Deasciifier

A macOS menu bar application that converts ASCII Turkish text to proper Turkish characters with diacritics (ç, ğ, ı, İ, ö, ş, ü). Perfect for Turkish speakers living abroad using English keyboards.

CI Accuracy Test License: MIT Turkish Deasciifier Platform Swift

✨ Features

  • ⚡ Global Hotkey: Convert selected text anywhere with ⌥⌘T
  • 🔤 Menu Bar Integration: Lightweight, always-accessible interface
  • 📝 Real-time Conversion: Type and see results instantly
  • 📋 Smart Clipboard: Auto-copy converted text
  • 🚀 High Performance: Pattern-based algorithm with 13,462 contextual rules

🚀 Quick Start

Download & Build

# Clone the repository
git clone https://github.com/armish/TurkishDeasciifier.git
cd TurkishDeasciifier

# Build the application
./build_direct.sh

# Run the app
./TurkishDeasciifier

Usage

  1. Menu Bar Access: Click the "tü" icon in your menu bar
  2. Global Hotkey: Select any text and press ⌥⌘T to convert instantly
  3. Manual Conversion: Type in the app window for real-time conversion

📖 Character Mappings

ASCII Turkish Example
c → ç C → Ç cicek → çiçek
g → ğ G → Ğ dogru → doğru
i → ı I → İ Insan → İnsan
o → ö O → Ö gorulmek → görülmek
s → ş S → Ş seker → şeker
u → ü U → Ü Turkiye → Türkiye

🛠️ Requirements

  • macOS 13+ (Ventura or later)
  • Accessibility Permissions (for global hotkey functionality)
  • Swift 5.8+ (for building from source)

🏗️ Building

Method 1: Direct Build (Recommended)

./build_direct.sh

Method 2: Swift Package Manager

swift build -c release
# Output: .build/release/TurkishDeasciifier

Method 3: Manual Build

cd Sources
swiftc -o ../TurkishDeasciifier \
    TurkishDeasciifierApp.swift \
    ContentView.swift \
    TurkishDeasciifier.swift \
    -framework SwiftUI \
    -framework AppKit \
    -framework Carbon \
    -O

⚙️ Permissions Setup

  1. Run the app for the first time
  2. Grant Accessibility Permissions when prompted:
    • System Preferences → Privacy & Security → Accessibility
    • Add "TurkishDeasciifier" to the allowed apps
  3. Restart the app to enable global hotkey

🧪 Testing

Build and Run Tests

# Build the application
./build_direct.sh

# Test accuracy
swift Tests/accuracy_test.swift

Sample Conversions

Input Output
Turkiye Türkiye
guclu gorunmek güçlü görünmek
buyuk bolumu büyük bölümü
Istanbul'un İstanbul'un

🔬 Algorithm Details

Pattern-Based Context Analysis

  • 13,462 patterns for contextual character conversion
  • Bidirectional context analysis (10 characters each direction)
  • Ranking system for pattern confidence
  • Special handling for Turkish capitalization rules

Accuracy Metrics

  • 100% accuracy on comprehensive test corpus
  • Matches Python implementation character-by-character
  • Real-world tested with Turkish news articles and literature

🛡️ Troubleshooting

Build Issues

If you encounter Xcode Command Line Tools issues:

# Use the direct build method instead
./build_direct.sh

Permission Issues

If global hotkey doesn't work:

  1. Check Accessibility permissions in System Preferences
  2. Remove and re-add the app if needed
  3. Restart the application

Pattern Loading Issues

If conversion accuracy is low:

  1. Ensure Sources/turkish_patterns.json exists
  2. Check file permissions (chmod 644 Sources/turkish_patterns.json)
  3. Verify file size is ~175KB

🔧 Configuration

Customizing the Hotkey

Edit TurkishDeasciifierApp.swift line 110:

// Change key code 17 ('T') to desired key
if event.modifierFlags.contains([.command, .option]) && event.keyCode == 17 {

Adjusting Context Size

Edit TurkishDeasciifier.swift line 7:

private let turkishContextSize = 10  // Characters to analyze around target

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Add tests for new functionality
  4. Ensure 100% accuracy is maintained (swift Tests/accuracy_test.swift)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Submit a pull request

📄 License

MIT License - see LICENSE file for details.

🙏 Acknowledgments

This project builds upon the excellent work of the Turkish NLP community and enthusiasts:

Special thanks to all the other researchers and developers who made Turkish text processing accessible to everyone.

📞 Support

  • Issues: Report bugs and feature requests via GitHub Issues
  • Accuracy Problems: Include sample text and expected output
  • Build Problems: Specify macOS version and Xcode setup
  • Discussions: Join conversations on GitHub Discussions

Made with ❤️ for the Turkish community worldwide 🇹🇷

About

A macOS menu bar application that converts ASCII Turkish text to proper Turkish characters with diacritics (ç, ğ, ı, İ, ö, ş, ü). Perfect for Turkish speakers living abroad using English keyboards.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •