Typescript Check If String Is Part Of Speech