Javascript/PHP version for DhinganaParser