asomiya 0.2.0

Control flow

Working with text

Text (পাঠ) is written in double quotes. Asomiya understands Assamese properly: a letter with its vowel sign, or a conjunct like ক্ষ, counts as one character.

Joining text

+ joins text with any value:

ধৰা নাম = "অসম"
কোৱা("নমস্কাৰ, " + নাম + "! বছৰ: " + ২০২৬)
Output
নমস্কাৰ, অসম! বছৰ: ২০২৬
dhora naam = "Oxom"
kowa("Nomoskar, " + naam + "! bosor: " + 2026)
Output
Nomoskar, Oxom! bosor: 2026

Length

কোৱা(দৈৰ্ঘ্য("অসমীয়া"))
কোৱা(দৈৰ্ঘ্য("ক্ষমা"))
Output
৪
২
kowa(doirghyo("অসমীয়া"))
kowa(doirghyo("Oxom"))
Output
4
4

“অসমীয়া” has 5 characters as you would count them (অ, স, মী, য়া … ), not the 7 Unicode code points underneath.

Getting one character

Use [ ] with a position starting at ০:

ধৰা শব্দ = "অসমীয়া"
কোৱা(শব্দ[০], শব্দ[৩])
Output
অ য়া
dhora xobdo = "Oxomiya"
kowa(xobdo[0], xobdo[3])
Output
O m

Note

Text can’t be changed in place: শব্দ[০] = "ক" is an error (R016). Build a new text with + instead.

Special characters

কোৱা("প্ৰথম শাৰী\nদ্বিতীয় শাৰী")
কোৱা("তেওঁ ক'লে: \"নমস্কাৰ\"")
Output
প্ৰথম শাৰী
দ্বিতীয় শাৰী
তেওঁ ক'লে: "নমস্কাৰ"
kowa("prothom xari\ndwitiyo xari")
kowa("tew kole: \"Nomoskar\"")
Output
prothom xari
dwitiyo xari
tew kole: "Nomoskar"