Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

while 方法可能少写break #1

Closed
timlincool opened this issue Mar 30, 2015 · 1 comment
Closed

while 方法可能少写break #1

timlincool opened this issue Mar 30, 2015 · 1 comment

Comments

@timlincool
Copy link

java新手第一次使用github,如有缺失请见谅

使用 findbugs找到的,报以下错误
Value of Node.label from previous case is overwritten here due to switch statement fall through [Scariest(1), High confidence]

在 com.hankcs.hanlp.dependency.common.Node的第182行

        case wh:
            label = "x";
        case begin:
            label = "root";
            break;

case wh 没有break ,不确定这样是否会造成问题。

@hankcs
Copy link
Owner

hankcs commented Mar 30, 2015

谢谢指正,一时疏忽了。

这部分代码的作用是将词性从新版北大标注集映射到旧版,以兼容句法分析所使用的清华依存语料库。以w开头的词性是一些标点符号,可能会对标点造成影响。不过清华依存语料库中完全没有标点,所以对最终结果没有影响,倒是有些不严谨。

我已加上break,再次感谢。

@hankcs hankcs closed this as completed Mar 30, 2015
hankcs pushed a commit that referenced this issue Apr 27, 2017
移除逻辑重复的语句
hankcs pushed a commit that referenced this issue Jul 23, 2017
pull changes from hankcs/HanLP
hankcs pushed a commit that referenced this issue Apr 4, 2018
从主版本同步更新
hankcs pushed a commit that referenced this issue Jan 10, 2020
从主版本同步更新
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants