Skip to content

fix(word): WordExtractor._all_cohesion_scores max() 빈 시퀀스 ValueError #308

@lovit

Description

@lovit

문제

soynlp/word/word.py:409, 442

max_l_length = max(l_groupby_len)
max_r_length = max(r_groupby_len)

L 또는 R 빈도 맵이 비어 있을 경우 max() 호출 시 ValueError: max() arg is an empty sequence 발생.

해결 방법

if not l_groupby_len: return 0.0 혹은 max(l_groupby_len, default=0) 사용.

영향 범위

  • WordExtractor 내부 메서드

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions