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

只按照单词频率来纠正吗? #11

Open
Skywalker-Harrison opened this issue Jul 25, 2022 · 0 comments
Open

只按照单词频率来纠正吗? #11

Skywalker-Harrison opened this issue Jul 25, 2022 · 0 comments

Comments

@Skywalker-Harrison
Copy link

我看到如下代码, 似乎只考虑了单词的频率,而没有结合语境考虑问题. 感觉需要改进算法
def auto_correct( error_phrase ):

c1_order, c2_order, c3_order = get_candidates(error_phrase)
# print c1_order, c2_order, c3_order
if c1_order:
    return max(c1_order, key=phrase_freq.get )
elif c2_order:
    return max(c2_order, key=phrase_freq.get )
else:
    return max(c3_order, key=phrase_freq.get )
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