Questions tagged [pinyin]

9 questions
1
vote
1 answer

All Python Permutations and Combinations of Pinyin (Mandarin Romanization)

I'm looking to make a list of toneless pinyin combinations/permutations. import pandas as pd data = pd.read_csv('chinese_tones.txt', sep=" ", header=None) data.columns = ["pinyin", "character"] data['pinyin'] = data['pinyin'].str.replace('\d+',…
Alex
  • 73
  • 6
1
vote
1 answer

Encoding pinyin

I'm currently developing a program in java, and I want to display Chinese pinyin, which I get from a distant website. But I have the following problem: Chinese pinyin is displayed this way: jiǎ Whereas it should be displayed this way: jiǎ (I…
0
votes
0 answers

Streamlit Cannot insert Chinese charaters in the input text-box

I used streamlit to build up a web for chatbot. However, when I insert the Chinese characters, I encountered two senarios: I cannot insert Chinese; I can insert Chinese but I have to invok the “input method” every time when I insert. The above…
ZHANG Juenjie
  • 501
  • 5
  • 20
0
votes
2 answers

Failure to change ruby text's font via field codes

I run the below macro code that is capable of adding phonetic pinyin to all the selected Chinese text at once. However, that code can only add the ruby text using default settings for font and I need to modify the the font, positioning, and font…
0
votes
1 answer

Pinyin packages: accuracy and efficiency

I am looking to get the pinyin of Simplified Mandarin characters, and have come across two packages: pinyin 0.4.0 which is 6 years old (GitHub repo here) pinyin_jyutping_sentence which is 2> years old. (GitHub repo here) Both offer similar…
Thomas
  • 192
  • 2
  • 10
0
votes
0 answers

How can I show pinyin on top of characters using PySide?

Image of pinyin on top of Chinese characters.: I have a string of Chinese characters and their respective pinyin. Is there any way I can display them as text like in the image above with PySide? I have tried something like this for the CSS…
0
votes
0 answers

Search via PinYin in Azure SQL NVarchar column with Simplified Chinese Characters

I have a client who is asking me to enable Pinyin searching on an autocomplete input on web app. The filter hits an Azure SQL database and uses the following where statement. WHERE countryName LIKE N'%美国%' This works when the user enters the…
0
votes
1 answer

How to identify the tones in Chinese text?

Is there a programmatic way to identify the tones in Chinese text? For an input string like 苹果 I need to extract the tones as 2 and 3 as it would be indicated in the pinyin transliteration píng guǒ or ping2 guo3. I guess a possible workaround would…
ccpizza
  • 28,968
  • 18
  • 162
  • 169
-1
votes
1 answer

why I got an error ''float' object is not iterable' while using apply lambda

I try to convert a list of Chinese province into pinyin use pinyin package, code like below: df['province'] = df['comb_province'].apply(lambda x: pinyin.get(x, format="strip", delimiter='')) but I got an error says: 'float' object is not iterable.…
Qing
  • 63
  • 1
  • 2
  • 8