1
0
Fork 0

Return inflection ID

This commit is contained in:
Alex Kotov 2023-03-26 06:54:24 +04:00
parent 702dadfa00
commit 084222667a
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
1 changed files with 9 additions and 3 deletions

12
main.rb
View File

@ -180,7 +180,11 @@ public
result = @db_conn.exec_params(
(
<<~SQL
SELECT inflections.descr, word_forms.value, word_forms.other_word_id
SELECT
inflections.id,
inflections.descr,
word_forms.value,
word_forms.other_word_id
FROM words
INNER JOIN parts
ON parts.id = words.part_id
@ -199,7 +203,8 @@ public
).to_a
result.map do |row|
descr = String(row['descr']).strip.freeze
inflection_id = Integer row['id']
inflection_descr = String(row['descr']).strip.freeze
value = String(row['value']).strip.freeze
value = nil if value.empty?
@ -209,7 +214,8 @@ public
end
{
descr: descr,
inflection_id: inflection_id,
inflection_descr: inflection_descr,
value: value,
other_word_id: other_word_id,
}