blob: 5f4def72bf3f88cd811b89cbd8da59c581b42aa2 [file] [log] [blame]
# liblouis: Russian literary text translation table
#
# Copyright (C) 2013 Igor B. Poretsky <poretsky@mlbox.ru>
#
# 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 3 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/>.
# Display and character definitions:
include ru-letters.dis
include ru-chardefs.cti
include en-chardefs.cti English character definitions
# Braille indicators:
numsign 3456 number sign, just a dots operand
# Emphasis indication signs:
emphclass italic
emphclass underline
emphclass bold
begemphphrase italic 456
endemphphrase italic after 456
begemphphrase bold 34
endemphphrase bold after 34
# The decimal digits:
include litdigits6Dots.uti
# Punctuations:
decpoint , 2
prepunc " 236
postpunc " 356
postpunc ,\s 2
postpunc ;\s 23
hyphen - 36
noback always . 256
noback always , 2
noback always ; 23
noback always : 25
noback always ? 26
noback always ! 235
noback always ' 3
noback always ` 4
# Special symbols:
always @ 4-1
always # 4-1345
always $ 4-145
always % 3456-245-356
always ^ 56-26
always & 6-12346
noback always * 35
noback always ( 126
noback always ) 345
always _ 6-25
always [ 6-12356
always ] 6-23456
always { 46-126
always } 46-345
always \\ 4-16
always | 456-3
always ~ 5-26
# mathematical symbols:
noback always - 36
always + 0-235
always / 6-34
always < 0-25-246-0
always > 0-135-25-0
always = 0-2356
# Symbol classes for special rules below:
class upperlatin ABCDEFGHIJKLMNOPQRSTUVWXYZ
class lowerlatin abcdefghijklmnopqrstuvwxyz
class uppercyrillic \x0401\x0410\x0411\x0412\x0413\x0414\x0415\x0416\x0417\x0418\x0419\x041A\x041B\x041C\x041D\x041E\x041F\x0420\x0421\x0422\x0423\x0424\x0425\x0426\x0427\x0428\x0429\x042A\x042B\x042C\x042D\x042E\x042F
class lowercyrillic \x0430\x0431\x0432\x0433\x0434\x0435\x0436\x0437\x0438\x0439\x043A\x043B\x043C\x043D\x043E\x043F\x0440\x0441\x0442\x0443\x0444\x0445\x0446\x0447\x0448\x0449\x044A\x044B\x044C\x044D\x044E\x044F\x0451
class latin ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
class cyrillic \x0401\x0410\x0411\x0412\x0413\x0414\x0415\x0416\x0417\x0418\x0419\x041A\x041B\x041C\x041D\x041E\x041F\x0420\x0421\x0422\x0423\x0424\x0425\x0426\x0427\x0428\x0429\x042A\x042B\x042C\x042D\x042E\x042F\x0430\x0431\x0432\x0433\x0434\x0435\x0436\x0437\x0438\x0439\x043A\x043B\x043C\x043D\x043E\x043F\x0440\x0441\x0442\x0443\x0444\x0445\x0446\x0447\x0448\x0449\x044A\x044B\x044C\x044D\x044E\x044F\x0451
swapcd updigit 1234567890 1,12,14,145,15,124,1245,125,24,245
swapdd uppertolower 17,127,147,1457,157,1247,12457,1257,247,2457,137,1237,1347,13457,1357,12347,123457,12357,2347,23457,1367,12367,24567,13467,134567,13567,179,1279,1479,14579,1579,12479,124579,12579,2479,24579,1379,12379,13479,134579,13579,123479,1234579,123579,23479,234579,13679,245679,134679,135679,1679,1234679,15679,1235679,234679,2345679,24679,125679,124679 1,12,14,145,15,124,1245,125,24,245,13,123,134,1345,135,1234,12345,1235,234,2345,136,1236,2456,1346,13456,1356,19,129,149,1459,159,1249,12459,1259,249,2459,139,1239,1349,13459,1359,12349,123459,12359,2349,23459,1369,24569,13469,13569,169,123469,1569,123569,23469,234569,2469,12569,12469
# Adjust spacing around dashes according to the Russian braille rules.
noback context `["-\s"] @36
noback context [$s]"-"$s ?
noback context [$d]"-" %updigit@0
# Mark cyrillic letters immediately following digits.
noback context [$d]%uppercyrillic %updigit@45#1=0
noback context [$d]%lowercyrillic %updigit@5#1=0
# Mark lowercase latin letters where it is required.
noback context !#1=0[]%cyrillic #1=0
noback context #1=1[$d]%lowerlatin %updigit@6
noback context !#1=1[]%lowerlatin #1=1@6
noback context !#1=1[]%upperlatin #1=1
# Make space before text following number with punctuation.
noback context [$d","]$l %updigit@2-0
noback context [$d",\s"]$l %updigit@2-0
noback context [$d";"]$l %updigit@23-0
noback context [$d";\s"]$l %updigit@23-0
# Mark cyrillic letters immediately following latins.
noback pass2 %lowerlatin[]%uppercyrillic @45#1=0
noback pass2 %lowerlatin[]%lowercyrillic @5#1=0
noback pass2 #1=1[]%uppercyrillic @45#1=0
noback pass2 #1=1[]%lowercyrillic @5#1=0
# Mark uppercase latin letters where it is appropriate.
noback pass2 !%upperlatin *#1=0
noback pass2 !#1=1[]%upperlatin #1=1@46
# Format dialogs and direct speech according to the Russian braille tradition.
noback pass3 `@36 *#1=1
noback pass3 @236 *#1=1
noback pass3 @356 *#1=0
noback pass3 #1=1@2@36@0 *#1=2
noback pass3 #1=1@26@36@0 *#1=2
noback pass3 #1=1@235@36@0 *#1=2
noback pass3 #1=2@2[@36@0] @0-36
noback pass3 #1=2@256[@36@0] @0-36
# Remove dot 7 from uppercase letters
noback pass4 %uppertolower %uppertolower