Lazy syllable macros, or lazy macros for short, are a special type of macros that work only when they appear after Vietnamese consonants that begin a new word. Lazy syllables are smart in the sense that the expansion occurs if and only if the resulting word is Vietnamese. Lazy macros are invented by the author based on observations on Vietnamese syllables and keyboard layouts.
Observations on Vietnamese consonants:
There are 25 Vietnamese consonants or groups of consonants that begin Vietnamese words:
b, c, ch, d, dd, g, gh, h, k, kh, l, m, n, ng, ngh, nh, p, ph, q, s, t, th, tr, v, x
The following consonants are not Vietnamese and normally do not appear in Vietnamese words: f, j, w, z. However, they are sometimes used in informal writing.
If a Vietnamese word begins with one or two consonants, the following consonants cannot occur immediately after the leading consonant(s):
b, c, d, k, l, m, n, p, q, s, t, v, x, in addition to f, j, w, z.
Note that some of these consonants may appear at the end of Vietnamese words, e.g., lźn, tam. But they must appear after vowels and never immediately after the starting consonants of Vietnamese words. Note also the list does not contain 'h' because 'h' can appear after c, g, k, n, p, and t.
Vietnamese words never contains double identical consonants such as bb, cc, tt, etc.
Most Vietnamese syllables contain one or two and sometimes three accent marks (ta^n, tu+o+ng, tu+o+?ng). The accent marks slow down typing significantly if they require the SHIFT key frequently. Thus using macros to speed up syllable typing is a good solution to this problem. The general rule of thumb is to define macros that require one or two keystrokes only. A fair comparison of macro performance is to compare the number of keystrokes required to type the macro. The fewer the better. For example:
typing Q costs two keystrokes (hold down SHIFT key while pressing q)
typing qw costs two keystrokes
but typing qq is considered to cost 1.5 keystrokes because repeating the same key is faster than typing two different keys.
typing + costs two keystrokes on US keyboard (hold down SHIFT key while pressing q)
typing = costs one keystroke on US keyboard
When defining macros for Vietnamese syllables, try to avoid sequences of letters that are legal for Vietnamese words
because they interfere with normal Vietnamese typing.
For example, it is bad practice to define "ma" or "en" as macro because both are valid Vietnamese words or syllables. If you do choose them and if you don't want them to expand, you have to escape the last letter of the macro. In the said example you have to type "m\a" to get "ma" and "e\n" to get "en". This is cumbersome.
Therefore, it is best to choose sequences of letters or symbols that are illegal and never used in normal Vietnamese text. We will first consider symbols, then letters.
A number of keyboard symbols are frequently used to represent Vietnamese accent marks such as ^ ( + ' ` ? ~ . when typed after vowels or at the end of words. In other words, these symbols never follow Vietnamese consonants. In fact, most if not all symbols never follow consonants in normal Vietnamese text.
For example, the symbol ^ never follows a consonant. Because it looks like the cover of a pan (na('p vung), we can define it as a macro that expands into "ung". The existing WinVNKey macro infrastructure already provides support for this kind of macro. Simply define the following macros:
up to 25 lower case macros: b^, c^, ch^, ...
up to 25 upper case macros: B^, C^, CH^, ...
Thus each symbol can have up to 50 macro definitions. Because each keyboard typically has a large number of symbols (32 on a US keyboard), this method leads to a very large number of macros and affects performance because of longer search time. In addition, to be any useful, these macros must expand when and only when they begin a word. Therefore, WinVNKey offers an alternative method. This method is based on spelling rule as opposed to the search-and-match rule for general-purpose macros. This results in "Syllable Macros" in WinVNKey 4.0.
In Syllable Macros only the letter or letters that represent the syllables are listed. For example, there is only one entry listed for ^ because it represents a single syllable "ung". This reduces the number of macros significantly, from 50 to 1.
As implied by the name, all syllable macros expand when and only when they appear immediately after Vietnamese consonants. Hereafter, the term syllable macro is reserved for any macro that meets all three following criteria:
represents a complete Vietnamese syllable (e.g. ung) or partial Vietnamese syllable (e.g. ươ)
is smart enough to expand
when it appears after Vietnamese consonants only, and
when the expansion results in a Vietnamese word that is legitimate (e.g. cung) or partially legitimate (e.g. incomplete word such as cươ).
For example, if ^ stands for "ung", then WinVNKey is smart enough not to expand gh^, k^, ngh^, p^, and q^. However, WinVNKey will expand ng^ into ngung. The reason for expansion is that although ngung does not exist in dictionary, it is Vietnamese-pronounceable and can be made good Vietnamese by adding ' or ` (e.g. ngại ngłng).
WinVNKey has come up with tips to help users memorize the symbol macros easily. For example,
` is read "da^'u huye^`n", which has the uye^n sound, hence ` is defined to be uye^n.
# looks like a ladder, which is read "ca'i thang", which has the ang sound, hence # is defined to be ang.
If a Vietnamese word begins with one or two consonants, the following consonants cannot appear immediately after the leading consonant(s):
b, c, d, k, l, m, n, p, q, s, t, v, x, in addition to f, j, w, z.
Thus these consonants can be defined as quick syllable macro, such as:
b --> ach, c --> ươc, t --> ươt, j --> ương.
For example, typing nc automatically changes into nươc. But lasy syllables are smart; typing kc does not expand into kươc because such word is in no way Vietnamese.
Note that typing st expands into sươt, which is fine if the user is typing Vietnamese text only. But if the user is typing both English and Vietnamese text, the result may not be what he wants. For instance, he may have wanted to type "state". To prevent expansion, he has to use a backslash: s\tate. Thus using a single consonant letter macro may create more nuisance than benefits for multilingual text. This leads to the next point.
Many double consonants are not used in Vietnamese words: bb, cc, dd, ff, ... They are also rarely used after another consonant in English. For example, "babbage" has double b but bb follows a vowel, not a consonant. Similarly, "accent" has double c but cc follows a vowel, not a consonant. Thus for typing text that contains both English and Vietnamese, it is better to use double consonants to define Vietnamese syllables:
bb --> ach, cc --> ươc.