Open sushain97 opened 6 years ago
@sushain97
In [1]: import apertium
In [2]: a = apertium.Analyzer('en')
In [3]: a
Out[3]: Analyzer(mode=eng-morph, lang=eng)
Is the structure okay ?
Ideally, __repr__
would recreate the class. So, repr(a) == "Analyzer(lang='eng')"
and str(a) == "<Analyzer: eng-morph>"
seems nice.
@sushain97 what about for the Translator
module?
I don't have mode there.
we just parse mode files in that module.
What should the __str__()
have?
There is a mode. It's something like spa-cat_valencia. The fact that we're parsing a mode implies there is one.
I'm not sure what they are now but they're probably not too helpful