From 6bd7135e6039b0682f49234e42451077413f0bd9 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Tue, 10 May 2016 10:49:09 +0200 Subject: count clicks and keystrokes, fix bug in rule addition, good params and improvement for phrase2 extraction --- server.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'server.rb') diff --git a/server.rb b/server.rb index 9ca43b1..599fdbd 100755 --- a/server.rb +++ b/server.rb @@ -295,6 +295,8 @@ def process_next reply $db['svg'] << data['svg'] $db['original_svg'] << data['original_svg'] $db['durations'] << data['duration'].to_f + $db['count_click'] << data['count_click'].to_i + $db['count_kbd'] << data['count_kbd'].to_i $db['post_edits_display'] << send_recv(:detokenizer, post_edit) $last_processed_postedit = $db['post_edits_display'].last # 1. tokenize @@ -423,13 +425,13 @@ def process_next reply all_rules[j] = ar end } - WriteFile.new(grammar).write all_rules.join("\n")+"\n" # - additional rules - logmsg :server, $new_rules.to_s + #logmsg :server, $new_rules.to_s if $new_rules.size > 0 - s = $new_rules.join "\n" - `echo "#{s}" >> #{grammar}` + all_rules += $new_rules + #`echo "#{s}" >> #{grammar}` end + WriteFile.new(grammar).write all_rules.join("\n")+"\n" #$new_rules.each { |rule| # logmsg :server, "adding rule '#{rule}' to grammar '#{grammar}'" # s = splitpipe(rule)[1..2].map{|i|i.strip.lstrip}.join(" ||| ") -- cgit v1.2.3