Text this: The design of an intelligent machine for upper-limb physical therapy