Translating phrases into algebraic expressions