Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nopaque
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SFB 1288 - INF
nopaque
Commits
4ec3ce01
Commit
4ec3ce01
authored
4 years ago
by
Stephan Porada
Browse files
Options
Downloads
Patches
Plain Diff
Show right match_count per text, not per last incoming chunk
parent
baebdbe3
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
web/app/static/js/modules/corpus_analysis/client/callbacks.js
+17
-2
17 additions, 2 deletions
...app/static/js/modules/corpus_analysis/client/callbacks.js
web/app/static/js/modules/corpus_analysis/model/Results.js
+2
-0
2 additions, 0 deletions
web/app/static/js/modules/corpus_analysis/model/Results.js
with
19 additions
and
2 deletions
web/app/static/js/modules/corpus_analysis/client/callbacks.js
+
17
−
2
View file @
4ec3ce01
...
@@ -33,13 +33,24 @@ function prepareQueryData() {
...
@@ -33,13 +33,24 @@ function prepareQueryData() {
*/
*/
function
saveQueryData
()
{
function
saveQueryData
()
{
let
[
payload
,
client
,
results
,
rest
]
=
arguments
;
let
[
payload
,
client
,
results
,
rest
]
=
arguments
;
// Get data matches length before new chunk data is being inserted
let
dataLength
=
results
.
data
.
matches
.
length
;
let
dataLength
=
results
.
data
.
matches
.
length
;
if
(
client
.
dynamicMode
)
{
if
(
client
.
dynamicMode
)
{
// get data matches length before new chunk data is being inserted
// Incorporating new chunk data into full results
// incorporating new chunk data into full results
results
.
data
.
matches
.
push
(...
payload
.
chunk
.
matches
);
results
.
data
.
matches
.
push
(...
payload
.
chunk
.
matches
);
results
.
data
.
addData
(
payload
.
chunk
.
cpos_lookup
,
'
cpos_lookup
'
);
results
.
data
.
addData
(
payload
.
chunk
.
cpos_lookup
,
'
cpos_lookup
'
);
results
.
data
.
addData
(
payload
.
chunk
.
text_lookup
,
'
text_lookup
'
);
results
.
data
.
addData
(
payload
.
chunk
.
text_lookup
,
'
text_lookup
'
);
console
.
log
(
payload
.
chunk
.
text_lookup
);
/**
* Increment match_counts per text in a global results varaible because
* they are coming in chunkwise.
*/
for
(
let
[
text_key
,
value
]
of
Object
.
entries
(
payload
.
chunk
.
text_lookup
))
{
if
(
!
(
text_key
in
results
.
tmp_match_counts
))
{
results
.
tmp_match_counts
[
text_key
]
=
{
match_count
:
0
};
}
results
.
tmp_match_counts
[
text_key
].
match_count
+=
payload
.
chunk
.
text_lookup
[
text_key
].
match_count
;
}
results
.
data
.
cpos_ranges
=
payload
.
chunk
.
cpos_ranges
;
results
.
data
.
cpos_ranges
=
payload
.
chunk
.
cpos_ranges
;
let
queryFormElement
=
document
.
querySelector
(
'
#query-form
'
);
let
queryFormElement
=
document
.
querySelector
(
'
#query-form
'
);
results
.
data
.
getQueryStr
(
queryFormElement
);
results
.
data
.
getQueryStr
(
queryFormElement
);
...
@@ -51,6 +62,10 @@ function saveQueryData() {
...
@@ -51,6 +62,10 @@ function saveQueryData() {
console
.
info
(
'
Query data chunk saved
'
,
results
.
data
);
console
.
info
(
'
Query data chunk saved
'
,
results
.
data
);
if
(
client
.
requestQueryProgress
===
100
)
{
if
(
client
.
requestQueryProgress
===
100
)
{
client
.
isBusy
=
false
;
client
.
isBusy
=
false
;
// Update text_lookup with tmp_match_counts.
for
(
let
[
text_key
,
value
]
of
Object
.
entries
(
results
.
tmp_match_counts
))
{
results
.
data
.
text_lookup
[
text_key
].
match_count
=
results
.
tmp_match_counts
[
text_key
].
match_count
;
}
client
.
notifyView
(
'
query-data-recieved
'
);
client
.
notifyView
(
'
query-data-recieved
'
);
}
}
}
else
{
}
else
{
...
...
This diff is collapsed.
Click to expand it.
web/app/static/js/modules/corpus_analysis/model/Results.js
+
2
−
0
View file @
4ec3ce01
...
@@ -22,6 +22,8 @@ class Results {
...
@@ -22,6 +22,8 @@ class Results {
this
.
fullResultsData
.
init
();
this
.
fullResultsData
.
init
();
this
.
subResultsData
.
init
();
this
.
subResultsData
.
init
();
this
.
inspectResultsData
.
init
();
this
.
inspectResultsData
.
init
();
// Temporarly save match counts per text
this
.
tmp_match_counts
=
{};
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment