code: def get_nltk_wordnet(path):
      wnc = __import__("nltk").corpus.WordNetCorpusReader(path, None)
  
      def lemma(word, pos):
          if pos in ["a", "r", "n", "v", "s"]:
              pp = pos
          else:
              if pos[:2] == "JJ":
                  pp = "a"
              elif pos[:2] == "VB":
                  pp = "v"
              elif pos[:2] == "NN":
                  pp = "n"
              elif pos[:2] == "RB":
                  pp = "r"
              else:
                  pp = None
          if pp is None:  # do not need lemmatization
              return word
          lemmas = wnc._morphy(word, pp)
          return min(lemmas, key=len) if len(lemmas) > 0 else word
  
      def all_lemma(pos):
          return wnc.all_lemma_names(pos)
  
      wnc.lemma = lemma
      wnc.all_lemma = all_lemma
      return wnc
  
file_path: textflint/textflint/common/preprocess/nltk_res_load.py
imports: import pickle
  from ..settings import *
  from ..utils.install import download_if_needed
label_desc: Use image node_id 5 for calling the ModelManager obj's underlying member method code with example usage: obj.get_nltk_wordnet(path) and returns: wnc, unknown, wnc, word