baidu / baidu/lac

疑问,lac.add_word如何使用

Open
#136 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
4k
Forks
592
PR merge metrics
No merged PRs in 30d

Description

试了下,比如添加一个成语“红红火火”,
lac.add_word('红红火火', sep=None)
lac.run("他这一生红红火火了一把")
追后的结果还是把红红火火拆成了 '红红'和'火火',
[['他', '这一生', '红红', '火火', '了', '一把'], ['r', 'r', 'a', 'a', 'u', 'm']]
请教下各位大神,是我操作不对么

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the reported Python snippet with lac.add_word('红红火火', sep=None) and lac.run(...). Read the add_word API behavior and relevant segmentation entry points to determine why the custom word is split; done means the example keeps “红红火火” as one token, with the expected output verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.