فهرست منبع

难度改为丰富度

natasha 1 سال پیش
والد
کامیت
7b5c8f8ee1
2فایلهای تغییر یافته به همراه40 افزوده شده و 9 حذف شده
  1. 2 2
      public/ciyun/ciyunindex.html
  2. 38 7
      src/views/Textanalysis/index.vue

+ 2 - 2
public/ciyun/ciyunindex.html

@@ -224,14 +224,14 @@
                                  -->
                                  -->
                                 <input type="radio" hidden="" id="font" value="">
                                 <input type="radio" hidden="" id="font" value="">
                                 <select name="selectFont" class="selectOp fl" id="fontSel">
                                 <select name="selectFont" class="selectOp fl" id="fontSel">
-                                    <option value="Impact">Impact</option>
+                                    <!-- <option value="Impact">Impact</option>
                                     <option value="Georgia">Georgia</option>
                                     <option value="Georgia">Georgia</option>
                                     <option value="Arial">Arial</option>
                                     <option value="Arial">Arial</option>
                                     <option value="Constantia">Constantia</option>
                                     <option value="Constantia">Constantia</option>
                                     <option value="Century">Century</option>
                                     <option value="Century">Century</option>
                                     <option value="Berlin Sans FB">Berlin Sans FB</option>
                                     <option value="Berlin Sans FB">Berlin Sans FB</option>
                                     <option value="Cooper Black">Cooper Black</option>
                                     <option value="Cooper Black">Cooper Black</option>
-                                    <option value="Elephant">Elephant</option>
+                                    <option value="Elephant">Elephant</option> -->
                                     <option value="FZSS">方正书宋</option>
                                     <option value="FZSS">方正书宋</option>
                                     <option value="FZLTH">方正兰亭黑</option>
                                     <option value="FZLTH">方正兰亭黑</option>
                                     <option value="FZKT-GBK">方正楷体</option>
                                     <option value="FZKT-GBK">方正楷体</option>

+ 38 - 7
src/views/Textanalysis/index.vue

@@ -211,9 +211,9 @@
           </div>
           </div>
           <div class="right_main">
           <div class="right_main">
             <div class="right_main_top">
             <div class="right_main_top">
-              <div>
+              <div title="采用TTR公式衡量文本丰富度,TTR指不同音节数量与总数量的比值。">
                 <span
                 <span
-                  >音节
+                  >音节丰富
                   <span style="margin-left: 5px">
                   <span style="margin-left: 5px">
                     {{ (difficulty.pinyinDifficulty * 1).toFixed(2) }}
                     {{ (difficulty.pinyinDifficulty * 1).toFixed(2) }}
                   </span>
                   </span>
@@ -225,9 +225,9 @@
                 <span class="line"></span>
                 <span class="line"></span>
                 <span class="line"></span>
                 <span class="line"></span>
               </div>
               </div>
-              <div>
+              <div title="采用TTR公式衡量文本丰富度,TTR指不同汉字数量与总数量的比值。">
                 <span
                 <span
-                  >汉字
+                  >汉字丰富
                   <span style="margin-left: 5px">
                   <span style="margin-left: 5px">
                     {{ (difficulty.wordDifficulty * 1).toFixed(2) }}
                     {{ (difficulty.wordDifficulty * 1).toFixed(2) }}
                   </span>
                   </span>
@@ -239,9 +239,9 @@
                 <span class="line"></span>
                 <span class="line"></span>
                 <span class="line"></span>
                 <span class="line"></span>
               </div>
               </div>
-              <div>
+              <div title="采用TTR公式衡量文本丰富度,TTR指不同词汇数量与总数量的比值。">
                 <span
                 <span
-                  >词汇
+                  >词汇丰富
                   <span style="margin-left: 5px">
                   <span style="margin-left: 5px">
                     {{ (difficulty.vocabularyDifficulty * 1).toFixed(2) }}
                     {{ (difficulty.vocabularyDifficulty * 1).toFixed(2) }}
                   </span>
                   </span>
@@ -288,6 +288,7 @@
                                 class="hanzi"
                                 class="hanzi"
                                 :class="[/^[a-zA-Z0-9]/.test(word.word) ? '' : 'hanzi-fz']"
                                 :class="[/^[a-zA-Z0-9]/.test(word.word) ? '' : 'hanzi-fz']"
                                 :style="{
                                 :style="{
+                                  fontFamily: /^[a-zA-Z0-9]/.test(word.word) ? '' : '楷体',
                                   fontSize: wordFontsize + 'px',
                                   fontSize: wordFontsize + 'px',
                                   lineHeight: wordLineHeight + 'px',
                                   lineHeight: wordLineHeight + 'px',
                                   background: word.color ? word.color : '',
                                   background: word.color ? word.color : '',
@@ -357,6 +358,7 @@
                                 class="hanzi"
                                 class="hanzi"
                                 :class="[/^[a-zA-Z0-9]/.test(word.word) ? '' : 'hanzi-fz']"
                                 :class="[/^[a-zA-Z0-9]/.test(word.word) ? '' : 'hanzi-fz']"
                                 :style="{
                                 :style="{
+                                  fontFamily: /^[a-zA-Z0-9]/.test(word.word) ? '' : '楷体',
                                   fontSize: wordFontsize + 'px',
                                   fontSize: wordFontsize + 'px',
                                   lineHeight: wordLineHeight + 'px',
                                   lineHeight: wordLineHeight + 'px',
                                   background: word.color ? word.color : '',
                                   background: word.color ? word.color : '',
@@ -433,6 +435,7 @@
                                 class="hanzi"
                                 class="hanzi"
                                 :class="[/^[a-zA-Z0-9]/.test(word.word) ? '' : 'hanzi-fz']"
                                 :class="[/^[a-zA-Z0-9]/.test(word.word) ? '' : 'hanzi-fz']"
                                 :style="{
                                 :style="{
+                                  fontFamily: /^[a-zA-Z0-9]/.test(word.word) ? '' : '楷体',
                                   fontSize: wordFontsize + 'px',
                                   fontSize: wordFontsize + 'px',
                                   lineHeight: wordLineHeight + 'px',
                                   lineHeight: wordLineHeight + 'px',
                                   background: word.color ? word.color : '',
                                   background: word.color ? word.color : '',
@@ -503,6 +506,7 @@
                                 class="hanzi"
                                 class="hanzi"
                                 :class="[/^[a-zA-Z0-9]/.test(word.word) ? '' : 'hanzi-fz']"
                                 :class="[/^[a-zA-Z0-9]/.test(word.word) ? '' : 'hanzi-fz']"
                                 :style="{
                                 :style="{
+                                  fontFamily: /^[a-zA-Z0-9]/.test(word.word) ? '' : '楷体',
                                   fontSize: wordFontsize + 'px',
                                   fontSize: wordFontsize + 'px',
                                   lineHeight: wordLineHeight + 'px',
                                   lineHeight: wordLineHeight + 'px',
                                   background: word.color ? word.color : '',
                                   background: word.color ? word.color : '',
@@ -583,6 +587,7 @@
                                 class="hanzi"
                                 class="hanzi"
                                 :class="[/^[a-zA-Z0-9]/.test(word.word) ? '' : 'hanzi-fz']"
                                 :class="[/^[a-zA-Z0-9]/.test(word.word) ? '' : 'hanzi-fz']"
                                 :style="{
                                 :style="{
+                                  fontFamily: /^[a-zA-Z0-9]/.test(word.word) ? '' : '楷体',
                                   fontSize: wordFontsize + 'px',
                                   fontSize: wordFontsize + 'px',
                                   lineHeight: wordLineHeight + 'px',
                                   lineHeight: wordLineHeight + 'px',
                                   background: word.color ? word.color : '',
                                   background: word.color ? word.color : '',
@@ -652,6 +657,7 @@
                                 class="hanzi"
                                 class="hanzi"
                                 :class="[/^[a-zA-Z0-9]/.test(word.word) ? '' : 'hanzi-fz']"
                                 :class="[/^[a-zA-Z0-9]/.test(word.word) ? '' : 'hanzi-fz']"
                                 :style="{
                                 :style="{
+                                  fontFamily: /^[a-zA-Z0-9]/.test(word.word) ? '' : '楷体',
                                   fontSize: wordFontsize + 'px',
                                   fontSize: wordFontsize + 'px',
                                   lineHeight: wordLineHeight + 'px',
                                   lineHeight: wordLineHeight + 'px',
                                   background: word.color ? word.color : '',
                                   background: word.color ? word.color : '',
@@ -732,6 +738,7 @@
                             class="hanzi"
                             class="hanzi"
                             :class="[/^[a-zA-Z0-9]/.test(word.word) ? '' : 'hanzi-fz']"
                             :class="[/^[a-zA-Z0-9]/.test(word.word) ? '' : 'hanzi-fz']"
                             :style="{
                             :style="{
+                              fontFamily: /^[a-zA-Z0-9]/.test(word.word) ? '' : '楷体',
                               fontSize: wordFontsize + 'px',
                               fontSize: wordFontsize + 'px',
                               lineHeight: wordLineHeight + 'px',
                               lineHeight: wordLineHeight + 'px',
                               background: word.color ? word.color : '',
                               background: word.color ? word.color : '',
@@ -801,6 +808,7 @@
                           class="hanzi"
                           class="hanzi"
                           :class="[/^[a-zA-Z0-9]/.test(word.word) ? '' : 'hanzi-fz']"
                           :class="[/^[a-zA-Z0-9]/.test(word.word) ? '' : 'hanzi-fz']"
                           :style="{
                           :style="{
+                            fontFamily: /^[a-zA-Z0-9]/.test(word.word) ? '' : '楷体',
                             fontSize: wordFontsize + 'px',
                             fontSize: wordFontsize + 'px',
                             lineHeight: wordLineHeight + 'px',
                             lineHeight: wordLineHeight + 'px',
                             background: word.color ? word.color : '',
                             background: word.color ? word.color : '',
@@ -1004,9 +1012,32 @@ export default {
         // newhtml = this.$(".articel").html();
         // newhtml = this.$(".articel").html();
         // this.$(".articel").html(html);
         // this.$(".articel").html(html);
       }
       }
+      let richness =
+        '<div style="text-align:center;font-size: 五号;font-weight: 600;line-height: 22px;color: #a5a5a5;">' +
+        '音节丰富度 ' +
+        (this.difficulty.pinyinDifficulty * 1).toFixed(2) +
+        ' | ' +
+        this.base.pinyinCount +
+        '/' +
+        this.base.pinyinTextCount +
+        '  ||  ' +
+        '汉字丰富度 ' +
+        (this.difficulty.wordDifficulty * 1).toFixed(2) +
+        ' | ' +
+        this.base.wordCount +
+        '/' +
+        this.base.wordTextCount +
+        '  ||  ' +
+        '词汇丰富度 ' +
+        (this.difficulty.vocabularyDifficulty * 1).toFixed(2) +
+        ' | ' +
+        this.base.vocabularyCount +
+        '/' +
+        this.base.vocabularyTextCount +
+        '</div><br/>';
       let dv = document.createElement('div');
       let dv = document.createElement('div');
       dv.id = 'html_dv';
       dv.id = 'html_dv';
-      dv.innerHTML = html;
+      dv.innerHTML = richness + html;
       dv.style.display = 'none';
       dv.style.display = 'none';
       document.body.appendChild(dv);
       document.body.appendChild(dv);
       let cxzcxz = this.$('#html_dv').html();
       let cxzcxz = this.$('#html_dv').html();