Text2Number Function
I’ve been working on a PHP function that will parse pronounceable representatiion of number into numeric value. It can be useful for validating sensitive user entries such as payment amount, etc, by entering not only the number, but the pronounceable numbers. For example a text if "sepuluh ribu" can be parsed into 10000.
Give it a try, or download the source.
NOTE
Only works with Indonesian language
UPDATE Friday, March 16 2007
Fixing bug while parsing text like "dua puluh tiga ribu"
UPDATE Tuesday, March 20 2007
Fix some sloppy coding :p
UPDATE Wed, March 21 07
Influenced with Lingua::ID::Words2Num package by Om steven.
UPDATE Wed, March 22 07
Om steven emailed me and send a pretty test-suite for text2number function. I’ve put it on the demo page, nice. Thanks om steven …
Useful function mas, this really great ;)
I don’t understand coding. I am sorry for not downloading it, Bro. :)
kok gak masuk di ‘playing ground’ fer?
#IndoDX:
thx bro
#Kombor:
hehehe, no probs bang, thx for commenting
#GuM:
playing ground, maksud nya?
iseng berkunjung. kayaknya masih ada bugnya ya? beberapa teks saya coba hasilnya masih belon bener, mis: “seratus lima puluh juta dua ratus ribu lima puluh dua”, “seratus lima puluh juta”, “seratus lima juta”.
btw, duluuuuu banget, pernah bikin beginian tapi versi perlnya. bisa diliat di CPAN, modul Lingua::ID::Words2Nums (dan Nums2Words). mungkin bisa dicontek heuheuheu…
simplechatnya baru saya instal di indoforums.com/id-php/chat/ , buat conference nanti. kuul!!
Playing Ground, fer. bareng sama SoccerStat, Aggregator dan SimpleChat
#GuM
menunggu PB keluar :p
sejuta sebelas ribu
thanks pak steve, akhirnya dg referensi perl modul anda, udah bisa jalan lagi, kayanya bukan referensi deh, duplikat . hehehe