提交一版
parent
959678187e
commit
1e719517e5
@ -0,0 +1,17 @@
|
||||
package com.ruoyi.biemo.nlp;
|
||||
|
||||
import com.hankcs.hanlp.dictionary.CoreSynonymDictionary;
|
||||
|
||||
//相似度计算
|
||||
public class WordDistanceUtils {
|
||||
|
||||
//语义距离
|
||||
public Long distance(String a,String b){
|
||||
return CoreSynonymDictionary.distance(a, b);
|
||||
}
|
||||
|
||||
//语义相似度
|
||||
public Double similarity(String a,String b){
|
||||
return CoreSynonymDictionary.similarity(a, b);
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
<template>
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>{{cardName}}</span>
|
||||
</div>
|
||||
<div v-for="(o,index) in docInfoList" :key="index" class="text item">
|
||||
{{flag + ' ' +o.title +' '+ parseTime(o.updateTime,'{y}-{m}-{d})')}}
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listDocInfo } from "@/api/biemo/docInfo";
|
||||
|
||||
export default {
|
||||
data(){
|
||||
return{
|
||||
docInfo:{hot:this.hot,recommend:this.recommend},
|
||||
docInfoList:[]
|
||||
}
|
||||
},
|
||||
props: ["cardName","hot","recommend","flag"],
|
||||
mounted(){
|
||||
this.getList(this.docInfo)
|
||||
},
|
||||
methods: {
|
||||
getList(query){
|
||||
listDocInfo(query).then(response=>{
|
||||
this.docInfoList = response.rows;
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
.clearfix:before,
|
||||
.clearfix:after {
|
||||
display: table;
|
||||
content: "";
|
||||
}
|
||||
.clearfix:after {
|
||||
clear: both
|
||||
}
|
||||
|
||||
.box-card {
|
||||
width: 480px;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue