typing, word completion, and generate next word