finalseg
jieba's finalseg port to nim
Summary
| Latest Version | Unknown |
|---|---|
| License | MIT |
| CI Status | Passing |
| Downloads | 0 |
| Last Indexed | 2026-07-21 05:24 |
Tags
Installation
nimble install finalseg
choosenim install finalseg
git clone https://github.com/bung87/finalseg
OS Compatibility
| Platform | Linux | macOS | Windows | FreeBSD | OpenBSD | NetBSD | Android | iOS | WASM | Embedded |
|---|---|---|---|---|---|---|---|---|---|---|
| finalseg | ✓ | ✓ | ✓ | - | - | - | - | - | - | - |
Source
| Repository | https://github.com/bung87/finalseg |
|---|---|
| Homepage | https://github.com/bung87/finalseg |
| Documentation | View Documentation |
| Registry Source | nimble_official |
README
finalseg
Chinese Words Segment Library in Nim based on HMM Model
porting from jieba's finalseg module
Usage
import finalseg
import strutils
let sentence_list = @[
"姚晨和老凌离婚了",
"他说的确实在理",
"长春市长春节讲话"
]
for sentence in sentence_list:
for x in cut(sentence)
echo x
# or
for sentence in sentence_list:
seg_list = lcut(sentence)
echo seg_list.join("/ ")
Algorithm
- Hidden Markov Models, Viterbi