Teencode Normaliser API
Normalise Vietnamese teencode and chat abbreviations (ko, dc, j, z, ntn, iu…), repeated letters and leftover Telex, keeping case. Changes listed.
Send informal Vietnamese text ("ko dc j ạ, shop ơiiii, sp nàyyy bn z") and get standard Vietnamese ("không được gì ạ, shop ơi, sản phẩm này bao nhiêu vậy") with the list of changes and their positions. A curated dictionary of about 270 abbreviations covers chat and shopping language (ko / k / hok → không, dc / đc → được, j → gì, z / dz → vậy, ntn → như thế nào, iu → yêu, sp → sản phẩm, sđt → số điện thoại, ck → chuyển khoản…). Ambiguous short forms are only replaced in a clear context: "k" after a number stays (50 k), "bn" becomes "bao nhiêu" before tiền / tuổi or at the end of a question and "bạn" otherwise, "ck" is "chuyển khoản" next to rồi / trước / stk and "chồng" next to vk.
Letters repeated three times or more are squeezed (ơiiii → ơi), a doubled final letter only when the result is a real syllable, and the Telex leftover "dd" becomes "đ" (ddi → đi). Case is kept (KO → KHÔNG, Ko → Không). Emojis can be kept, removed or turned into labels ([cười], [đồng ý]). Add your own abbreviations with dictionary; batch up to 200 texts with texts.
Useful before search, classification, profanity filtering or order extraction. The text gets no new accents: run /v1/vn-diacritics on text typed without accents.
Parameters
| Name | In | Type | Required | Default | |
|---|---|---|---|---|---|
text | query|body | string | yes | The text (max 20,000 characters). Or texts: array of up to 200. | |
emoji | query|body | string | no | keep | keep, label ([cười], [đồng ý]…) or remove. |
dictionary | body | object | no | Your own abbreviations {"abbr": "replacement"} (max 500), applied first. | |
squeeze | query|body | boolean | no | true | Squeeze repeated letters (ơiiii → ơi). |
telex | query|body | boolean | no | true | Fix the Telex leftover dd → đ at the start of a word. |
Example
curl "https://apibox.io.vn/v1/vn-teencode?text=ko%20dc%20j%20%E1%BA%A1%2C%20shop%20%C6%A1iiii%2C%20sp%20n%C3%A0yyy%20bn%20z" \
-H "Authorization: Bearer YOUR_API_KEY"const res = await fetch('https://apibox.io.vn/v1/vn-teencode?text=ko%20dc%20j%20%E1%BA%A1%2C%20shop%20%C6%A1iiii%2C%20sp%20n%C3%A0yyy%20bn%20z', {
method: 'GET',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
},
});
const data = await res.json();
console.log(data);import requests
res = requests.get(
"https://apibox.io.vn/v1/vn-teencode?text=ko%20dc%20j%20%E1%BA%A1%2C%20shop%20%C6%A1iiii%2C%20sp%20n%C3%A0yyy%20bn%20z",
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/vn-teencode?text=ko%20dc%20j%20%E1%BA%A1%2C%20shop%20%C6%A1iiii%2C%20sp%20n%C3%A0yyy%20bn%20z');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));Response
{
"input": "ko dc j ạ, shop ơiiii, sp nàyyy bn z",
"text": "không được gì ạ, shop ơi, sản phẩm này bao nhiêu vậy",
"changes": [
{
"from": "ko",
"to": "không",
"start": 0,
"end": 2,
"rule": "abbreviation"
},
{
"from": "dc",
"to": "được",
"start": 3,
"end": 5,
"rule": "abbreviation"
},
{
"from": "j",
"to": "gì",
"start": 6,
"end": 7,
"rule": "abbreviation"
},
{
"from": "ơiiii",
"to": "ơi",
"start": 16,
"end": 21,
"rule": "repeated letters"
},
{
"from": "sp",
"to": "sản phẩm",
"start": 23,
"end": 25,
"rule": "abbreviation (context)"
},
{
"from": "nàyyy",
"to": "này",
"start": 26,
"end": 31,
"rule": "repeated letters"
},
{
"from": "bn",
"to": "bao nhiêu",
"start": 32,
"end": 34,
"rule": "abbreviation (context)"
},
{
"from": "z",
"to": "vậy",
"start": 35,
"end": 36,
"rule": "abbreviation"
}
],
"count": 8,
"emojis": 0,
"dictionary_size": 273,
"note": "Rule-based: ambiguous short forms (k, v, bn, ck, s, h…) are replaced only in clear contexts. Add diacritics with /v1/vn-diacritics if the text has none."
}
Use cases
- Pre-process comments for sentiment analysis or moderation
- Normalise chatbot input before intent matching
- Clean livestream comments before order extraction
- Improve search on informal product reviews
FAQ
Can it get ambiguous words wrong?
Short forms such as k, v, bn, ck, s or h are only replaced when the neighbouring words make the meaning clear; otherwise they are left unchanged, so the output stays safe.
Can I add my own abbreviations?
Yes: pass "dictionary": {"abbr": "replacement"} (up to 500 entries). They take priority over the built-in list.
Does it add missing accents?
No, it only expands abbreviations and fixes repeated letters. Use /v1/vn-diacritics to restore accents.
Related APIs
Text Diff
Compare two texts by lines, words, characters, sentences or JSON and get the changes, a similarity score and a unified diff patch.
a-bSlugify
Turn titles into clean URL slugs: accents removed (Vietnamese đ included), custom separator, optional case keeping and maximum length.
123Text Statistics
Count words, characters, sentences, paragraphs and lines, estimate reading and speaking time, and list the most frequent words of a text.