فهرست منبع

更换拼音字体

natasha 1 سال پیش
والد
کامیت
cd306170d8

+ 5 - 0
src/router/index.js

@@ -161,6 +161,11 @@ const routes = [{
             import ('@/views/Textanalysis/CheckWord'),
     },
     {
+        path: '/textanalysis/checkPos',
+        component: () =>
+            import ('@/views/Textanalysis/CheckPos'),
+    },
+    {
         path: '*',
         redirect: '/404',
     },

+ 10 - 0
src/views/Textanalysis/CheckArticle.vue

@@ -9,6 +9,7 @@
         </a>
         <b>校对</b>
         <div class="btn-box">
+            <el-button @click="checkPos">校对词性</el-button>
             <el-button @click="checkPinyin">校对拼音</el-button>
             <el-button type="primary" @click="checkWord">校对分词</el-button>
         </div>
@@ -114,6 +115,15 @@ export default {
                 id: this.id
             },
         });
+    },
+    // 校对词性
+    checkPos(){
+        this.$router.push({
+            path: "/textanalysis/checkPos",
+            query: {
+                id: this.id
+            },
+        });
     }
   },
 };

+ 377 - 0
src/views/Textanalysis/CheckPos.vue

@@ -0,0 +1,377 @@
+<template>
+  <div v-loading="loading" class="check-article">
+    <HeaderPage />
+    <div class="main">
+      <div class="main-top">
+        <div style="display: flex; align-items: end">
+            <a class="go-back" @click="$router.go(-1)">
+                <i class="el-icon-arrow-left"></i>
+                返回
+            </a>
+            <b>校对词性</b>
+            <p class="tips">*为保证词性校对的准确性,请尽量在校对分词后校对词性。</p>
+        </div>
+        <div class="btn-box">
+            <!-- <el-switch
+                class="show-pos"
+                v-model="showPos"
+                active-text="显示词性"
+                inactive-text="">
+            </el-switch> -->
+            <el-button type="info" @click="$router.go(-1)">取消</el-button>
+            <el-button type="primary" @click="saveWord(id)">保存</el-button>
+        </div>
+      </div>
+      <div v-if="showPos" class="pos-box">
+        <h4>词性解释</h4>
+        <ul>
+            <li v-for="(item,index) in cixingList" :key="index">
+                <label>{{item.code}}</label>
+                <span>{{item.name}}</span>
+            </li>
+        </ul>
+      </div>
+      <el-input v-if="showPos" class="no-pos-content" v-model="hasPosContent" type="textarea" :autosize="{ minRows: 27 }" />
+      <el-input v-else class="no-pos-content" v-model="noPosContent" type="textarea" :autosize="{ minRows: 27 }" />
+    </div>
+  </div>
+</template>
+
+<script>
+import HeaderPage from '@/components/Header.vue';
+import { publicMethods, reparse } from '@/api/api';
+
+export default {
+  components: {
+    HeaderPage,
+  },
+  data() {
+    return {
+      loading: false,
+      id: '',
+      ArticelData: null,
+      showPos: true,
+      noPosContent: '',
+      hasPosContent: '',
+      posList: ['NR','NN','JJ','AD','PU','VV','CC','SP','FW','DEC','ETC','AS'],
+      cixingList: []
+    };
+  },
+  // 生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+    this.routerData = JSON.parse(JSON.stringify(this.$route.query));
+    this.id = this.routerData.id
+    this.getArticleData()
+    this.getCixingList()
+  },
+  methods: {
+    // 获取分析结果
+    getArticleData() {
+      this.loading = true;
+      let str = ''
+      let posStr = ''
+      publicMethods('/TeachingServer/TextAnalyser/GetParsedTextInfo',{
+          analyse_record_id: this.id,
+        }
+      )
+        .then((res) => {
+            if(res.status===1){
+                let newdata = [];
+                res.parsed_text.paragraph_list.forEach((item) => {
+                    if (item.length !== 0) {
+                        newdata.push(item);
+                    }
+                });
+                this.ArticelData = JSON.parse(JSON.stringify(newdata));
+                newdata.forEach((item,index) => {
+                    item.forEach((items,indexs) => {
+                        items.forEach((itemss,indexss)=>{
+                            let strWord = ''
+                            itemss.text.forEach((itemT,indexT)=>{
+                               strWord += itemT.word
+                            })
+                            str += strWord + (indexss!==items.length-1?'  ':'')
+                            posStr += strWord +(itemss.pos?'_'+itemss.pos:'') + (indexss!==items.length-1?'  ':'')
+                        })
+                        str += '\n'
+                        posStr += '\n'
+                    });
+                    if(index!==newdata.length-1){
+                        str += '\n'
+                        posStr += '\n'
+                    }
+                });
+                this.noPosContent = str
+                this.hasPosContent = posStr
+                this.loading = false;
+            }
+        })
+        .catch(() => {
+          this.loading = false;
+        });
+    },
+    saveWord(analyse_record_id){
+      let saveArr = []
+      let arr = this.showPos?this.hasPosContent.split('\n'):this.noPosContent.split('\n')
+      let indexP = 0 // 段落索引
+      let indexS = 0 // 句子索引
+      let flag = true
+      arr.forEach(item=>{
+        if(item===''){
+            saveArr.push([])
+        }
+      })
+      arr.forEach((item,index)=>{
+        if(item===''){
+            indexP++
+            indexS = 0
+        }else{
+            let arrs = item.trim().split('  ')
+            let saveItem = []
+            arrs.forEach((items,indexs)=>{
+                // if(items.lastIndexOf('_')===-1||this.posList.indexOf(items.substring(items.lastIndexOf('_')+1).trim())==-1){
+                //     flag = false
+                //     return
+                // }
+                let obj = {
+                    word: items.lastIndexOf('_')>-1?items.substring(0,items.lastIndexOf('_')).trim():items,
+                    pos: this.showPos?items.lastIndexOf('_')>-1?items.substring(items.lastIndexOf('_')+1).trim():'':this.ArticelData[indexP]&&this.ArticelData[indexP][indexS]&&this.ArticelData[indexP][indexS][indexs]&&this.ArticelData[indexP][indexS][indexs].pos?this.ArticelData[indexP][indexS][indexs].pos:''
+                }
+                saveItem.push(obj)
+            })
+            saveArr[indexP].push(saveItem)
+            indexS++
+        }
+      })
+    //   if(!flag){
+    //     this.$message.warning('词性有错误请检查')
+    //     return
+    //   }
+      this.loading = true;
+      publicMethods('/TeachingServer/TextAnalyser/SetFCProofreadForAnalyseRecord',{
+            analyse_record_id: this.id,
+            proofread_text: {
+                paragraph_list: saveArr
+            },
+            is_proofread_cx: "true"
+        })
+        .then((res) => {
+            if(res.status===1){
+                this.$message.success('保存成功')
+                reparse({ analyse_record_id })
+                    .then(({ record }) => {
+                        this.getArticleData()
+                    })
+                    .finally(() => {
+                        this.loading = false;
+                    });
+            }
+        })
+        .catch(() => {
+            this.loading = false;
+        });
+    },
+    // 获取词性列表
+    getCixingList(){
+        this.cixingList = []
+        publicMethods('/TeachingServer/TextAnalyser/GetCixingList',{})
+        .then((res) => {
+            if(res.status===1){
+                this.cixingList = res.cixing_list
+            }
+        })
+        .catch(() => {
+            
+        });
+    }
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.check-article {
+  min-height: 100%;
+  background: #f6f6f6;
+
+  .wheader {
+    background: #fff;
+  }
+    .el-button{
+        padding: 5px 16px;
+        border-radius: 2px;
+        border: 1px solid #F2F3F5;
+        color: #4E5969;
+        font-size: 14px;
+        font-weight: 400;
+        line-height: 22px;
+        background: #F2F3F5;
+        &.el-button--primary{
+            background: #165DFF;
+            border: 1px solid #165DFF;
+            color: #FFF;
+        }
+    }
+  .main {
+    width: 1200px;
+    margin: 23px auto;
+    background: #FFF;
+    padding: 24px;
+    &-top{
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        margin-bottom: 24px;
+        position: relative;
+        b{
+            color: #000;
+            font-size: 24px;
+            font-weight: 500;
+            line-height: 34px;
+            margin-left: 16px;
+        }
+        .tips{
+            color: #979797;
+            font-size: 12px;
+            font-weight: 400;
+            line-height: 20px;
+            margin-left: 12px;
+        }
+        .show-pos{
+            margin-right: 24px;
+            &.is-checked{
+                .el-switch__label.is-active{
+                    color: rgba(13, 13, 13, 1);
+                }
+            }
+        }
+    }
+    .go-back{
+        border-radius: 4px;
+        border: 1px solid #D9D9D9;
+        background: #FFF;
+        box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.02);
+        display: flex;
+        width: 60px;
+        color: #333;
+        font-size: 14px;
+        font-weight: 400;
+        line-height: 22px;
+        padding: 5px 8px;
+        align-items: center;
+        cursor: pointer;
+        .el-icon-arrow-left{
+            font-size: 16px;
+            margin-right: 8px;
+        }
+    }
+    .pos-box{
+        margin-bottom: 16px;
+        border-radius: 4px;
+        background: #F7F7F7;
+        padding: 16px;
+        h4{
+            color: #000;
+            font-size: 14px;
+            font-weight: 600;
+            line-height: 22px;
+            margin: 0;
+        }
+        ul{
+            list-style: none;
+            margin: 0;
+            padding: 0;
+            display: flex;
+            flex-flow: wrap;
+            li{
+                margin: 8px 8px 0 0;
+                border-radius: 4px;
+                background: #FFF;
+                padding: 4px 16px;
+                label{
+                    color: #007EFF;
+                    font-size: 14px;
+                    font-weight: 600;
+                    line-height: 22px;
+                    margin-right: 8px;
+                }
+                span{
+                    color: #000;
+                    font-size: 14px;
+                    font-weight: 400;
+                    line-height: 22px;
+                }
+            }
+        }
+    }
+  }
+}
+.check-box{
+    padding: 24px;
+    border-radius: 4px;
+    background: #FFF;
+    box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
+    .content{
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        .words-box{
+            text-align: center;
+            color: #000;
+            .words{
+                display: block;
+                font-size: 28px;
+                line-height: 40px;
+                font-weight: 400;
+            }
+            .pinyin{
+                font-family: 'League';
+                font-size: 20px;
+                font-weight: 400;
+                line-height: 1;
+                height: 20px;
+                display: block;
+            }
+        }
+    }
+    .checkPinyinInput{
+        margin: 16px 0 8px 0;
+    }
+    .tips{
+        color: #A0A0A0;
+        font-size: 12px;
+        font-weight: 400;
+        line-height: 18px;
+        margin: 0 0 24px 0;
+    }
+    .btn-box{
+        text-align: right;
+        .el-button{
+            font-size: 12px;
+            padding: 2px 12px;
+            line-height: 20px;
+        }
+    }
+}
+</style>
+<style lang="scss">
+.check-article{
+    .show-pos{
+        .el-switch__label.is-active{
+            color: rgba(13, 13, 13, 1);
+        }
+        &.el-switch.is-checked .el-switch__core{
+            border-color: #165DFF;
+            background-color: #165DFF;
+        }
+    }
+    .no-pos-content{
+        .el-textarea__inner{
+            font-family: Helvetica, 'FZJCGFKTK';
+            font-size: 16px;
+            color: rgba(0, 0, 0, 0.88);
+        }
+    }
+}
+
+</style>
+

+ 45 - 29
src/views/Textanalysis/CheckWord.vue

@@ -22,10 +22,6 @@
             <el-button type="primary" @click="saveWord(id)">保存</el-button>
         </div>
       </div>
-      <div v-if="showPos" class="pos-box">
-        <h4>词性解释</h4>
-        <p>n/名词 np/人名 ns/地名 ni/机构名 nz/其它专名 m/数词 q/量词 mq/数量词 t/时间词 f/方位词 s/处所词 v/动词 vm/能愿动词 vd/趋向动词 a/形容词 d/副词 h/前接成分 k/后接成分 i/习语 j/简称 r/代词 c/连词 p/介词 u/助词 y/语气助词 e/叹词 o/拟声词 g/语素 w/标点 x/其它</p>
-      </div>
       <el-input v-if="showPos" class="no-pos-content" v-model="hasPosContent" type="textarea" :autosize="{ minRows: 27 }" />
       <el-input v-else class="no-pos-content" v-model="noPosContent" type="textarea" :autosize="{ minRows: 27 }" />
     </div>
@@ -45,10 +41,10 @@ export default {
       loading: false,
       id: '',
       ArticelData: null,
-      showPos: true,
+      showPos: false,
       noPosContent: '',
       hasPosContent: '',
-      posList: ['NR','NN','JJ','AD','PU','VV','CC','SP','FW','DEC','ETC','AS']
+      posList: ['NR','NN','JJ','AD','PU','VV','CC','SP','FW','DEC','ETC','AS'],
     };
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
@@ -128,7 +124,7 @@ export default {
                 // }
                 let obj = {
                     word: items.lastIndexOf('_')>-1?items.substring(0,items.lastIndexOf('_')).trim():items,
-                    pos: this.showPos?items.lastIndexOf('_')>-1?items.substring(items.lastIndexOf('_')+1).trim():'':this.ArticelData[indexP]&&this.ArticelData[indexP][indexS]&&this.ArticelData[indexP][indexS][indexs]&&this.ArticelData[indexP][indexS][indexs].pos?this.ArticelData[indexP][indexS][indexs].pos:''
+                    pos: ''
                 }
                 saveItem.push(obj)
             })
@@ -145,25 +141,26 @@ export default {
             analyse_record_id: this.id,
             proofread_text: {
                 paragraph_list: saveArr
+            },
+            is_proofread_cx: "false"
+        })
+        .then((res) => {
+            if(res.status===1){
+                this.$message.success('保存成功')
+                reparse({ analyse_record_id })
+                    .then(({ record }) => {
+                        this.getArticleData()
+                    })
+                    .finally(() => {
+                        this.loading = false;
+                    });
             }
         })
-            .then((res) => {
-                if(res.status===1){
-                    this.$message.success('保存成功')
-                    reparse({ analyse_record_id })
-                        .then(({ record }) => {
-                            this.getArticleData()
-                        })
-                        .finally(() => {
-                            this.loading = false;
-                        });
-                }
-            })
-            .catch(() => {
-                this.loading = false;
-            });
+        .catch(() => {
+            this.loading = false;
+        });
+    },
     
-    }
   },
 };
 </script>
@@ -254,14 +251,33 @@ export default {
             font-size: 14px;
             font-weight: 600;
             line-height: 22px;
-            margin: 0 0 8px 0;
+            margin: 0;
         }
-        p{
-            color: #000;
-            font-size: 14px;
-            font-weight: 400;
-            line-height: 22px;
+        ul{
+            list-style: none;
             margin: 0;
+            padding: 0;
+            display: flex;
+            flex-flow: wrap;
+            li{
+                margin: 8px 8px 0 0;
+                border-radius: 4px;
+                background: #FFF;
+                padding: 4px 16px;
+                label{
+                    color: #007EFF;
+                    font-size: 14px;
+                    font-weight: 600;
+                    line-height: 22px;
+                    margin-right: 8px;
+                }
+                span{
+                    color: #000;
+                    font-size: 14px;
+                    font-weight: 400;
+                    line-height: 22px;
+                }
+            }
         }
     }
   }

+ 2 - 2
src/views/Textanalysis/WordTable.vue

@@ -118,7 +118,7 @@
                 >{{ item.word }}</span
               >
             </td>
-            <td v-if="typeIndex !== 0" class="sort-td" style="font-family: 'GB-PINYINOK-B'; text-align: left">
+            <td v-if="typeIndex !== 0" class="sort-td" style="font-family: 'League'; text-align: left">
               {{ item.pinyin }}
             </td>
             <td class="sort-td">
@@ -831,7 +831,7 @@ export default {
         background: #fff;
 
         .pinyin {
-          font-family: 'GB-PINYINOK-B';
+          font-family: 'League';
           text-align: left !important;
         }
 

+ 2 - 2
src/views/Textanalysis/index.vue

@@ -985,7 +985,7 @@ export default {
     color: rgba(255, 255, 255, 0.5);
     text-align: center;
     line-height: 12px;
-    font-family: "GB-PINYINOK-B";
+    font-family: "League";
   }
   .hanzi {
     text-align: center;
@@ -2357,7 +2357,7 @@ export default {
 
                 .pinyin {
                   min-height: 12px;
-                  font-family: 'GB-PINYINOK-B';
+                  font-family: 'League';
                   line-height: 12px;
                   color: rgba(0, 0, 0, 50%);
                   text-align: center;

+ 2 - 2
src/views/corpus/Result.vue

@@ -865,7 +865,7 @@ export default {
 
           span {
             margin-left: 5px;
-            font-family: 'GB-PINYINOK-B';
+            font-family: 'League';
             font-size: 12px;
             font-weight: 400;
             color: #000;
@@ -1146,7 +1146,7 @@ export default {
                 > div {
                   .pinyin {
                     margin-bottom: 2px;
-                    font-family: 'GB-PINYINOK-B';
+                    font-family: 'League';
                     font-size: 12px;
                     font-weight: 500;
                     color: rgba(0, 0, 0, 50%);