modifed the old code so that the LM uses lex semiring, the phi parameter has not beed set yet though
some changes to simple lex