diff --git a/ner-edith.js b/ner-edith.js index 86ae4ea..ef250bc 100644 --- a/ner-edith.js +++ b/ner-edith.js @@ -101,7 +101,6 @@ function setupInterface(data, file) { if (isOk) { - console.log('hello world'); let newValue = $('#edit-area').val(); $(td).html(newValue); @@ -172,9 +171,11 @@ function setupInterface(data, file) { } let pos = tableInfo.nRow + 1; + word_pos = data.data[tableInfo.nRow - 1]['No.'] + 1 while((pos < data.data.length) && (data.data[pos]['No.'] > 1)) { - data.data[pos]['No.']--; + data.data[pos]['No.'] = word_pos; pos++; + word_pos++; } data.data[tableInfo.nRow - 1]['TOKEN'] += data.data[tableInfo.nRow]['TOKEN']; @@ -192,6 +193,15 @@ function setupInterface(data, file) { pos++; } } + else if (editingTd.tokenizer_action.includes('start-sentence')) { + let pos = tableInfo.nRow; + let word_pos = 1; + while ((pos < data.data.length) && (data.data[pos]['No.'] != 1)) { + data.data[pos]['No.'] = word_pos; + pos++; + word_pos++; + } + } editingTd = null; @@ -203,6 +213,7 @@ function setupInterface(data, file) {