This was my first week back to work after Christmas leave, and what a mad busy week it was. When it was finally over on Friday I had a few drinks and randomly decided to look at my 'App ideas list'. One little entry said 'Counts unique characters in a Chinese text', something that I would find very useful for my Chinese studies.
I immediately thought, this wouldn't be too hard to knock up. So I just started coding, by then end of the night it was functional. The next day it was done and on it's way to Apple for evaluation.
One thing I didn't expect was parsing a large string would use a gargantuan amout of memory and on an actual iOS device, not the simulator, it would just crash. After wallowing in a pit of dispair I figured out how to make it work by using disk space to store the text rather than memory.
There are two modes for parsing, you can simply find out how many unique characters there are, or you can also see how many occurances of each character there is. If you have a large body of text the second option will take some time, you would probably be better off using a desktop computer solution. The reason for this is because the app sorts the results so they are displayed with the most frequently occuring characters at the top of the display. The algorithm for that gets pretty slow when there are lots of different characters to sort through. (update: it's nothing to do with the algorithm after all, updating the rows in the UITableView that displays all the unique characters is what is causing the slow down)
This is my first universal app, that is it has a unique display for iPad and iPhone, and I'm pretty pleased with how it turned out. I was going to call it 'Kanji Counter' just because it sounds better when said in English, but I don't want to confuse people, it is for Chinese so I stuck with 'Hanzi Counter'.
Hanzi Counter will parse all letters and ideographs, but take the English alphabet for example, it will only find a maximum of 52 characters, that is all uppercase and lowercase letters. If that sort of thing floats your boat then cool, you can use it for that.
After I sent it to Apple, I thought it might be a good idea to be able to export your results via E-Mail, so I added that, it sends an attachment containing your data in a CSV file which is readable by most spreadsheet programs. This feature won't be available until the first version is in the App Store and I can send an update.
I don't think the spreadsheet compatability is going to be too useful for me, but one feature I would like is an exclusion list. The great thing about this is you could put all the characters you know on this list and when you parse your text you would only be presented with characters you don't know. You could instantly assess how difficult the text will be for you to read, or allow you to select the most frequently occuring characters for your flashcard sets. I'm almost talking myself into writing it in now!
When it's in the App Store I'll let you know!
Recent Comments