aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2021-04-20 20:11:38 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2021-04-20 20:11:38 +0200
commitc203a5f626ba635ab3e4c5e9c3a9f79e44503a6e (patch)
tree300b868899ed2bc2488bbfc5f71c00df96e29898
parent086a5861def11036b897c8b21be9af17bbeacc29 (diff)
downloadopenrussian-cli-c203a5f626ba635ab3e4c5e9c3a9f79e44503a6e.tar.gz
fixed formatting of adjectives where the declension ids are missing (affects only "fri")1.0.0
-rwxr-xr-xopenrussian.lua34
1 files changed, 18 insertions, 16 deletions
diff --git a/openrussian.lua b/openrussian.lua
index 39677de..961efdc 100755
--- a/openrussian.lua
+++ b/openrussian.lua
@@ -219,23 +219,25 @@ function format.adjective(word_id, accented)
-- NOTE: Seldomly (e.g. nesomnenno), there is no entry in adjectives
if not row then return end
- out_stream:write('.SH DECLENSION\n',
- '.TS\n',
- 'allbox,tab(;);\n',
- 'L LB LB LB LB\n',
- 'LB L L L L.\n',
- ';Male;Neutral;Female;Plural\n')
- format_declensions(row.decl_m_id, row.decl_n_id, row.decl_f_id, row.decl_pl_id)
- if row.short_m or row.short_n or row.short_f or row.short_pl then
- out_stream:write('Short;',
- map_tbl(row.short_m or '-'), ';',
- map_tbl(row.short_n or '-'), ';',
- map_tbl(row.short_f or '-'), ';',
- map_tbl(row.short_pl or '-'), '\n')
+ if row.decl_m_id and row.decl_n_id and row.decl_f_id and row.decl_pl_id then
+ out_stream:write('.SH DECLENSION\n',
+ '.TS\n',
+ 'allbox,tab(;);\n',
+ 'L LB LB LB LB\n',
+ 'LB L L L L.\n',
+ ';Male;Neutral;Female;Plural\n')
+ format_declensions(row.decl_m_id, row.decl_n_id, row.decl_f_id, row.decl_pl_id)
+ if row.short_m or row.short_n or row.short_f or row.short_pl then
+ out_stream:write('Short;',
+ map_tbl(row.short_m or '-'), ';',
+ map_tbl(row.short_n or '-'), ';',
+ map_tbl(row.short_f or '-'), ';',
+ map_tbl(row.short_pl or '-'), '\n')
+ end
+ -- NOTE: It is unclear why the trailing .sp is necessary
+ out_stream:write('.TE\n',
+ '.sp\n')
end
- -- NOTE: It is unclear why the trailing .sp is necessary
- out_stream:write('.TE\n',
- '.sp\n')
if row.comparative and row.comparative ~= "" then
out_stream:write('.SH COMPARATIVE\n',