mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-01-13 11:40:35 +00:00
Compare commits
2 Commits
d875623a8c
...
c40e428eb2
Author | SHA1 | Date | |
---|---|---|---|
|
c40e428eb2 | ||
|
4daf3359b9 |
@ -524,7 +524,7 @@ cqi.api.APIClient = class APIClient {
|
||||
|
||||
/**
|
||||
* Dump the values of <field> for match ranges <first> .. <last>
|
||||
* in <subcorpus>. <field> is one of the CQI_CONST_FIELD_* constants.
|
||||
* in <subcorpus>. <field> is one of the cqi.constants.FIELD_* constants.
|
||||
*
|
||||
* @param {string} subcorpus
|
||||
* @param {number} field
|
||||
@ -561,9 +561,9 @@ cqi.api.APIClient = class APIClient {
|
||||
*
|
||||
* returns <n> (id, frequency) pairs flattened into a list of size 2*<n>
|
||||
* field is one of
|
||||
* - CQI_CONST_FIELD_MATCH
|
||||
* - CQI_CONST_FIELD_TARGET
|
||||
* - CQI_CONST_FIELD_KEYWORD
|
||||
* - cqi.constants.FIELD_MATCH
|
||||
* - cqi.constants.FIELD_TARGET
|
||||
* - cqi.constants.FIELD_KEYWORD
|
||||
*
|
||||
* NB: pairs are sorted by frequency desc.
|
||||
*
|
||||
|
43
app/static/js/cqi/constants.js
Normal file
43
app/static/js/cqi/constants.js
Normal file
@ -0,0 +1,43 @@
|
||||
cqi.constants = {};
|
||||
|
||||
/** @type {number} */
|
||||
cqi.constants.FIELD_KEYWORD = 9;
|
||||
|
||||
/** @type {number} */
|
||||
cqi.constants.FIELD_MATCH = 16;
|
||||
|
||||
/** @type {number} */
|
||||
cqi.constants.FIELD_MATCHEND = 17;
|
||||
|
||||
/** @type {number} */
|
||||
cqi.constants.FIELD_TARGET = 0;
|
||||
|
||||
/** @type {number} */
|
||||
cqi.constants.FIELD_TARGET_0 = 0;
|
||||
|
||||
/** @type {number} */
|
||||
cqi.constants.FIELD_TARGET_1 = 1;
|
||||
|
||||
/** @type {number} */
|
||||
cqi.constants.FIELD_TARGET_2 = 2;
|
||||
|
||||
/** @type {number} */
|
||||
cqi.constants.FIELD_TARGET_3 = 3;
|
||||
|
||||
/** @type {number} */
|
||||
cqi.constants.FIELD_TARGET_4 = 4;
|
||||
|
||||
/** @type {number} */
|
||||
cqi.constants.FIELD_TARGET_5 = 5;
|
||||
|
||||
/** @type {number} */
|
||||
cqi.constants.FIELD_TARGET_6 = 6;
|
||||
|
||||
/** @type {number} */
|
||||
cqi.constants.FIELD_TARGET_7 = 7;
|
||||
|
||||
/** @type {number} */
|
||||
cqi.constants.FIELD_TARGET_8 = 8;
|
||||
|
||||
/** @type {number} */
|
||||
cqi.constants.FIELD_TARGET_9 = 9;
|
@ -1,6 +1 @@
|
||||
var cqi = {};
|
||||
|
||||
cqi.CONST_FIELD_KEYWORD = 9;
|
||||
cqi.CONST_FIELD_MATCH = 16;
|
||||
cqi.CONST_FIELD_MATCHEND = 17;
|
||||
cqi.CONST_FIELD_TARGET = 0;
|
||||
|
@ -145,17 +145,17 @@ cqi.models.subcorpora.SubcorpusCollection = class SubcorpusCollection extends cq
|
||||
let apiName = `${this.corpus.apiName}:${subcorpusName}`;
|
||||
/** @type {object} */
|
||||
let fields = {};
|
||||
if (await this.client.api.cqp_subcorpus_has_field(apiName, cqi.CONST_FIELD_MATCH)) {
|
||||
fields.match = cqi.CONST_FIELD_MATCH;
|
||||
if (await this.client.api.cqp_subcorpus_has_field(apiName, cqi.constants.FIELD_MATCH)) {
|
||||
fields.match = cqi.constants.FIELD_MATCH;
|
||||
}
|
||||
if (await this.client.api.cqp_subcorpus_has_field(apiName, cqi.CONST_FIELD_MATCHEND)) {
|
||||
fields.matchend = cqi.CONST_FIELD_MATCHEND
|
||||
if (await this.client.api.cqp_subcorpus_has_field(apiName, cqi.constants.FIELD_MATCHEND)) {
|
||||
fields.matchend = cqi.constants.FIELD_MATCHEND
|
||||
}
|
||||
if (await this.client.api.cqp_subcorpus_has_field(apiName, cqi.CONST_FIELD_TARGET)) {
|
||||
fields.target = cqi.CONST_FIELD_TARGET
|
||||
if (await this.client.api.cqp_subcorpus_has_field(apiName, cqi.constants.FIELD_TARGET)) {
|
||||
fields.target = cqi.constants.FIELD_TARGET
|
||||
}
|
||||
if (await this.client.api.cqp_subcorpus_has_field(apiName, cqi.CONST_FIELD_KEYWORD)) {
|
||||
fields.keyword = cqi.CONST_FIELD_KEYWORD
|
||||
if (await this.client.api.cqp_subcorpus_has_field(apiName, cqi.constants.FIELD_KEYWORD)) {
|
||||
fields.keyword = cqi.constants.FIELD_KEYWORD
|
||||
}
|
||||
return {
|
||||
api_name: apiName,
|
||||
|
@ -18,6 +18,7 @@
|
||||
filters='rjsmin',
|
||||
output='gen/cqi.%(version)s.js',
|
||||
'js/cqi/index.js',
|
||||
'js/cqi/constants.js',
|
||||
'js/cqi/errors.js',
|
||||
'js/cqi/status.js',
|
||||
'js/cqi/api/index.js',
|
||||
|
Loading…
x
Reference in New Issue
Block a user