Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Index Out Of Range in TextRankWithPOS #5

Open
huntrist opened this issue Aug 17, 2017 · 0 comments
Open

Index Out Of Range in TextRankWithPOS #5

huntrist opened this issue Aug 17, 2017 · 0 comments

Comments

@huntrist
Copy link

In analyse/textrank.go
TextRankWithPOS function:
the line:

for j := i + 1; j < i+span && j <= len(pairs); j++

will cause an index out of range panic
when i = len(pairs) - 1 (the last element of the pairs)

change j <= len(pairs) to j < len(pairs) should fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant