From f09403e61dc09a79a4ea2605004cc9c6a3aa87c0 Mon Sep 17 00:00:00 2001 From: Inga Kirschnick Date: Wed, 7 Sep 2022 14:22:59 +0200 Subject: [PATCH] QueryBuilder 1.1 --- app/static/js/CorpusAnalysis/QueryBuilder.js | 35 ++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/app/static/js/CorpusAnalysis/QueryBuilder.js b/app/static/js/CorpusAnalysis/QueryBuilder.js index d36dd9f3..881bd5aa 100644 --- a/app/static/js/CorpusAnalysis/QueryBuilder.js +++ b/app/static/js/CorpusAnalysis/QueryBuilder.js @@ -726,6 +726,41 @@ class ConcordanceQueryBuilder { nmSubmitHandler() { let instance = M.Modal.getInstance(this.elements.betweenNM); instance.close(); + + switch (this.elements.positionalAttr.value) { + case "word": + this.elements.wordInput.value += `{${this.elements.nmInput.value}, ${this.elements.mInput.value}}`; + break; + case "lemma": + this.elements.lemmaInput.value += `{${this.elements.nmInput.value}, ${this.elements.mInput.value}}`; + break; + case "english-pos": + this.elements.tokenQueryFilled = true; + this.tokenButtonfactory(`pos=${this.elements.englishPos.value}`, `pos="${this.elements.englishPos.value}"`); + this.tokenButtonfactory(`{${this.elements.nmInput.value}, ${this.elements.mInput.value}}`, `{${this.elements.nmInput.value}, ${this.elements.mInput.value}}`); + this.elements.englishPosBuilder.classList.add("hide"); + this.elements.incidenceModifiersButton.classList.add("hide"); + break; + case "german-pos": + this.elements.tokenQueryFilled = true; + this.tokenButtonfactory(`pos=${this.elements.germanPos.value}`, `pos="${this.elements.germanPos.value}"`); + this.tokenButtonfactory(`{${this.elements.nmInput.value}, ${this.elements.mInput.value}}`, `{${this.elements.nmInput.value}, ${this.elements.mInput.value}}`); + this.elements.germanPosBuilder.classList.add("hide"); + this.elements.incidenceModifiersButton.classList.add("hide"); + break; + case "simple-pos-button": + this.elements.tokenQueryFilled = true; + this.tokenButtonfactory(`simple_pos=${this.elements.simplePos.value}`, `simple_pos="${this.elements.simplePos.value}"`); + this.tokenButtonfactory(`{${this.elements.nmInput.value}, ${this.elements.mInput.value}}`, `{${this.elements.nmInput.value}, ${this.elements.mInput.value}}`); + this.elements.simplePosBuilder.classList.add("hide"); + this.elements.incidenceModifiersButton.classList.add("hide"); + break; + case "empty-token": + this.tokenButtonfactory(`{${this.elements.nmInput.value}, ${this.elements.mInput.value}}`, `{${this.elements.nmInput.value}, ${this.elements.mInput.value}}`); + break; + default: + break; + } } incidenceModifiersHandler(elem) {