finalseg
jieba\'s finalseg port to nim
Summary
| Latest Version | 0.1.0 |
|---|---|
| License | MIT |
| CI Status | Failing |
| Downloads | 0 |
| Last Indexed | 2026-08-26 06:46 |
Tags
Authors
- bung87
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 | ✓ | ✓ | ✓ | - | - | - | - | - | - | - |
Dependencies
| Package | Version | Optional |
|---|---|---|
| nim >= | 0.19.0 | No |
| unicodedb | - | No |
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