polm / cutlet

Japanese to romaji converter in Python
https://polm.github.io/cutlet/
MIT License
286 stars 20 forks source link

Maintain formatting? #23

Closed shimizurei closed 3 years ago

shimizurei commented 3 years ago

Hello,

Is it possible to maintain the formatting of input text? I like to structure Japanese lyrics for transliteration purposes, but have found that there are no services that maintain the formatting (other than RomajiDesu but it doesn't do Hepburn), so I usually end up with a huge block of text.

Screenshot 2021-04-16 07 15 58

polm commented 3 years ago

Hm, I hadn't considered that newlines and other whitespace are removed.

I don't think preserving that makes sense as a default cutlet feature, but it's pretty easy to add by preprocessing, so I could put it in the demo.

Also, when reporting an issue with specific input, please include sample text I can use for testing.

shimizurei commented 3 years ago

Sorry, I figured it was easy enough to replicate since all I did was add new lines to your default text in order to test the feature out initially. My text is just there to show my use case.

Thank you for considering the addition.

polm commented 3 years ago

OK, the demo has been updated to preserve formatting. The changes are pretty simple, you can check the source.