Skip to content

Conversation

@antmarakis
Copy link
Collaborator

@antmarakis antmarakis commented Mar 28, 2017

In viterbi_segment, the calculation P[w] * best[i - len(w)] is used twice in a row, so I stored it into a variable (curr_score) and used that instead.

Also made quotation and spacing fixes to the comments.

w = text[j:i]
if P[w] * best[i - len(w)] >= best[i]:
best[i] = P[w] * best[i - len(w)]
curr_score = P[w] * best[i - len(w)]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have seen curr_something (or currSomething etc.) pop up a lot around, so I assume most people will get it. The problem with p_score is that p doesn't give enough information, which is not the same case as curr_score.

I personally feel it's fine, but I don't feel strongly about it. If more have the same issue, I will change it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. I'm sure most won't have an issue.

@antmarakis
Copy link
Collaborator Author

Branch was deleted, will make a new PR.

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

Successfully merging this pull request may close these issues.

2 participants