diff --git a/src/lib/controllers/upload-controller.js b/src/lib/controllers/upload-controller.js index 76d5c85e..5e1a0b87 100644 --- a/src/lib/controllers/upload-controller.js +++ b/src/lib/controllers/upload-controller.js @@ -183,7 +183,7 @@ export default class UploadController { tokenization[optItemName] = optionsSet.items[optItemName].currentValue }) - return SourceText.convertFromJSON(textType, { textId, tokenization, text: fileData.text, sourceType, lang: fileData.lang }) + return SourceText.convertFromJSON(textType, { textId, tokenization, text: fileData.text, sourceType, lang: fileData.lang }, false) } } diff --git a/src/lib/data/alignment.js b/src/lib/data/alignment.js index d6e8cd7d..408523c0 100644 --- a/src/lib/data/alignment.js +++ b/src/lib/data/alignment.js @@ -170,7 +170,7 @@ export default class Alignment { const docResult = this.createNewDocSource('origin', docSource) if (!docResult) { return false } - this.origin.docSource = docResult + this.origin.docSource = docResult } else { this.origin.docSource.update(docSource) } diff --git a/src/lib/data/source-text.js b/src/lib/data/source-text.js index 5c7677ae..f6621ab1 100644 --- a/src/lib/data/source-text.js +++ b/src/lib/data/source-text.js @@ -28,7 +28,7 @@ export default class SourceText { this.sourceType = docSource && docSource.sourceType ? docSource.sourceType : this.defaultSourceType this.tokenization = docSource && docSource.tokenization ? docSource.tokenization : {} - this.skipDetected = skipDetected + this.skipDetected = docSource.skipDetected !== undefined ? docSource.skipDetected : skipDetected this.startedDetection = false if (docSource && docSource.metadata) { @@ -174,7 +174,7 @@ export default class SourceText { * @param {String} jsonData.direction * @param {String} jsonData.lang */ - static convertFromJSON (textType, jsonData) { + static convertFromJSON (textType, jsonData, skipDetected = true) { if (!jsonData.text) { console.error(L10nSingleton.getMsgS('SOURCE_TEXT_CONVERT_ERROR')) NotificationSingleton.addNotification({ @@ -195,7 +195,8 @@ export default class SourceText { if (jsonData.textId) { sourceText.id = jsonData.textId } - sourceText.skipDetected = true + + sourceText.skipDetected = skipDetected return sourceText }