Comment

Comment by alisonatwork

If you're looking for a local translation tool, I wrote a small CC-CEDICT lookup script in shell+JS then eventually rewrote it in Go so I could run it on whatever computer I was using at the time: https://github.com/alisonatwork/cedict

It just does a dumb greedy search to try find the longest chain of characters for the translation, but that turns out to work more often than not:

  $ cedict -m 果汁很好喝
  果汁    [guǒ zhī]       /fruit juice/
  很      [hěn]   /(adverb of degree)/quite/very/awfully/
  好喝    [hǎo hē]        /tasty (drinks)/
I wanted to add different strategies on -s like dict(1), but I never got round to it because it was easy enough to just force breaking the word by adding spaces:

  $ cedict -m 入鄉隨俗
  入乡随俗        [rù xiāng suí sú]       /When you enter a village, follow the local customs (idiom); do as the natives do/When in Rome, do as the Romans do/
  $ cedict -m 入鄉 隨俗
  入      [rù]    /to enter/to go into/to join/to become a member of/to confirm or agree with/abbr. for 入聲|入声[rù shēng]/
  乡      [xiāng] /country or countryside/native place/home village or town/township (PRC administrative unit)/
  随俗    [suí sú]        /according to custom/to do as local custom requires/do as the Romans do/ 
Now I live in Taiwan it might be neat to update it to output traditional characters, but to be honest I think simplified is easier to read and learn for foriegners.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton