summaryrefslogtreecommitdiff
path: root/server.rb
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2016-05-10 10:49:09 +0200
committerPatrick Simianer <p@simianer.de>2016-05-10 10:49:09 +0200
commit6bd7135e6039b0682f49234e42451077413f0bd9 (patch)
treee30c76fbbea82f89dd10e56c35e70ec357bb24b4 /server.rb
parent96d6f8a3fc83e075f8054d48ea8c6973ca534b65 (diff)
count clicks and keystrokes, fix bug in rule addition, good params and improvement for phrase2 extraction
Diffstat (limited to 'server.rb')
-rwxr-xr-xserver.rb10
1 files changed, 6 insertions, 4 deletions
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(" ||| ")