diff --git a/README.md b/README.md index 5af4775a..c29b3506 100644 --- a/README.md +++ b/README.md @@ -52,13 +52,14 @@ git push heroku master ## Features * Collaborative annotation -* Language independent +* Multi-Language support +* Emoji :smile: support * (future) Auto labeling ## Requirements * Python 3.6+ -* django 2.0.5+ +* Django 2.1.7+ * Google Chrome(highly recommended) ## Installation diff --git a/app/server/static/js/sequence_labeling.js b/app/server/static/js/sequence_labeling.js index 9391383e..904a8cea 100644 --- a/app/server/static/js/sequence_labeling.js +++ b/app/server/static/js/sequence_labeling.js @@ -16,7 +16,7 @@ Vue.component('annotator', { v-if="id2label[r.label]"\ v-bind:class="{tag: id2label[r.label].text_color}"\ v-bind:style="{ color: id2label[r.label].text_color, backgroundColor: id2label[r.label].background_color }"\ - >{{ text.slice(r.start_offset, r.end_offset) }}\ ', @@ -41,15 +41,15 @@ Vue.component('annotator', { const preSelectionRange = range.cloneRange(); preSelectionRange.selectNodeContents(this.$el); preSelectionRange.setEnd(range.startContainer, range.startOffset); - start = preSelectionRange.toString().length; - end = start + range.toString().length; + start = [...preSelectionRange.toString()].length; + end = start + [...range.toString()].length; } else if (document.selection && document.selection.type !== 'Control') { const selectedTextRange = document.selection.createRange(); const preSelectionTextRange = document.body.createTextRange(); preSelectionTextRange.moveToElementText(this.$el); preSelectionTextRange.setEndPoint('EndToStart', selectedTextRange); - start = preSelectionTextRange.text.length; - end = start + selectedTextRange.text.length; + start = [...preSelectionTextRange.text].length; + end = start + [...selectedTextRange.text].length; } this.startOffset = start; this.endOffset = end;