llt-review 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/llt/review/api.rb +1 -1
- data/lib/llt/review/api/helpers.rb +2 -2
- data/lib/llt/review/common/reviewable.rb +1 -1
- data/lib/llt/review/version.rb +1 -1
- data/views/comparison_header.haml +1 -1
- data/views/index.haml +64 -63
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9452660774fe663f7ca4154dee4c92e1b89e6fa6
|
4
|
+
data.tar.gz: ee9ed9546e927348aff02c45e8998d777cdde2f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e063b8af18c0ff106f40edaaca312fc25928fd4f88b464fa35d62b53cbd7140b2af04259440345a5649205cceddafc2d8bfdb64dc5ab3a43145a4b1d690f0d9
|
7
|
+
data.tar.gz: 63c20609d6f8ea55fa8f08bc1c9e1cd5995dc98d9a1bb27d9a86613b5c1174c46fd40a80a6d5764d3e0f69bc1604b49587afdf01b5a61c0893293e0f1733da2c
|
data/lib/llt/review/api.rb
CHANGED
@@ -44,7 +44,7 @@ class Api < Sinatra::Base
|
|
44
44
|
if backend = params[:backend]
|
45
45
|
p = case backend
|
46
46
|
when 'perseids' then 'sosol.perseids.org/sosol'
|
47
|
-
when 'perseids-dev' then 'sosol-rep.perseids.org'
|
47
|
+
when 'perseids-dev' then 'sosol-rep.perseids.org/sosol'
|
48
48
|
end
|
49
49
|
|
50
50
|
expand_perseids_urls(params, :gold, p)
|
@@ -15,8 +15,8 @@ module LLT
|
|
15
15
|
/(.*?)(\.([\w]*?))?$/.match(last)[1]
|
16
16
|
end
|
17
17
|
|
18
|
-
def arethusa(rev, gold,
|
19
|
-
path = "http://sosol.perseids.org/tools/arethusa/app/#/
|
18
|
+
def arethusa(rev, gold, chunk = nil, word = nil)
|
19
|
+
path = "http://sosol.perseids.org/tools/arethusa/app/#/perseids_review"
|
20
20
|
path << "?doc=#{rev}&gold=#{gold}"
|
21
21
|
if chunk || word
|
22
22
|
path << "&chunk=#{chunk}" if chunk
|
data/lib/llt/review/version.rb
CHANGED
data/views/index.haml
CHANGED
@@ -29,71 +29,72 @@
|
|
29
29
|
%tr
|
30
30
|
= haml :report_columns, locals: { label: label, report: obj }
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
-
|
35
|
-
|
32
|
+
- unless c.one? # means that the container has only a report, but no diffs
|
33
|
+
%h4.center.underline Diff
|
34
|
+
- c.each do |s_id, s_diff|
|
35
|
+
- next if s_id == :report
|
36
|
+
- sentence = rev.sentences[s_id]
|
36
37
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
38
|
+
.sentence
|
39
|
+
%p
|
40
|
+
%strong.big.yellow
|
41
|
+
= s_id
|
42
|
+
- sentence.each do |w_id, w|
|
43
|
+
- attrs = { id: to_id(s_id, w_id), class: 'token' }
|
44
|
+
- if w_diff = s_diff[w_id]
|
45
|
+
- attrs[:tooltip] = w_diff.map { |k, v| to_tooltip(k, v) }.join("\n")
|
46
|
+
- if heads = extract_heads(w_diff, s_id)
|
47
|
+
- attrs[:hr] = heads[0]
|
48
|
+
- attrs[:hw] = heads[1]
|
49
|
+
- attrs[:class] << ' head-error'
|
50
|
+
- attrs[:class] << ' error tooltip'
|
51
|
+
%span{attrs}
|
52
|
+
= haml :token, locals: { form: w.form, id: w_id }
|
52
53
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
54
|
+
%div.word-diff-container
|
55
|
+
.h4.clickable.underline{style: 'margin-left: 20px'} Diffs per Word
|
56
|
+
%table.word-diff-table
|
57
|
+
%tr{style: 'width: 28%'}
|
58
|
+
%th.center
|
59
|
+
%th.center head
|
60
|
+
%th.center relation
|
61
|
+
%th.center lemma
|
62
|
+
%th.center postag
|
63
|
+
- sentence.each do |w_id, w|
|
64
|
+
%tr
|
65
|
+
- w_diff = s_diff[w_id]
|
66
|
+
- errors = w_diff ? w_diff.container : {}
|
67
|
+
%td.first.large
|
68
|
+
- icon, cl = errors.empty? ? ['✔', :success] : ['✘', :error]
|
69
|
+
%span{class: cl}
|
70
|
+
= icon
|
71
|
+
= haml :token, locals: { form: w.form, id: w_id }
|
71
72
|
|
72
|
-
|
73
|
-
|
73
|
+
- tds = { head: [], relation: [], lemma: [], postag: ['center', 'postag'] }
|
74
|
+
- tds.each do |category, classes|
|
74
75
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
76
|
+
- error = errors[category]
|
77
|
+
- cl = error ? 'error-bg' : 'success-bg'
|
78
|
+
%td{class: [cl, 'small'] + classes}
|
79
|
+
- val = (error ? error.new : w[category]).to_s
|
80
|
+
- if category == :head
|
81
|
+
- parsed_head = sentence[val.to_i]
|
82
|
+
- f, id = parsed_head ? [parsed_head.form, parsed_head.id] : ["ROOT", 0]
|
83
|
+
= haml :token, locals: { form: f, id: id }
|
84
|
+
- else
|
85
|
+
%span
|
86
|
+
= val
|
87
|
+
%tr
|
88
|
+
- total = sentence.container.length
|
89
|
+
- wrongs = [s_diff.container.length]
|
90
|
+
- categories = %i{ head relation lemma postag };
|
91
|
+
- wrongs += categories.map do |cat|
|
92
|
+
- s_diff.container.inject(0) { |m, (_, w_diff)| m += w_diff[cat] ? 1 : 0 }
|
93
|
+
- wrongs.each do |wrong|
|
94
|
+
- percent = to_percent(total, total - wrong)
|
95
|
+
%td.center
|
96
|
+
= haml :percentage, locals: { percentage: percent }
|
96
97
|
|
97
|
-
|
98
|
-
|
99
|
-
|
98
|
+
.center.small
|
99
|
+
%a{ href: arethusa(extracted_id(rev.id), extracted_id(gold.id), s_id)}
|
100
|
+
View in Arethusa
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: llt-review
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- LFDM
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|