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'
use_known=True gives error Look at the followings: