• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sile-typesetter / sile / 11770252752

11 Nov 2024 01:09AM UTC coverage: 32.853% (-27.5%) from 60.402%
11770252752

Pull #2164

github

web-flow
chore(deps): Bump DeterminateSystems/nix-installer-action from 14 to 15

Bumps [DeterminateSystems/nix-installer-action](https://github.com/determinatesystems/nix-installer-action) from 14 to 15.
- [Release notes](https://github.com/determinatesystems/nix-installer-action/releases)
- [Commits](https://github.com/determinatesystems/nix-installer-action/compare/v14...v15)

---
updated-dependencies:
- dependency-name: DeterminateSystems/nix-installer-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #2164: chore(deps): Bump DeterminateSystems/nix-installer-action from 14 to 15

5855 of 17822 relevant lines covered (32.85%)

2493.73 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/languages/tr/init.lua
1
-- Different years of TDK and various publisher style guides differ on this point.
2
-- Current official guidance suggests dropping the hyphenation mark if the break
3
-- occurs at an apostrophe (kesme işareti). Some older guidance and some publishers
4
-- suggest dropping the apostrophe instead.
5
SILE.settings:declare({
×
6
   parameter = "languages.tr.replaceApostropheAtHyphenation",
7
   type = "boolean",
8
   default = false,
9
   help = "If enabled, substitute the apostophe for a hyphen at break points, otherwise keep the apostrophe and hide the hyphen.",
10
})
11

12
-- Quotes may be part of a word in Turkish
13
SILE.nodeMakers.tr = pl.class(SILE.nodeMakers.unicode)
×
14
SILE.nodeMakers.tr.wordTypes = { cm = true, qu = true }
×
15

16
local hyphens = require("languages.tr.hyphens")
×
17
SILE.hyphenator.languages["tr"] = hyphens
×
18

19
SILE.hyphenator.languages["tr"].hyphenateSegments = function (node, segments, j)
×
20
   local hyphenChar, replacement
21
   local maybeNextApostrophe = #segments > j and luautf8.match(segments[j + 1], "^['’]")
×
22
   if maybeNextApostrophe then
×
23
      segments[j + 1] = luautf8.gsub(segments[j + 1], "^['’]", "")
×
24
      if SILE.settings:get("languages.tr.replaceApostropheAtHyphenation") then
×
25
         hyphenChar = SILE.settings:get("font.hyphenchar")
×
26
      else
27
         hyphenChar = maybeNextApostrophe
×
28
         replacement = SILE.shaper:createNnodes(maybeNextApostrophe, node.options)
×
29
      end
30
   else
31
      hyphenChar = SILE.settings:get("font.hyphenchar")
×
32
   end
33
   local hyphen = SILE.shaper:createNnodes(hyphenChar, node.options)
×
34
   return SILE.types.node.discretionary({ replacement = replacement, prebreak = hyphen }), segments
×
35
end
36

37
-- Internationalization stuff
38

39
-- local sum_tens = function (val, loc, digits)
40
--   local ten = string.sub(digits, loc+1, loc+1)
41
--   if ten:len() == 1 then val = val + tonumber(ten) * 10 end
42
--   return val
43
-- end
44

45
local sum_hundreds = function (val, loc, digits)
46
   local ten = string.sub(digits, loc + 1, loc + 1)
×
47
   local hundred = string.sub(digits, loc + 2, loc + 2)
×
48
   if ten:len() == 1 then
×
49
      val = val + tonumber(ten) * 10
×
50
   end
51
   if hundred:len() == 1 then
×
52
      val = val + tonumber(hundred) * 100
×
53
   end
54
   return val
×
55
end
56

57
local tr_nums = function (num, ordinal)
58
   local abs = math.abs(num)
×
59
   if abs >= 1e+36 then
×
60
      SU.error("Numbers past decillions not supported in Turkish")
×
61
   end
62
   ordinal = SU.boolean(ordinal, false)
×
63
   local minus = "eksi"
×
64
   local zero = "sıfır"
×
65
   local ones = { "bir", "iki", "üç", "dört", "beş", "altı", "yedi", "sekiz", "dokuz" }
×
66
   local tens = { "on", "yirmi", "otuz", "kırk", "eli", "altmış", "yetmiş", "seksen", "doksan" }
×
67
   local places = {
×
68
      "yüz",
69
      "bin",
70
      "milyon",
71
      "milyar",
72
      "trilyon",
73
      "katrilyon",
74
      "kentilyon",
75
      "sekstilyon",
76
      "septilyon",
77
      "oktilyon",
78
      "nonilyon",
79
      "desilyon",
80
   }
81
   local zeroordinal = "sıfırıncı"
×
82
   local onesordinals =
83
      { "birinci", "ikinci", "üçüncü", "dördüncü", "beşinci", "altıncı", "yedinci", "sekizinci", "dokuzuncu" }
×
84
   local tensordinals = {
×
85
      "onuncu",
86
      "yirmiyinci",
87
      "otuzuncu",
88
      "kırkıncı",
89
      "eliyinci",
90
      "altmışıncı",
91
      "yetmişinci",
92
      "sekseninci",
93
      "Doksanıncı",
94
   }
95
   local placesordinals = {
×
96
      "yüzüncü",
97
      "bininci",
98
      "milyonuncu",
99
      "milyarıncı",
100
      "trilyonuncu",
101
      "katrilyonuncu",
102
      "kentilyonuncu",
103
      "sekstilyonuncu",
104
      "septilyonuncu",
105
      "oktilyonuncu",
106
      "nonilyonuncu",
107
      "desilyonuncu",
108
   }
109
   local digits = string.reverse(string.format("%.f", abs))
×
110
   local words = {}
×
111
   for i = 1, #digits do
×
112
      local val, place, mod = tonumber(string.sub(digits, i, i)), math.floor(i / 3), i % 3
×
113
      if #digits == 1 and val == 0 then
×
114
         words[#words + 1] = ordinal and zeroordinal or zero
×
115
      elseif val >= 1 or i > 1 then
×
116
         if i == 1 then
×
117
            words[#words + 1] = ordinal and onesordinals[val] or ones[val]
×
118
            ordinal = false
×
119
         elseif mod == 2 then
×
120
            if val >= 1 then
×
121
               words[#words + 1] = ordinal and tensordinals[val] or tens[val]
×
122
               ordinal = false
×
123
            end
124
         elseif mod == 1 then
×
125
            if sum_hundreds(val, i, digits) >= 1 then
×
126
               words[#words + 1] = ordinal and placesordinals[place + 1] or places[place + 1]
×
127
               ordinal = false
×
128
               if val > 0 and (i >= 7 or sum_hundreds(val, i, digits) >= 2) then
×
129
                  words[#words + 1] = ones[val]
×
130
               end
131
            end
132
         elseif mod == 0 then
×
133
            if val > 0 then
×
134
               words[#words + 1] = ordinal and placesordinals[1] or places[1]
×
135
               ordinal = false
×
136
            end
137
            if val >= 2 then
×
138
               words[#words + 1] = ones[val]
×
139
            end
140
         end
141
      end
142
   end
143
   if abs > num then
×
144
      words[#words + 1] = minus
×
145
   end
146
   SU.flip_in_place(words)
×
147
   return table.concat(words, " ")
×
148
end
149

150
SU.formatNumber.tr = {
×
151
   string = function (num, _)
152
      return tr_nums(num, false)
×
153
   end,
154
   ["ordinal-string"] = function (num, _)
155
      return tr_nums(num, true)
×
156
   end,
157
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc