22
submitted 1 month ago by [email protected] to c/[email protected]

You could use it for pinyin annotations too, or really any combination of scripts.

{睾丸 |こ がん}に{豚|ぶた}の{糞|くそ}

{猪蛋蛋上的粪便 | Zhū dàn dàn shàng de fèn biàn}

{фекалии|fekalii} {на|na} {свиных|svinykh} {яйцах | yaytsakh}

People were just talking about this in a thread earlier but I can't find it anymore. Figured this would be a good place for it.

Check out the source code of this post. It actually looks for space characters after the pipe symbol and uses that to group the furigana. It's actually easiest to use for Chinese, Japanese is a bit more work, and alphabetical scripts are pretty time consuming, because you have to mark up each word with brackets and pipes, spaces don't cut it.

top 3 comments
sorted by: hot top controversial new old
[-] [email protected] 2 points 1 month ago* (last edited 1 month ago)

Ooh, I knew about the basic syntax but I didn't know about the spaces thing! Should definitely same some time and hassle. Also makes copy-pasting the text much nicer, since the ruby text goes after each bracket grouping which is pretty terrible if you've marked up each individual character.

The one potential downside is that this approach doesn't add additional space between each group if the ruby text is long and spills over to neighboring groups. Compare these two results, where the top uses the spaces approach and the bottom individually marks each word/particle:

{猪蛋蛋上的粪便 | Zhū dàn dàn shàng de fèn biàn}

{猪|Zhū}{蛋蛋|dàndàn}{上|shàng}{的|de}{粪便|fènbiàn}

You can see that some extra space is left around 上 so that shàng can remain centered over it. However, there's a separate downside to this: it appears that while it will prevent ruby text from outright overlapping, it doesn't actually try to insert any space between adjacent groupings. So if I use the same pinyin style as your original post, the result around dàn dàn is not great:

{猪|Zhū}{蛋蛋|dàn dàn}{上|shàng}{的|de}{粪便|fèn biàn}

You can combat this by adding trailing spaces as needed, but it will look a bit haphazard because the space is included in the width when centering the ruby text, making everything look shifted to the left (here I put spaces after Zhū and dàn dàn):

{猪|Zhū }{蛋蛋|dàn dàn }{上|shàng}{的|de}{粪便|fèn biàn}

Unless the text is so long that it becomes difficult to understand which reading goes with which character(s), it's more of an aesthetic choice than anything; personally I like having the extra space, but I could see some not liking the irregularity. Probably less of an issue for Chinese than it is for Japanese where furigana can be much longer than the word, especially with some kun'yomi or wonky stuff used in fiction.

[-] [email protected] 1 points 1 month ago

what is lemmy I keep seeing people talking about it

[-] [email protected] 2 points 1 month ago* (last edited 1 month ago)

hexbear was built off code similar to lemmy, and then we semi-merged with the actual site, implementing the proper lemmy base code plus more neatly separated code for the custom functionality here. This allowed cross posting,

this post was submitted on 03 Jun 2024
22 points (100.0% liked)

languagelearning

14169 readers
2 users here now

Building Solidarity - One Word at a Time

Rules:

  1. No horny posting
  2. No pooh posting
  3. Don't be an ass

founded 3 years ago
MODERATORS