Text this: Quasi-birth-and-death processes with restricted transitions and its applications