{"id":44510129,"url":"https://github.com/remeinium/singlish","last_synced_at":"2026-02-25T17:25:04.203Z","repository":{"id":338132703,"uuid":"1156610310","full_name":"remeinium/singlish","owner":"remeinium","description":"Singlish (Romanized Sinhala) with phonetic precision and zero-latency IME support. Built for the modern web by Remeinium Siyabasa Labs","archived":false,"fork":false,"pushed_at":"2026-02-14T18:34:04.000Z","size":176,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-14T20:38:57.447Z","etag":null,"topics":["ime","javascript","library","npm","package","phonetic","pnpm","remeinium","roamanized","singlish","sinhala","siyabasa","transliterate","transliteration","transliterator","yarn"],"latest_commit_sha":null,"homepage":"https://labs.remeinium.com/siyabasa/singlish","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/remeinium.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-12T21:04:48.000Z","updated_at":"2026-02-14T18:34:08.000Z","dependencies_parsed_at":"2026-02-14T14:03:29.707Z","dependency_job_id":null,"html_url":"https://github.com/remeinium/singlish","commit_stats":null,"previous_names":["remeinium/singlish"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/remeinium/singlish","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remeinium%2Fsinglish","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remeinium%2Fsinglish/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remeinium%2Fsinglish/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remeinium%2Fsinglish/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remeinium","download_url":"https://codeload.github.com/remeinium/singlish/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remeinium%2Fsinglish/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29481924,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T11:35:25.641Z","status":"ssl_error","status_checked_at":"2026-02-15T11:34:57.128Z","response_time":118,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ime","javascript","library","npm","package","phonetic","pnpm","remeinium","roamanized","singlish","sinhala","siyabasa","transliterate","transliteration","transliterator","yarn"],"created_at":"2026-02-13T13:56:29.148Z","updated_at":"2026-02-15T15:01:07.300Z","avatar_url":"https://github.com/remeinium.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @siyabasa/singlish\r\n\r\nA deterministic, high-performance transliteration engine for Singlish (Romanized Sinhala) with phonetic precision and zero-latency IME support. Built for the modern web by **Remeinium Siyabasa Labs**.\r\n\r\n[![NPM Version](https://img.shields.io/npm/v/@siyabasa/singlish.svg)](https://www.npmjs.com/package/@siyabasa/singlish)\r\n[![Bundle Size](https://img.shields.io/bundlephobia/minzip/@siyabasa/singlish)](https://bundlephobia.com/package/@siyabasa/singlish)\r\n[![License](https://img.shields.io/npm/l/@siyabasa/singlish.svg)](https://github.com/remeinium/singlish/blob/main/LICENSE)\r\n\r\n## Design Philosophy\r\n\r\nThe Singlish Input Method Editor (IME) landscape has long been fragmented by ad-hoc regex replacements and non-standard transliteration schemes. **@siyabasa/singlish** introduces a rigourous, computer-science first approach to Sinhala transliteration:\r\n\r\n- **Deterministic Phoneme Tokenization**: Unlike simple string replacement, our engine tokenizes Roman input into phonetic units before rendering, ensuring 100% accuracy for complex conjuncts (*yansaya*, *rakaransaya*) and vowel modifiers.\r\n- **Zero-Latency Architecture**: Optimized for the critical rendering path. The core conversion engine operates in O(n) time complexity using a prefix-trie based lookahead parser.\r\n- **Universal Runtime**: Isomorphic design that runs seamlessly on the Edge, Node.js, and in the Browser.\r\n\r\n## Architecture\r\n\r\nThe engine uses a two-stage compilation process:\r\n1. **Lexical Analysis**: Input text is scanned and tokenized into phonemes using a greedy matching algorithm against a compiled trie of 400+ phoneme patterns.\r\n2. **Contextual Rendering**: A state-machine renderer processes the token stream to handle inherent vowels, *hal-kirima*, and context-dependent glyph shaping (e.g., standard *ra* vs *rakaransaya* forms).\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @siyabasa/singlish\r\n# or\r\nyarn add @siyabasa/singlish\r\n# or\r\npnpm add @siyabasa/singlish\r\n```\r\n\r\n## Quick Start\r\n\r\n### Core Transliteration\r\n\r\nThe core API is stateless and synchronous, designed for high-throughput server-side rendering or bulk text processing.\r\n\r\n```typescript\r\nimport { convertSinglishToSinhala } from '@siyabasa/singlish';\r\n\r\nconst output = convertSinglishToSinhala('aayuboowan'); \r\n// Output: \"ආයුබෝවන්\"\r\n```\r\n\r\n### React IME Hook\r\n\r\nFor building rich text editors or chat interfaces, use the `useSinglishConverter` hook. It manages cursor position, input history, and IME state automatically.\r\n\r\n```tsx\r\nimport { useSinglishConverter } from '@siyabasa/singlish';\r\n\r\nexport function Editor() {\r\n  const { inputProps, enabled, toggle } = useSinglishConverter({ enabled: true });\r\n  \r\n  return (\r\n    \u003cdiv className=\"flex flex-col gap-2\"\u003e\r\n      \u003cdiv className=\"flex justify-between items-center\"\u003e\r\n        \u003cspan className=\"text-sm font-medium\"\u003eInput Method\u003c/span\u003e\r\n        \u003cbutton \r\n          onClick={toggle}\r\n          className=\"px-3 py-1 text-xs rounded-full bg-gray-100 hover:bg-gray-200 transition-colors\"\r\n        \u003e\r\n          {enabled ? '🇱🇰 Siyabasa IME' : '🇺🇸 English'}\r\n        \u003c/button\u003e\r\n      \u003c/div\u003e\r\n      \u003ctextarea \r\n        {...inputProps} \r\n        className=\"w-full h-32 p-3 border rounded-lg focus:ring-2 focus:ring-blue-500 outline-none\"\r\n        placeholder=\"Type in Singlish (e.g., 'kohomada')...\"\r\n      /\u003e\r\n    \u003c/div\u003e\r\n  );\r\n}\r\n```\r\n\r\n### Auto-Attach (Zero Config)\r\n\r\nFor legacy applications or rapid prototyping, the Auto-Attach module uses a `MutationObserver` to automatically hydrate all input fields in the DOM with Singlish capabilities.\r\n\r\n```typescript\r\nimport { createAutoAttach, createUIToggle } from '@siyabasa/singlish';\r\n\r\n// Automatically attaches to all input[type=\"text\"] and textarea elements\r\nconst autoAttach = createAutoAttach({\r\n  exclude: '[data-no-ime]' // Optional exclusion selector\r\n});\r\n\r\n// Mounts a floating toggle widget\r\nconst toggle = createUIToggle({\r\n  position: 'bottom-right',\r\n  theme: 'auto'\r\n});\r\n\r\ntoggle.mount();\r\n```\r\n\r\n## CITATION for Phonetic Transliteration\r\n\r\nSinglish uses a phonetic mapping scheme, inspired by the standard method popularized by **[Helakuru](https://helakuru.lk)**. This means you type the sound of the letter rather than the key position (as in Wijesekara layout).\r\n\r\n\u003e **Writing using the Phonetic Method**\r\n\u003e\r\n\u003e \"The Phonetic Method is a Sinhalese typing system first introduced by Helakuru for mobile phone keyboards. It allows you to type Sinhala characters by using English letters that match their sound.\" — *Helakuru.lk*\r\nWe acknowledge and credit Helakuru for their innovation in establishing this now-standard mapping for digital Sinhala typing.\"\r\n\u003e [Read more](https://facts.helakuru.lk/sinhala-typing/phonetic)\r\n\r\n- **Short vowels**: `a` (අ), `i` (ඉ), `u` (උ), `e` (එ), `o` (ඔ)\r\n- **Long vowels**: Double the letter (`aa` -\u003e ආ, `ii` -\u003e ඊ)\r\n- **Consonants**: Standard mappings (`k` -\u003e ක, `g` -\u003e ග)\r\n- **Aspirated (Mahaprana)**: Add `h` (`kh` -\u003e ඛ, `bh` -\u003e භ)\r\n- **Retroflex (Murdhaja)**: Capitalize (`T` -\u003e ට, `D` -\u003e ඩ, `N` -\u003e ණ)\r\n\r\n## API Reference\r\n\r\n### `convertSinglishToSinhala(text: string, options?: ConversionOptions): string`\r\nPure function to transpile Singlish text to Sinhala Unicode.\r\n\r\n### `convertWithMetadata(text: string): ConversionResult`\r\nExtended version of the core converter that provides tokenization details and conversion metrics.\r\n\r\n### `useSinglishConverter(options?: HookOptions)`\r\nReact hook that returns spreadable input props (`value`, `onChange`, `onKeyDown`, etc.) for seamless IME integration.\r\n\r\n## License\r\n\r\nROSL 1.0 © [Remeinium Siyabasa Labs](https://labs.remeinium.com/siyabasa)\r\n\r\n---\r\n\r\n\u003cdiv align=\"center\"\u003e\r\n  \u003cp\u003eBuilt with ❤️ for the Sinhala NLP Community\u003c/p\u003e\r\n\u003c/div\u003e\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremeinium%2Fsinglish","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremeinium%2Fsinglish","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremeinium%2Fsinglish/lists"}