ソースを参照

生成分词时去掉前后空格

natasha 1 ヶ月 前
コミット
8d3134f800

+ 3 - 1
src/views/book/courseware/create/components/question/article/Article.vue

@@ -616,6 +616,7 @@ export default {
       this.data.detail = [];
       let contentArr = this.data.content.split('\n');
       let textList = [];
+      let contentStr = '';
       let detailItem = {
         paraIndex: 0,
         para: '',
@@ -656,10 +657,11 @@ export default {
 
           let str = Base64.encode(item);
           textList.push(str);
+          contentStr += item.trim() + '\n';
         }
       });
       BatchSegContent({
-        text: this.data.content,
+        text: contentStr,
         is_build_pinyin: 'true',
         is_custom_fc: 'false',
         is_vocabulary_pinyin_lt: 'true',

+ 2 - 2
src/views/book/courseware/create/components/question/dialogue_article/Article.vue

@@ -989,9 +989,9 @@ export default {
       this.data.detail.forEach((item, index) => {
         item.paraIndex = index;
         if (item.type === 'text') {
-          textList += `${item.para}\n`;
+          textList += `${item.para.trim()}\n`;
         } else if (item.type === 'notice') {
-          textList += `${item.notice}\n`;
+          textList += `${item.notice.trim()}\n`;
         }
       });
 

+ 1 - 1
src/views/book/courseware/create/components/question/image_text/ImageText.vue

@@ -840,7 +840,7 @@ export default {
       let textList = '';
       this.data.text_list.forEach((item, index) => {
         item.paraIndex = index;
-        textList += `${item.text}\n`;
+        textList += `${item.text.trim()}\n`;
       });
 
       BatchSegContent({