Look at ways to put languages into buckets for scoring bonuses or penalties.
Three main mathematical approaches are scaling against lowest score, scaling against max possible score, and a per-bucket multiplier.
Main approaches to bucketing are giving boosts to the host language (a priori the most likely), and giving penalties to poorly-performing languages (e.g., infrequent languages that are often confused with the host language).
Also implement for Perl and PHP versions of TextCat.