              self.exc[pos] = read_exc(path.join(wn_dict_dir, '%s.exc' % pos))
  
      def __call__(self, string, pos):
  
          return lemmatize(string, self.index[pos], self.exc[pos], self.rules[pos])
          if pos == self.noun_id:
              return self.noun(string)
          elif pos == self.verb_id:
              return self.verb(string)
          elif pos == self.adj_id:
              return self.adj(string)
          else:
              raise Exception("Cannot lemmatize with unknown pos: %s" % pos)
  
      def noun(self, string):
          return self(string, 'noun')
 
</s> remove             raise Exception("Cannot lemmatize with unknown pos: %s" % pos)
 </s> add             return string
        lemmas = lemmatize(string, self.index[pos], self.exc[pos], self.rules[pos])
        return min(lemmas) </s> remove     def __call__(self, string, pos):
 </s> add     def __init__(self, index, exceptions, rules):
        self.index = index
        self.exc = exceptions
        self.rules = rules </s> remove             self.index[pos] = read_index(path.join(wn_dict_dir, 'index.%s' % pos))
            self.exc[pos] = read_exc(path.join(wn_dict_dir, '%s.exc' % pos))
 </s> add             index[pos] = read_index(path.join(data_dir, 'index.%s' % pos))
            exc[pos] = read_exc(path.join(data_dir, '%s.exc' % pos))
        rules = json.load(open(path.join(data_dir, 'lemma_rules.json')))
        return cls(index, exc, rules) </s> remove     def __init__(self, wn_dict_dir, noun_id, verb_id, adj_id):
        self.noun_id = noun_id
        self.verb_id = verb_id
        self.adj_id = adj_id
        self.index = {}
        self.exc = {}
 </s> add     @classmethod
    def from_dir(cls, data_dir):
        index = {}
        exc = {} </s> remove     def default_matcher(cls, vocab, data_dir=None):
        if data_dir is None:
            data_dir = cls.default_data_dir()
        return Matcher.from_dir(data_dir, vocab)
 </s> add     def default_matcher(cls, vocab, data_dir):
        if path.exists(data_dir):
            return Matcher.from_dir(data_dir, vocab)
        else:
            return None
    def __call__(self, string, pos):
        if pos == NOUN:
            pos = 'noun'
        elif pos == VERB:
            pos = 'verb'
        elif pos == ADJ:
            pos = 'adj'
              self.exc[pos] = read_exc(path.join(wn_dict_dir, '%s.exc' % pos))
  
      def __call__(self, string, pos):
  
    def __call__(self, string, pos):
        if pos == NOUN:
            pos = 'noun'
        elif pos == VERB:
            pos = 'verb'
        elif pos == ADJ:
            pos = 'adj'
    def __call__(self, string, pos):
        if pos == NOUN:
            pos = 'noun'
        elif pos == VERB:
            pos = 'verb'
        elif pos == ADJ:
            pos = 'adj'
    def __call__(self, string, pos):
        if pos == NOUN:
            pos = 'noun'
        elif pos == VERB:
            pos = 'verb'
        elif pos == ADJ:
            pos = 'adj'
    def __call__(self, string, pos):
        if pos == NOUN:
            pos = 'noun'
        elif pos == VERB:
            pos = 'verb'
        elif pos == ADJ:
            pos = 'adj'
    def __call__(self, string, pos):
        if pos == NOUN:
            pos = 'noun'
        elif pos == VERB:
            pos = 'verb'
        elif pos == ADJ:
            pos = 'adj'
    def __call__(self, string, pos):
        if pos == NOUN:
            pos = 'noun'
        elif pos == VERB:
            pos = 'verb'
        elif pos == ADJ:
            pos = 'adj'
    def __call__(self, string, pos):
        if pos == NOUN:
            pos = 'noun'
        elif pos == VERB:
            pos = 'verb'
        elif pos == ADJ:
            pos = 'adj'
          else:
              raise Exception("Cannot lemmatize with unknown pos: %s" % pos)
  
      def noun(self, string):
          return self(string, 'noun')
keep keep keep keep replace replace replace replace replace replace replace keep keep keep keep keep
 * Tagger training now working. Still need to test load/save of model. Morphology still broken. 
spacy/lemmatizer.py