Opening punctuations are appended at the left end of sentences (i.e. ༈→བཀྲ་ཤིས་ཤོག)
Closing punctuations are appended at the right end of sentences (i.e. བཀྲ་ཤིས་ཤོག←།).
Spaces are always grouped with punctuation characters (i.e. ༈→བཀྲ་ཤིས་ཤོག)
Groups of punctuation characters containing one or more opening punctuation are treated as opening punctuation. (i.e. ༄༅། །→བཀྲ་ཤིས་ཤོག)
Groups of punctuation characters NOT containing one or more opening punctuation are treated as closing punctuation. (i.e. བཀྲ་ཤིས་ཤོག←། །།)
KNOWN LIMITATION: there are exceptions to the above punctuation group rules such as ། ༈ ། which contains both opening (༈) and closing (།) punctuation characters but needs to be handled by split into ། ། and ༈, respectively a closing and an opening puntuation group. However these cases are not very common and are ignored for now.
༈
→བཀྲ་ཤིས་ཤོག)།
).༈
→བཀྲ་ཤིས་ཤོག)༄༅། །
→བཀྲ་ཤིས་ཤོག)། །།
)KNOWN LIMITATION: there are exceptions to the above punctuation group rules such as
། ༈ །
which contains both opening (༈
) and closing (།
) punctuation characters but needs to be handled by split into། །
and༈
, respectively a closing and an opening puntuation group. However these cases are not very common and are ignored for now.