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

detrucase Error: unsupported operand type(s) #106

Open
colingair opened this issue Aug 23, 2020 · 0 comments
Open

detrucase Error: unsupported operand type(s) #106

colingair opened this issue Aug 23, 2020 · 0 comments

Comments

@colingair
Copy link

use_known=True gives error
Look at the followings:

mtr = MosesTruecaser("mymodel_x")
mtr.truecase("THE ADVENTURES OF SHERLOCK HOLMES")
['the', 'adventures', 'OF', 'Sherlock', 'HOLMES']
mtr.truecase("THE ADVENTURES OF SHERLOCK HOLMES", return_str=True)
'the adventures OF Sherlock HOLMES'
mtr.truecase("THE ADVENTURES OF SHERLOCK HOLMES", return_str=True, use_known=True)
Traceback (most recent call last):
File "", line 1, in
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/sacremoses/truecase.py", line 306, in truecase
token = token + other_factors
TypeError: unsupported operand type(s) for +: 'int' and 'str'
mdtr.detruecase("the adventures OF Sherlock HOLMES", return_str=True)
'The adventures OF Sherlock HOLMES'

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