implement phrase ranker - not fully tested