# liblouis: Sesotho/Setswana/Sepedi braille code (grade 2)

#-index-name: Sesotho, contracted
#-display-name: Sesotho contracted braille

#-copyright: 2019, Greg Kearney
#-copyright: 2019, 2021, South African Braille Authority
#-license: LGPLv2.1

# Copyright (C) 2019 Greg Kearney <gkearney@gmail.com>
# Copyright (C) 2019, 2021 South African Braille Authority <http://www.sabrailleauthority.org.za>
#
# This file is part of liblouis.
#
# liblouis is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 2.1 of
# the License, or (at your option) any later version.
#
# liblouis is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with liblouis. If not, see
# <http://www.gnu.org/licenses/>.

#+language: st
#+type: literary
#+contraction: full
#+grade: 2

#+system: ubc-sotho
# "UBC" stands for "Unified Braille Code" and is a generalization of UEB.
# See https://sabrailleauthority.org.za/unified-braille-code-ubc.

# Sesotho, Setswana and Sepedi are three of the 11 official languages
# of South Africa and are mutually intelligible. Sesotho (or South
# Sotho) is spoken primarily in the Free State province of South
# Africa and is also an official language of Lesotho. Setswana is
# widely spoken in the northern provinces of South Africa and in
# Botswana. Sepedi is widely spoken in the northeastern provinces of
# South Africa.
#
# The languages use the roman alphabet and have one diacritic letter,
# š (s with caron).
#
# The languages all use the same braille code. It was developed over
# 30 years ago and after the adoption of the UEB in South Africa, the
# code was also unified according to the principles of the UEB. The
# code was developed around the structure of the language, therefore
# it is quite simple and does not require any complex rules. It has
# around 80 contractions and achieves a high degree of contraction,
# around 27%. We do not use additional codes such as Nemeth or
# computer braille codes; we use our unified Sotho code also for
# technical material.

# This table does bidirectional translation.
#+direction: both

# This table is maintained by Christo de Klerk <cjdk@mweb.co.za>
#-author: Christo de Klerk <cjdk@mweb.co.za>
#-maintainer: Christo de Klerk <cjdk@mweb.co.za>

# Begin entries

# Some sign definitions which might otherwise conflict with Sesotho contractions:
sign \x0024 56-4-234 $
sign \x00b0 56-45-245 °
sign \x00a7 56-45-234 § section
sign \x2122 56-45-2345 ™
sign \x25cb 56-1246-123456 ○   circle

include sot-za-g1.ctb
include IPA-unicode-range.uti

multind 56-6 nocontractsign capsletter

seqdelimiter -—
seqdelimiter ‐   \x2010
seqdelimiter ‑   \x2011
seqdelimiter –   \x2013
seqdelimiter —   \x2014
seqbeforechars ([{"“'‘
seqafterchars  )]}"”'’.,;:.!?…

noback correct "’" "'"
noback correct "ŉ" "'n"

attribute 1 AEIOUYÊËaeiouyêë vowels
attribute 2 BCDFGHJKLMNPQRSTVWXZbcdfghjklmnpqrstvwxz consonants
attribute 3 +=*,.;:?!"'“”‘’  punctuation with only lower dots (except hyphens)

# Shape symbols require a grade 1 indicator (Section 3.22.1)
contraction \x25a0 ■ filled (solid) square
contraction \x25a1 □ square
contraction \x25a7 ▧ shaded square (upper left to lower right)
contraction \x25b2 ▲ filled (solid) (equilateral) triangle
contraction \x25b3 △ regular (equilateral) triangle
contraction \x25cb ○ circle
contraction \x25cd ◍ shaded circle

# Single character word  contractions
contraction b
contraction B
word bona 12
contraction c
contraction C
word gagwe 14
contraction f
contraction F
word feela 124
contraction g
contraction G
word gantši 1245
contraction h
contraction H
word hore 125
contraction j
contraction J
word jaaka 245
contraction k
contraction K
word kwa 13
contraction l
contraction L
word lena 123
contraction m
contraction M
word motho 134
contraction n
contraction N
word nna 1345
contraction r
contraction R
word ruri 1235
contraction s
contraction S
word sa 234
contraction t
contraction T
word tsebe 2345
contraction w
contraction W
word wena 2456
contraction x
contraction X
word gomme 1346
contraction y
contraction Y
word yena 13456
contraction z
contraction Z
word gore 1356
word ngwana 23456

# Group signs
always ka 12346
always ke 123456
always na 12356
always re 2346
always ng 23456
always ba 126
always le 146
always ma 1456
always se 156
always di 1246
always bo 12456
always go 1256
always lo 246
always ga 34
always la 346
always mo 16
always me 345

# Lower signs
noback match %[^_]|%[^_~]%<*[([{] be %[^_]|[)}\\]]%>*%[^_~] 23
begmidword be 23
begmidword ph 25
noback match %[^_]|%[^_~]%<*[([{] ye %[^_]|[)}\\]]%>*%[^_~] 256
begword ye 256
noback match %[^_]|%[^_~]%<*[([{] wa %[^_]|[)}\\]]%>*%[^_~] 26
partword wa 26
noback match %[^_]|%[^_~]%<*[([{] fo %[^_]|[)}\\]]%>*%[^_~] 235
begmidword fo 235
noback match %[^_]|%[^_~]%<*[([{] ge %[^_]|[)}\\]]%>*%[^_~] 2356
midword ge 2356
noback match %[^_]|%[^_~]%<*[([{] ya %[^_]|[)}\\]]%>*%[^_~] 35
partword ya 35
begmidword th 356

# Dot 4 contractions
always še 4-156

# Dot 5 contractions
always batho 5-12
always empa 5-15
always fale 5-124
always gape 5-1245
always hobane 5-125
always jale 5-245
always kgakala 5-13
always maabane 5-134
always neng 5-1345
always pele 5-1234
always tsa 5-234
always tša 5-2345
always eupša 5-136
always gantsi 5-1346
always yona 5-13456
always ngata 5-23456
always gonne 5-1256
always mongwe 5-16

# Dots 45 contractions
always hae 45-125
always jalo 45-245
always mosadi 45-134
always ngwe 45-1345
always pela 45-1234
always tše 45-2345
always tšwe 45-234

# Dots 456 contractions
always fela 456-124
always godimo 456-1245
always hape 456-125
always jwalo 456-245
always kwana 456-13
always mono 456-134
always nako 456-1345
always pelo 456-1234
always rona 456-1235
always tšwa 456-234
always tswe 456-2345

# Shortforms
contraction HM
contraction hm
word hodimo 125-134
contraction JW
contraction jw
word jwale 245-2456
