Advertisement
Guest User

Untitled

a guest
May 15th, 2016
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. ----------
  2.  
  3. **update**
  4.  
  5. Both Alexey Golyshev and Rashid provide great solutions, though in terms of the quality of translation, Rashid's Google Translate solution is much better.
  6.  
  7. I want to add a workaround that is only specific to my example. My example actually comes from my recent post : [How to make a picture grid of all Nobel Laureates in physics?][4]
  8.  
  9. So the these names are all famous! They all got wikipedia pages! Fortunately, I just found Mathematica provides a function called `WikipediaData` which is quite useful. So here is the specific solution.
  10.  
  11. Clear[wikiTranslation];
  12. wikiTranslation[word_,language_:"Chinese"]:=language/.WikipediaData[word,"TitleTranslationRules"]
  13.  
  14. so
  15.  
  16. In[57]:= wikiTranslation/@ namelist
  17.  
  18. Out[57]= {"梶田隆章", "阿瑟 麦克唐纳", "赤崎勇", "天野浩", "中村修二"}
  19.  
  20. And actually this results are more accurate than google translation. e.g. 梶田隆章 is the official translation appears on all media in China
  21.  
  22. I think this wikipedia method should be the best solution for proper names: such as celebrity, countries, famous place etc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement