Change the script, not the language.
Finglish is Persian written with Latin letters. This is transliteration, not English-to-Persian translation or a tool that rewrites your sentences.
Persian words, typed with Latin letters. Turn Finglish into Persian script in the browser, with alternative spellings and control over what stays unchanged.
YOUR WORDS, ON YOUR DEVICE
The demo loads when you reach it.
Loading or conversion failed. Try again with a shorter input if needed.
Choose a word to inspect its candidates. Outlined tokens were kept unchanged.
These are alternatives returned by the engine, not corrections confirmed to be right.
The engine and its data download from this website. Conversion runs in a browser worker; this demo does not send your text to a server. Review names and ambiguous words before using the result.
Finglish is Persian written with Latin letters. This is transliteration, not English-to-Persian translation or a tool that rewrites your sentences.
The tokenizer protects links, email addresses, mentions, code and numbers. Add your own tokens with protect when a product name should stay in Latin letters.
Finglish can be ambiguous. The API returns alternatives and per-span candidates so your interface can let people review the spelling.
A LIBRARY FOR YOUR INTERFACE
Use it alongside a message composer, a writing tool or a form. Keep the original input available and let the person decide whether to use the conversion.
The hybrid configuration: the model ranked together with rules, plus frequency and vowel tables. The optional bigram table and lexicon are not loaded. A bare transliterate() call uses rules only, so its output can differ.
Spelling habits, names and mixed-language text can produce mistakes. Confidence values rank the engine’s candidates; they are not a measured probability that a sentence is correct. Test it on the writing your users actually produce.
Read the evaluation notes// After loading the model and both word tables:
const engine = new Transliterator({
model: weights,
frequency: decodeFrequencyTable(frequencyBytes),
vowels: decodeVowelTable(vowelBytes),
});
const result = engine.transliterate(input, {
protect: ['google'],
alternatives: 2,
});
result.text; // Persian output
result.alternatives; // Other whole-text suggestions
result.spans; // Each input span and its resultimport {
Transliterator,
decodeFrequencyTable,
decodeVowelTable,
} from 'tiny-finglish';
// Vite-style asset URLs; fetch these when needed.
import modelUrl from 'tiny-finglish/weights.json?url';
import frequencyUrl from 'tiny-finglish/frequency.bin?url';
import vowelsUrl from 'tiny-finglish/vowels.bin?url';
async function load(url) {
const response = await fetch(url);
if (!response.ok) throw new Error('Asset unavailable');
return response;
}
const [weights, frequency, vowels] = await Promise.all([
load(modelUrl).then(r => r.json()),
load(frequencyUrl).then(r => r.arrayBuffer()),
load(vowelsUrl).then(r => r.arrayBuffer()),
]);
const frequencyBytes = new Uint8Array(frequency);
const vowelBytes = new Uint8Array(vowels);Our demo runs this setup in a worker, loaded only on this product page. The model and tables are fetched when you reach the demo.
This demo runs Tiny Finglish v0.1.0. Download the package from its GitHub release and follow the installation guide. It is not published on npm yet.