Skip to content

Commit

Permalink
fix: 降低词云阈值
Browse files Browse the repository at this point in the history
  • Loading branch information
ikechan8370 committed Nov 7, 2023
1 parent a45be2e commit 56a8937
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions utils/wordcloud/tokenizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ export class Tokenizer {
.join('').trim()
)
.map(c => {
let length = c.length
let threshold = 10
if (length < 100 && length > 50) {
threshold = 6
} else if (length <= 50 && length > 25) {
threshold = 3
} else if (length <= 25) {
threshold = 2
}
// let length = c.length
let threshold = 2
// if (length < 100 && length > 50) {
// threshold = 6
// } else if (length <= 50 && length > 25) {
// threshold = 3
// } else if (length <= 25) {
// threshold = 2
// }
return nodejieba.extract(c, threshold)
})
.reduce((acc, curr) => acc.concat(curr), [])
Expand Down

0 comments on commit 56a8937

Please sign in to comment.