စံကား

10

Natural Zaka

Choose the sentence endings and particles a Burmese reader expects.

Zaka accepts each of the endings သည်, ပါ, ပါသည်, or none at all, on a verb. The program runs in all these cases. But a Burmese speaker picks the ending from what comes next, and some choices sound wrong. Zaka's naturalness check points these out as warnings. A warning never stops the program. It suggests a more natural spelling.

စံကားZK0502

Expected warning

warning[ZK0502]: "ကြီးသည်" before "လျှင်" reads better without the particle
help: write "ကြီးလျှင်", or keep the particle and write "ဖြစ်လျှင်"

Follow the help line and the warning disappears:

စံကား

Expected output

အရွယ်ရောက်
အရွယ်ရောက်

The rules

CodeWhenWriteNot
ZK0501a "not" verb before သို့မဟုတ် (or)မငယ်ပါ သို့မဟုတ်မငယ်သည် သို့မဟုတ်
ZK0502before attached လျှင် or နေသရွေ့ကြီးလျှင်, ကြီးနေသရွေ့ကြီးသည်လျှင်
ZK0503on မဟုတ် (not)မဟုတ်ပါ or မဟုတ်မဟုတ်သည်
ZK0504before ဖြစ်၍ (and)ကြီးသည် ဖြစ်၍ကြီးပါ ဖြစ်၍
ZK0505printing text or a whole sentence"..." ဟု ပြသပါ"..." ကို ပြသပါ
ZK0506printing a plain valueအသက် ကို ပြသပါအသက် ဟု ပြသပါ
ZK0507parentheses that change nothingက + ၁ ကို ပြသပါ(က + ၁) ကို ပြသပါ
ZK0508a sentence used as a value (stored, returned, passed)... ကြီးသည် ဖြစ်ပါစေ... ကြီးပါ ဖြစ်ပါစေ

The "Not" column is still valid Zaka. It just sounds less natural.

More examples

"Not" verbs (မညီ, မကြီး, မငယ်, မမှန်, မဟုတ်) take ပါ before "or":

စံကားZK0501

Expected warning

warning[ZK0501]: "မငယ်သည်" before "သို့မဟုတ်" reads better as "မငယ်ပါ"

A sentence joined with "and", or one used as a value, takes သည်:

စံကားZK0504ZK0508

Expected warning

warning[ZK0504]: "ကြီးပါ" before "ဖြစ်၍" reads better as "ကြီးသည်"
warning[ZK0508]: "ကြီးပါ" as a value reads better as "ကြီးသည်"

The same program, in its natural form:

စံကား

Expected output

မှန်
မှန်
မှန်

Strict mode

To treat these warnings as errors, so that a program with one or more of them does not run, pass --strict-particles:

zakac run --strict-particles program.zaka

This is useful once the rules feel familiar and each new program should sound natural.

Hands on

  • Take a program from an earlier chapter and change the endings until it warns. Then follow the help lines back.

Next: Example programs.