Go中文分词 Sego

码农软件 · 软件分类 · 中文分词库 · 2019-08-28 18:26:35

软件介绍

词典用双数组trie(Double-Array Trie)实现, 分词器算法为基于词频的最短路径加动态规划。

支持普通和搜索引擎两种分词模式,支持用户词典、词性标注,可运行JSON RPC服务。

分词速度单线程9MB/s,goroutines并发42MB/s(8核Macbook Pro)。

示例代码:

package main

import (
    "fmt"
    "github.com/huichen/sego"
)

func main() {
    // 载入词典
    var segmenter sego.Segmenter
    segmenter.LoadDictionary("github.com/huichen/sego/data/dictionary.txt")

    // 分词
    text := []byte("中华人民共和国中央人民政府")
    segments := segmenter.Segment(text)

    // 处理分词结果
    // 支持普通模式和搜索模式两种分词,见代码中SegmentsToString函数的注释。
    fmt.Println(sego.SegmentsToString(segments, false)) 
}

本文地址:https://www.codercto.com/soft/d/13374.html

Building Web Reputation Systems

Building Web Reputation Systems

Randy Farmer、Bryce Glass / Yahoo Press / 2010 / GBP 31.99

What do Amazon's product reviews, eBay's feedback score system, Slashdot's Karma System, and Xbox Live's Achievements have in common? They're all examples of successful reputation systems that enable ......一起来看看 《Building Web Reputation Systems》 这本书的介绍吧!

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换