From e951f7255e5b02b8c545af13a4a4e1e53f67054f Mon Sep 17 00:00:00 2001 From: Francis Tyers Date: Thu, 10 Jun 2021 18:12:47 +0100 Subject: [PATCH] fix indexing / help / and hide labels --- client/corpus.js | 2 ++ notatrix/data/index.js | 2 +- notatrix/src/nx/corpus.js | 6 +++++- notatrix/src/nx/sentence.js | 1 + server/public/css/style.css | 9 +++++---- server/public/html/help.html | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/client/corpus.js b/client/corpus.js index 2ce359d6..4e4613ed 100644 --- a/client/corpus.js +++ b/client/corpus.js @@ -425,6 +425,8 @@ class Corpus { // get the index to start at const index = this.index || 0; + + console.log('parse() INDEX', index); // iterate over all the pieces, get a list of affected indices const sents = splitted.map((split, i) => { diff --git a/notatrix/data/index.js b/notatrix/data/index.js index 97655f93..2c88a6af 100644 --- a/notatrix/data/index.js +++ b/notatrix/data/index.js @@ -17,6 +17,6 @@ module.exports = { SD: require("./sd"), sd: require("./sd"), - corpora: require("./corpora"), +// corpora: require("./corpora"), }; diff --git a/notatrix/src/nx/corpus.js b/notatrix/src/nx/corpus.js index 266438dc..f5093df7 100644 --- a/notatrix/src/nx/corpus.js +++ b/notatrix/src/nx/corpus.js @@ -260,10 +260,13 @@ class Corpus extends NxBaseClass { parse(string) { const splitted = split(string, this.options); // might throw errors const index = this.index || 0; + console.log('parse() ' + index); splitted.forEach((split, i) => { // console.log(i, split); - this.insertSentence(index + i, split, false); + //this.insertSentence(index + i, split, false); + this.pushSentence(split); + console.log('pushSentence() ' + i); }); return this; @@ -272,6 +275,7 @@ class Corpus extends NxBaseClass { static fromString(string, options) { const corpus = new Corpus(options); corpus.parse(string); + corpus.index = 0; return corpus; } diff --git a/notatrix/src/nx/sentence.js b/notatrix/src/nx/sentence.js index d56cf7e3..60a87f45 100644 --- a/notatrix/src/nx/sentence.js +++ b/notatrix/src/nx/sentence.js @@ -220,6 +220,7 @@ class Sentence extends NxBaseClass { } attach() { + console.log('attach()'); this.iterate(token => { (token._heads || []).forEach((dependency, i) => { if (i) diff --git a/server/public/css/style.css b/server/public/css/style.css index 4103dae8..9c1c55b6 100644 --- a/server/public/css/style.css +++ b/server/public/css/style.css @@ -876,17 +876,18 @@ td .parse-error { #label-container { background-color: #fff; - display: flex; +/* display: flex;*/ padding: 0; overflow-x: auto; - + display: none; } #labels-horiz { list-style: none; margin: 0 0.5em; padding: 0; - display: flex; + /*display: flex;*/ + display: none; } #label-controller .label-text { @@ -1559,4 +1560,4 @@ only screen and (max-width: 760px), padding-left: 120px !important; color: black; } -} \ No newline at end of file +} diff --git a/server/public/html/help.html b/server/public/html/help.html index 688830e8..d1d8a9f9 100644 --- a/server/public/html/help.html +++ b/server/public/html/help.html @@ -53,7 +53,7 @@

Editing tokens

Merge two tokens into a supertoken - Left click on a token, then press c, then select with an arrow, which neighbor you want to merge with it. + Left click on a token, then press s, then select with an arrow, which neighbor you want to merge with it.