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

Consolidate mode, string_format parameters #9

Open
suminb opened this issue Oct 31, 2019 · 0 comments
Open

Consolidate mode, string_format parameters #9

suminb opened this issue Oct 31, 2019 · 0 comments
Assignees

Comments

@suminb
Copy link
Owner

suminb commented Oct 31, 2019

It is possible to specify a translation mode when calling translate().

hanja.translate('大韓民國은 民主共和國이다.', 'substitution')
hanja.translate('大韓民國은 民主共和國이다.', 'combination-text')

It is also possible to provide a custom translation mode by supplying format_string parameter.

hanja.translate('大韓民國은 民主共和國이다.', 'combination-text', format_string='{hanja} {hangul}')

In such cases, the mode parameter does not serve any purposes.

I would like to revise translate() so it only takes format_string parameter, and we provide pre-defined format strings for existing translation modes (substitution, combination-text, combination-html). It will look like this:

hanja.translate('大韓民國은 民主共和國이다.', Mode.substitution)
hanja.translate('大韓民國은 民主共和國이다.', Mode.combination_text)
hanja.translate('大韓民國은 民主共和國이다.', '{hanja} <{hangul}>')
@suminb suminb self-assigned this Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant