def lexical_rules(self, verbs_intrans, verbs_trans, adverbs, nouns,
                    color_adjectives, size_adjectives, location_preps):
    """Instantiate the lexical rules using new LexicalRule class."""
    assert size_adjectives or color_adjectives, (
        "Please specify words for at least one of size_adjectives or "
        "color_adjectives.")
    all_rules = []
    for verb in verbs_intrans:
      vv_intrans_rule = LexicalRule(
          lhs=VV_intransitive,
          word=verb,
          sem_type=world.EVENT,
          specs=Weights(action=verb, is_transitive=False))
      all_rules.append(vv_intrans_rule)
    if self.type_grammar != "simple":
      for verb in verbs_trans:
        vv_trans_rule = LexicalRule(
            lhs=VV_transitive,
            word=verb,
            sem_type=world.EVENT,
            specs=Weights(action=verb, is_transitive=True))
        all_rules.append(vv_trans_rule)
    if self.type_grammar.endswith("adverb") or self.type_grammar == "full":
      for word in adverbs:
        rb_rule = LexicalRule(
            lhs=RB, word=word, sem_type=world.EVENT, specs=Weights(manner=word))
        all_rules.append(rb_rule)
    for word in nouns:
      nn_rule = LexicalRule(
          lhs=NN, word=word, sem_type=world.ENTITY, specs=Weights(noun=word))
      all_rules.append(nn_rule)
    if color_adjectives:
      for word in color_adjectives:
        jj_rule = LexicalRule(
            lhs=JJ,
            word=word,
            sem_type=world.ENTITY,
            specs=Weights(adjective_type=world.COLOR))
        all_rules.append(jj_rule)
    if size_adjectives:
      for word in size_adjectives:
        jj_rule = LexicalRule(
            lhs=JJ,
            word=word,
            sem_type=world.ENTITY,
            specs=Weights(adjective_type=world.SIZE))
        all_rules.append(jj_rule)
    if self.type_grammar.startswith("relation"):
      for word in location_preps:
        loc_rule = LexicalRule(
            lhs=LOC, word=word, sem_type=LOCATION, specs=Weights(location=word))
        all_rules.append(loc_rule)
    return all_rules
Instantiate the lexical rules using new LexicalRule class.
language/gscan/data/grammar.py