Saturday, February 23, 2013

ChineseWriter just got on steroids

I have made during the past month significant new development to my Chinese Writer software. The most significant change is integration of the free CC-CEDICT Chinese-English dictionary to the software. Originally ChineseWriter was based on database of words I updated and developed myself. During the months before CC-CEDICT integration I had been slowly adding new words to the database, getting up to around 1200 words. However, the need to add new words still arouse regularly during writing, disturbing the writing process.

Now there will be never anymore need to add words: current edition of CC-CEDICT contains a whopping 105 262 words! I would never had possibility to come even close to such collection by my own efforts. CC-CEDICT is maintained by a group of volunteers, available freely and, most important of all, available in format that is easily readable by computer software.

Such humongous list of words is not, however, without its downsides. Only some 2000-5000 words are reasonably common, which means that 95% of the dictionary entries are very rare, archaic or otherwise weird entries. When searching for a hanyu word to match entered pinyin, this flood of rare entries can come into way, making it more difficult to find the desired (usually common) word. CC-CEDICT does not contain in itself any information about relative frequencies of its entries in regular text, so there is not information to select automatically the common case(s). This is where my humble hand-collected list of ~1200 words come back into use: I used that as basis of list of frequently used words that are sorted to top of list of suggestions for given pinyin input. This gives best of both worlds: huge database to interpret Chinese text yet concise list of common suggestions when writing.

Screen shot of the current version of my ChineseWriter software.
Other significant change involves the text entering and editing area. The original version of the software had three separate fields for the hanyu, pinyin and combined representations of the text. Of these only the hanyi field was editable. This made it difficult to edit text for a person with limited recognition of the hanyu characters. In the current version text is edited and pinyin is entered directly in the same field where the final characters are displayed. This simplifies significantly editing of the text.

Other less significant, yet important additions to usability include:

  • Color-coding of hanyu characters and pinyin with standard colour codes for tones (red first tine, yellow second tone, green third tone, blue fourth tone and black neutral tone).
  • For multi-character words the breakdown of the word to characters and the meanings of individual characters are shown on mouse-over.
  • WPF DataGrid used for listing of hanyu suggestions, up to 50 suggestions are shown.
  • Pinyin input can be given with tone markers (eg. "mei3tian1") or without tone markers ("meitian").
  • Simple entering of literal latin text among hanyu.
  • Enter-key can be used to select #1 suggestion, CTRL+n select suggestions 1-9 respectively and mouse click to select any suggestion.
  • Horizontal scrolling of long chinese texts and vertical scrolling of suggestions.

Developing ChineseWriter with Visual Studio 2012, C# 4.0 and WPF


The devilish hanyu ambiguity


I have in the past written about the ambiguity of pronunciation in Mandarin Chinese: how for a single pronunciation even in same tone there usually are very many different matching meanings with different hanyu characters. The usually given example is the fourth tone sound shì which can mean (and be written as), among several other possibilities:
is / are / am / yes / to be


market / city


matter / thing / item / work / affair


room / work unit / grave / scabbard / family or clan



life / age / generation / era / world


(of time) to pass / to die


I am at this point of my studies quite used to this kind of ambiguity in pinyin, but now the working with a highly expanded set of characters has brought up another, more rare but more tricky ambiguity: ambiguity in the hanyu itself. Example of this is the hanyu character 地. Consider two examples:

  fāng     (region)
来回来去   lái huí lái qù de    (backwards and forwards)

In the first example of "region" 地 corresponds to pronunciation (di fouth tone) and means "earth". In the second case the exactly same 地 corresponds to pronunciation de (de neutral tone) and works as a structural particle modifying adverbial adjunct.

I admit that these cases are not very common, but they create devilish complication to the development of Chinese processing software since the hanyu characters can't be any more considered to be the non-ambivalent and unique gold standard for lookups. A word is only fully uniquely defined when both its hanyu and pinyin are expressed together. For a software program like ChineseWriter that needs to parse stream of hanyu to words, this ambiguity increases the challenge of implementation considerably.

Friday, February 22, 2013

Makeup

In Yunnan summer 2012
When I first met Jinlin on-line and when we were travelling together in Yunnan in summer 2012 she did not use any make-up. We had been briefly touching the subject in some of our chats and agreed that it is really not necessary. And it was not, she is very pretty with and without make-up.

Her university studies have brought a definite change in her interest to make-up and I have now seen her using make-up more regularly in our video chats and time together. I have been amused by her seemingly sincere pride in developing her make-up skills: Being a student of art and design, she is clearly putting effort also in researching most suitable types and ways of make-up for her features. In Shanghai she showed me numerous pictures of make-up application examples and instructions she had collected to her mobile phone. She seems to be indeed now quite proficient in applying eye-liner, mascara and mild-coloured lipstick. But she is also using make-up in ways I was previously unaware of: she is using some light and dark colours at certain locations on and around her nose to create shadow effects and apparent change in the shape of her nose - quite clever!

Putting on make-up after shower in Xinxiang
What's even more cute, she seems to enjoy doing the make-up with me watching - on the spot or at a video-chat. On our 2013-01-02 video chat she wrote me:
我 现在 要 化妆 ( I now want to put on make-up )
你 可以 看 ( You can watch )
啊 哈 我 在 我 的 脸 上 画 画 ( Ha! I will paint on my face )
你 可以 看 到 我 的 变化 ( You can watch at my transformation )
Ready to party :-)
In any case, Jinlins change with make-up is reasonably mild. For more radical transformations of Asian women with and without make-up, you can look at this amazing comparison in ChinaSmack.

Thursday, February 14, 2013

Friend from Xinxiang

There are not many foreigners in Xinxiang. Walking on the streets as one and talking with locals with my clumsy Chinese does occasionally draw some interest. But it is remarkable that it always seems to be nice positive kind of interest. I can contrast this to the two possible alternatives for attitude that foreign people invoke in Finland: indifference on the other hand and negative racist attitudes on the other. I would say that the latter is nowadays fortunately rather rare and mild, but still distinctly negative. So with this background it is remarkable, very happy and encouraging to go around in a place where you are different but your difference is perceived as interesting in a positive way.

I do not have the habit of easily starting discussions with strangers but the genuinely positive and encouraging attitude of Chinese people towards me has resulted on my recent China trips in me chatting with strangers using my poor Chinese skills more often than I do with strangers here in Finland with fluent Finnish.

People in Xinxiang are generally not fluent in English. At some point of chat I usually ask Nǐ  Shuō  Yīng yǔ  Ma ? (Do you speak English?) and get replied that this is not the case. Not so with 刘 明, Ming Liu. In the evenings when Jinlin had returned to her aunts home I often went to eat to a particular restaurant in the neighbourhood of my hotel. This was a sort of Chinese fast-food place with huge number of different foods on display so that I would not have to know the names of all the dishes but I could just point to some and say "Wǒ  Yào  Nà gè" (I want that). Ming Liu was working in this restaurant. He spotted my meagre Chinese interaction with the other personnel and come to say in good English: "You can order anything you want."

刘 明, Ming Liu
I often come to the restaurant at times when there were not many other customers so employees were not particularly busy. So starting from my second visit for a tasty meal we continued to chat with Ming all though my dinner. I tried to speak mostly Chinese to him and he spoke mostly English to me. We talked of me and Jinlin, my work as software developer at Finland, his studies, our future plans and aspects of the Chinese culture.

On my visit to the restaurant on my last evening in Xinxiang we exchanged QQ messenger numbers and have been chatting in QQ since then. He has been very helpful to me. On technical level he has telling me about freegate, a powerful and free anti-censorship proxy software. This can be used by Chinese people (or western people travelling to China) to bypass the "Great firewall" that prevents access to Facebook and Google among other things. This is in a way better than the VPN-service I have used so far because the proxy is effective only for non-Chinese web-sites and allows direct fast connection to Chinese sites in China.

Ming Liu has been helpful in my continued learning of Chinese language. I use my ChineseWriter software to write Chinese to him in QQ chat and he occasionally instructs me in more fluent usage of grammar and words. Jinlin has, in contrast, had an understandable hesitation in correcting my bad sentences. I can also help Ming Liu to improve his already good English skills further. There does not seem to be any single reason why he stands our from the crowd with his English skills, but I think big part is about attitude: about willingness to speak and write and not be too shy despite still lacking some skills.

We have also continued to chat a lot about my relationship with Jinlin, the joys and challenges of inter-cultural relationship, the typical features of Chinese culture and mentality as applied to relationships. Jinlin is still in Anhui at his fathers relatives without her computer, so our chats with her are infrequent and short and it is nice to carry on writing Chinese with Ming meanwhile. In regard to the powerful role of parents in their children's lives (even when the children are already adults), Ming told of his own case of studying dentistry mainly due to pressure from his parents and not being really interested to work as a dentist. So he is now, at 22 years, looking for some new directions to his life. He is interested in computer programming and I have tried to encourage him to do some self-study and self-development in this area since the web is truly full of free material to study in the world of programming.

Tuesday, February 5, 2013

Family drama and the Lonely blues


Jinlin as a young ballerina
I had been speculating before the Xinxiang trip whether Jinlin would have the courage to show me to her mother. I did not estimate high probability for that outcome since early on in our relationship Jinlin was telling of her mothers not-hugely-approving attitude to our relationship. Since then the discussion about her mother and her opinions has been somewhat a taboo to Jinlin with my on-line questions on the topic usually receiving no response.

So although I brought many gifts from Finland to her mother has well, I was not surprised in the end that I did not meet her. What come, though, as a deep surprise was that Jinlin did not meet her mother either.

It turned out that her mother had not been in the town when Jinlin arrived from Shanghai at the end of her term on 21.1. and she was not in the town when I arrived. Jinlin told that her mother was on a work trip in Zhengzhou. She was supposed to come back to Xinxiang "soon" but she never did. Towards the end of my trip Jinlin told that her mother would return to Xinxiang only 8.2, two days before the Chinese new year. That would be five days after me leaving back to Helsinki and three days after Jinlin leaving from Xinxiang to Anhui to spend the new year with her father. Jinlins parents divorced when she was very young and during the Chinese New Years when families are supposed to unite for celebration this seems to create both emotional tension and practical difficulties.

Jinlins mother. Not a very high quality
picture, but the only one I have.

Work trips can be important, but I remain deeply surprised that Jinlins mother was not present in her home-town to see her daughter. Jinlin had been living with her mother for her whole life before moving to Shanghai for the university last September. When I was travelling with Jinlin in Yunnan last summer for three weeks, her mother called her every day and Jinlin told me that her mother "misses her a lot". But now when Jinlin had been living away her mother for five months and returning to her mothers home town for two weeks, her mother was nowhere to be seen. And not only that: Jinlin did not even have a key to her mothers apartment - to Jinlins own past home - and could not get in there for the whole time. This sounds so weird I can't avoid the thought that there is still some misunderstanding on my part, that I have not understood the complete picture.

So where did Jinlin stay? On the first days of my visit Jinlin told me that she is currently staying with her Jie jie (姐姐). Literally this means "older sister" but the relative in question is not really her sister (Jinlins only actual sister is a half-sister in Anhui from her fathers later marriage). I could not quite deduce their actual relationship, but I think most probably she was Jinlins aunt or cousin. (The Chinese terminology describing various family relationships is notoriously complex: for example there are 6 separate words for cousin and 10 different words for aunt depending on whether the cousin/aunt in question is from mothers or fathers side, older or younger than the mother/father, married to the family or blood-relative, etc.) Her Jie Jie has her family living at Anhui but works at Xinxiang 500 km away from here family.

Enter the lonely blues 


Jinlin told that she respects her Jie Jie and is grateful for the fact that Jie Jie takes care of her and lets her stay with her. Jinlin is a good girl and does not want to cause Jie Jie any worry. Now it turned out that this Jie Jie unfortunately worries quite easily about Jinlin. Jinlin wrote me:

"我 不能 留 在 酒店 我 必须 在 姐姐 家. 我 不 回 姐姐 家 她 很 担心 我. 我 和 她 说 过 但是 她 说 会 担心 因为 我 在 她 眼睛 里 是 孩"
"I cannot stay (late) in the hotel, I must go to my aunts home. If I do not return to her home, she will be very worried about me. I have been discussing with her, but she says she will be worried because in her eyes I am still just a child."
I guess the Jie Jie has not been told about me and Jinlin travelling three weeks together in Yunnan past summer. Well, I'm cool with that, I respect Jinlins respect for her Jie Jie and her worries. I did miss the warm close feeling of falling asleep and waking up together with her in the same bed. But during daytime from for the five days from Friday to Tuesday we had good time together in and out of the hotel. 

On Wednesday Jinlin sent me message that she has flu and headache, worsened by the the very difficult air pollution situation, and needs to rest for the day. What a shame. I asked if she would like to come to the hotel with a taxi to rest with me. No, she wouldn't. I guess the Jie Jie would worry about that. I asked if she would give her address so I could come with taxi to quickly visit her at her Jie Jie apartment. No, apparently that was not a good idea because of reasons related to the Jie Jie that did not become quite clear to me. The language there was difficult but I think the reasons involved the expression "she is complicated" and "her work is bad". Whatever those mean.

So I spent Wednesday mostly alone in the hotel-room. I sent her occasionally messages but got no replies.


On Thursday she replied but she was still too ill to meet me. I did go for a walk despite the pollution but mostly it was another day at hotel-room.

On Friday she has promised to come to see me and she did, for few hours, despite of having still bad headache. And on Saturday it was time for me to return to Zhengzhou airport with some definite shades of blues mixing in my mind with the good memories.

Now I am back in Finland, back to work, focusing to enjoy all the good stuff in my life here and hoping for a better future with Jinlin on "some sunny day" when we will have time and possibilities to be more together.