Check if a word is part of a given type 1 grammar.