1import { convertSinglishToSinhala } from '@siyabasa/singlish'23const sinhala = convertSinglishToSinhala('aayuboowan')4console.log(sinhala) // ආයුබෝවන්
INTERACTIVE DEMO
Try it yourself — type and see real-time Singlish to Sinhala conversion
FEATURES
Built with computer-science first approach for production-grade performance
Deterministic Phoneme Tokenization
100% accuracy for complex conjuncts and vowel modifiers through rigorous phonetic parsing.
Zero-Latency Architecture
O(n) time complexity using prefix-trie based lookahead parser. Optimized for the critical rendering path.
Universal Runtime
Isomorphic design that runs seamlessly on Edge, Node.js, and in the Browser with zero configuration.
React IME Hook
Drop-in useSinglishConverter hook that manages cursor position, input history, and IME state automatically.
Auto-Attach
Zero-config DOM hydration using MutationObserver to automatically enhance all input fields.
API REFERENCE
Simple, powerful API designed for developer experience
convertSinglishToSinhala
convertSinglishToSinhala(text: string): stringPure function to transpile Singlish text to Sinhala Unicode. Stateless and synchronous, designed for high-throughput server-side rendering.
1import { convertSinglishToSinhala } from '@siyabasa/singlish'23const output = convertSinglishToSinhala('aayuboowan')4// Output: "ආයුබෝවන්"