Categorygithub.com/cryptography-research-lab/go-sentence-score

# README

句子打分

一、概述

用来区分一个句子中含有的有效的单词的数量,其实就是一个简单的分词,用于在一些暴力枚举破解字典的场景下把尽可能真实的解找出来。

二、安装

go get -u github.com/cryptography-research-lab/go-sentence-score

三、示例代码

package main

import (
	"fmt"
	sentence_score "github.com/cryptography-research-lab/go-sentence-score"
)

func main() {

	// 计算单个句子
	s := "1123thisisverybkjkjbsecurityfghfkeyassdfdfadasdasdasdasdasdasdasdgoodasdasdking"
	words, score := sentence_score.CalculateScore(s)
	fmt.Println(words)
	fmt.Println(score)

	// 计算多个句子并排序
	slice := []string{
		"1123thisisverybkjkjbsecurityfghfkeygoodasdasdking",
		"1123thisisverybkjkintenetjbsecurityfghfkeygoodasdasdking",
		"1123thisisverybknamejkjbsecurityfghfkeygoodasdasdking",
	}
	sort := sentence_score.CalculateScoreAndDescSort(slice)
	fmt.Println(sort)

}

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# Functions

CalculateScore 为字符串计算得分.
CalculateScoreAndDescSort 对一组字符串计算得分并倒序排序.
LoadBuiltinDictionary 加载内建的词典.
No description provided by the author

# Variables

BuiltinDictionary 内建的词典.

# Structs

CalculateScoreAndSortResultItem 对上一项的每条计算结果.
No description provided by the author