baidu / baidu/lac

Bug Report, lac.run() changed input text_list

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

Description

```python
lac = LAC(mode='lac')
text1 = ['', 'a']
text2 = ['', 'a']
print(text1==text2)
res = lac.run(text1)
print(text1==text2)
```

> True
> False

Seem that lac.run changed the input text where it shouldn't be.
That will happen when an empty string in the input list.
Should we use deepcopy() to avoid modifying input if we must modify something?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the reported lac.run() example with an input list containing an empty string and inspect the Python implementation behind that entry point. The fix is done when lac.run() no longer changes the caller's input list, with a regression test covering this case.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.