Skip to content

Commit

Permalink
Revert "DEBUG output translate2"
Browse files Browse the repository at this point in the history
This reverts commit 35935e9.
  • Loading branch information
jfikejs committed Jan 29, 2025
1 parent 35935e9 commit d00c9ed
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions czjapp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -393,17 +393,14 @@ def find_closest_match(search, possible_matches, max_distance)
end

def process_multisyllabic_search(words_array, possible_matches, dict, code, params)
puts "DEBUG: Calling multi_search: #{@search}"
words_array.shift if words_array.first.length <= 2
while words_array.size > 0
puts "DEBUG: Calling closest_match: #{words_array.first}"
closest_match = find_closest_match(words_array.first, possible_matches, 2)
if closest_match
@resultinfo3 = true
@search = closest_match
return dict.translate2(code, params['target'], closest_match, params['type'], params['start'].to_i, params['limit'].to_i)
else
puts "DEBUG: closest_match FALSE > shift"
words_array.shift
end
end
Expand All @@ -413,7 +410,6 @@ def process_multisyllabic_search(words_array, possible_matches, dict, code, para
def process_single_word_search(search, possible_matches, dict, code, params)
search.slice!(0, 2) if search.start_with?("ne") && (code == "cs" || code == "sk") && search.length > 4
@resultinfo1 = true
puts "DEBUG: Calling single_search: #{@search}"
while search.length > 1
closest_match = find_closest_match(search, possible_matches, 2)
if closest_match
Expand All @@ -424,7 +420,6 @@ def process_single_word_search(search, possible_matches, dict, code, params)
if search.length >= 10
search = search[0, [search.length / 2, 1].max]
else
puts "DEBUG: closest_match FALSE > shorting"
search.slice!(-2, 2)
end
@resultinfo1 = false if @resultinfo1
Expand Down Expand Up @@ -792,7 +787,7 @@ def process_single_word_search(search, possible_matches, dict, code, params)
content_type :json
body = dict.get_videoreport(params).to_json
end
get '/'+code+'/videoreport' do
get '/'+code+'/csvvideoreport' do
content_type 'text/csv; charset=utf-8'
attachment 'export.csv'
csv = ['název;hesla;autor;zdroj;autor videa;datum']
Expand Down

0 comments on commit d00c9ed

Please sign in to comment.