Chủ Nhật, 8 tháng 11, 2015

RomajiDesu has been updated with smart Japanese word decomposition

Watching real time search of user using Google analytics was somewhat very interesting. Many users, I suppose beginners, searched a verb in a changed form, not dictionary form - jishokei (辞書形). It made me think of my early days when self studied Japanese by trying to understand a favorite Japanese song, by copying a whole words into a dictionary without getting anything.

In the  the earlier version of RomajiDesu's Japanese Dictionary, if you searched "見てください", there'd be no result. But in this version, you will get the jishokei of the verb "見る", as well the possible conjugation form "Polite Imperative" (command). So from the verb (miru - look), and the inflection (polite imperative), you can easy guess the meaning: "Please look!"


It also words with Japanese noun and and adjective. And if you put in the search field a complex Japanese sentence, RomajiDesu will automatically decompose it into small and comprehensible components (which is similar to RomajiDesu's Japanese Translator). For example, "RomajiDesuが大好きです", into "RomajiDesu ga Daisukidesu" (I love RomajiDesu)





Chủ Nhật, 11 tháng 10, 2015

Wind visualization for meteorologist

This is my new creation for my department to visualize wind on different levels and forecast times. Streamline map is a very useful tool for forecasters, an animated wind map with speed indicator is even more useful I think. This is done using d3js and pure canvas javascript.

Thứ Tư, 11 tháng 3, 2015

New feature with RomajiDesu Kanji dictionary

RomajiDesu's Kanji dictionary has been updated with Chinese pinyin, Korean reading and Sino-Vietnamese (Hán Việt) reading. The updates have been done due to some suggestions from RomajiDesu users.  I don't really know how useful these updates are but as a Vietnamese, I found it's really cool to see how many words in Vietnamese, Chinese, and Japanese is related. The photo is my name (Hải) written Kanji, which means 'the sea' and pronounces  'hǎi' in Chinese, 'hae' in Korean, and 'kai' in Japanese ^_^

Thứ Ba, 13 tháng 1, 2015

A simple example of Delegate Pattern in Swift

Well, I've just start self learning to program iOS apps using Swift programming language. One early thing that you stumble into when learning it is a concept call "Delegate pattern". It's quite confusing for a self-taught learner like me and I've looked around for a good simple example. In wikipedia, there an article that explain the concept with many languages. However, I don't like the the functions and class names. So I try to rewrite the example which is simpler and funnier. Well, there's ways to go with Swift and iOS, but at least the first steps must be interesting, huh?

protocol AnimalBehavior {
    func eating()
    func calling()
}

class DogBehavior : AnimalBehavior{
    func eating(){
        println("The DOG is eating...")
    }
    func calling(){
        println("Wufff! Wufff!")
    }
}

class CatBehavior : AnimalBehavior{
    func eating(){
        println("The CAT is eating...")
    }
    func calling(){
        println("Meowwwww")
    }
}


class Animal{
    var behavior: AnimalBehavior;
    init(){
        behavior=DogBehavior();
    }
    func eating(){
        behavior.eating()
    }
    func calling(){
        behavior.calling()
    }
    func isACat(){
        behavior=CatBehavior()
    }
    func isADog(){
        behavior=DogBehavior()
    }
    
}


let myPet=Animal() // Notice this is not a variable but const
myPet.isACat();
myPet.calling(); // Meowwwwww
myPet.isADog();

myPet.calling(); // Wufff! Wufff!

Thứ Ba, 28 tháng 10, 2014

A little girl can help preserving Vietnamese traditional folk art?

Traditional folk art is something any nation wants to preserve but it's not always simple. I remembered one evening in 2013, we went to watch a Japanese Noh play "AMA" in a famous Noh theatre near Heian Jingu in Kyoto. The play was opened for free in order to introduce this special kind of Japanese traditional performance art to people, Japanese or 'gaijin' (foreigner). Even so, not all the seats were occupied. The reason is, even with the free leaflet that guided you how to enjoy the show, not many people in the theatre understand what's going on with the show. A native Japanese lady sat next to us said even she didn't fully understand the lyrics, which seems to be in old Japanese. Also, most of my Japanese friends say that they have never been watching a Noh play before.

Back to Vietnamese traditional art, "Chầu Văn" is a similar example. Originated around 16th century, it purpose is to serve Vietnamese traditional religious ritual (Đạo Mẫu), the genre once became a very popular kind of art. Now a day, Chầu văn is one of the national heritages of traditional culture. And again, not many people, especially young people, understand this genre. I've watched and listened to Chau Van many times before, but I didn't understand or enjoyed it either. Most other people simple don't care about this special art.

Until one day, this little kid showed up in the finale of Vietnamese's The Voice kid, 2014. Her beautiful performance and maybe her innocence, some how made the Chau Van song "Cô Đôi Thượng Ngàn" became so lively and enjoyable. Countless of young people gave whole hearted compliment to the performance and started to be interested in this type of art. Thien Nhan (the girl) became the champion of the show, and somehow give out this kind of art to many people, especially youngsters.

If you have no idea of what Chau Van is, then enjoy watching this




Thứ Sáu, 27 tháng 6, 2014

A new Japanese Translator and Morphological Analyser

Years ago, I stumbled on some of my favorite songs in Japanese and I always want to know the meaning of them. Many foreigner fans know Japanese lyrics in Romaji without knowing the meaning or how they write in Japanese. That's the reason I created the a Romaji to Hiragana/Katakana converter wich later became a comprehensive website that assisting learning language: RomajiDesu. Later, I stumbled on songs that I can only find the lyrics in Japanese and a natural need is to know how to pronounce them, ie. to convert from Japanese to Romaji. I did make such a converter back then using Edict Japanese dictionary and my simple PHP code. But I removed it from RomajiDesu after that because its performance is bad and the converter cannot perform well with such a complexity language as Japanese.

It's been a while since I meet Mecab, (Yet Another Part-of-Speech and Morphological Analyzer), and it's time I put back the converter, now called RomajiDesu Online Japanese Translator. The formula is:

Mecab + Edict + Kana to Romaji + Google translation = RomajiDesu translator.

 The result is as follows (Figure 1):
Figure 1. A screen short from RomajiDesu's Japanese translator. The text is a paragraph from the song "Mirai e", (to the future) by Kiroro.
The current result is quite a satisfactory to me as it perform very fast, the translated Romaji/Kana is quite correct. And more important, the original text is decomposed into small part-of-speech elements which will shows more information when I hover the mouse over theme (Fig. 2). A very useful features is that, the translator will indicate the original base form (dictionary form) of the words. When I click on the words, I will get the meaning by looking up from the Japanese dictionary.

Figure 2. As figure 1 but when the mouse is over.
The last feature is the translated English, this is actually done by Google section translation, the best machine translation out there in my opinion. However, since Japanese language is very complexity, even Google translation is still far from acceptable translation for complex sentences. However, it's quite correct for simple structures and still serve as a reference for the more complex ones.




Thứ Tư, 26 tháng 3, 2014

How to remember the Kanji: Sakura 桜.


Has the Sakura () season started in Japan?

I took this photo Osaka Castle (大坂城 - Ōsaka-jō) in Sakura season last year. Sadly I am not staying in Japan currently, but I can imagine the pink sakura blossoms start lighting up the country, from the south to the north.

So how do you remember the Kanji ? To me, there's a woman (女) on the right who is enjoying the
sakura petals (⺌) falling from above near a sakura tree (木) on the left. It seems to be logical, right? ;)
How about you?

I miss Kyoto, Japan!