tsroten / dragonmapper

Identification and conversion functions for Chinese text processing
MIT License
54 stars 18 forks source link

HTML Formatting #18

Open TTWNO-zz opened 8 years ago

TTWNO-zz commented 8 years ago

Using dragonmapper's APIs get HTML output like this (requires styling, included):

Image 1 Image 2, with FZKai-Extended font

TTWNO-zz commented 8 years ago

Sorry for pushing multiple commits to travis-cl.

tsroten commented 8 years ago

@TTWNO This is a neat idea! Thanks for the pull request. I'm at a conference right now, but I'll test/review it as soon as I can. Thanks!

TTWNO-zz commented 8 years ago

Sound good! Happy to help!

TTWNO-zz commented 8 years ago

More features have been added. Please wait until I can fully implement them and push.

TTWNO-zz commented 8 years ago

Tada!

TTWNO-zz commented 8 years ago

("Tada!" means the code is [basically] done... No rush, just sayin')

TTWNO-zz commented 8 years ago

(Polite poke)

tsroten commented 8 years ago

@TTWNO Looking now :)

TTWNO-zz commented 8 years ago

Tada!

TTWNO-zz commented 8 years ago

The keep_punct varibles is set to false when you want to give different data to the to_html() function, in the form of an array.

zi = ["你", "好"] know_ni_not_hao = ["ㄋㄧˇ", ""]

to_html(zi, right=tone_marks, keep_punct=False)

Will put zhuyin only on the first character.

TTWNO-zz commented 8 years ago

More useful in this case:

zi = ["我", "說", "「", "你", "好", "」"] know_some_chars = ["wǒ", "", "", "nǐ", "hǎo", ""]

to_html(zi, bottom=know_some_chars, keep_punct=False) No pinyin will be under 說

TTWNO-zz commented 8 years ago

keep_punct is a bad name for the variable though

TTWNO-zz commented 8 years ago

That's better!

I completely got rid of keep_punct, and now the function just automatically decides what to do with the input.

TTWNO-zz commented 8 years ago

Would you like to check the code again?

Any other improvments I should make?

TTWNO-zz commented 8 years ago

Done some nice overhauling, making it much easier to reference with CSS. What's the status on the merge?

TTWNO-zz commented 7 years ago

(Polite poke 2)