class_docstr: Implementation of a lemmatizer based on a
  dictionary of lemmas and forms, backing off to regex rules.
  Since a given form may map to multiple lemmas,
  a corpus-based frequency disambiguator is employed.
  
  Subclasses must provide methods to load dictionary and corpora,
  and to specify regular expressions.
class_docstr_tok: ["Implementation","of","a","lemmatizer","based","on","a","dictionary","of","lemmas","and","forms",",","backing","off","to","regex","rules",".","Since","a","given","form","may","map","to","multiple","lemmas",",","a","corpus-based","frequency","disambiguator","is","employed",".","Subclasses","must","provide","methods","to","load","dictionary","and","corpora",",","and","to","specify","regular","expressions","."]
docstr: Lemmatize a single token.  If best_guess is true, then take the most
  frequent lemma when a form has multiple possible lemmatizations.
  If the form is not found, just return it.
  If best_guess is false, then
  always return the full set of possible lemmas, or the empty list if none found.
  If return_frequencies is true ,then also return the relative frequency of the lemma in a corpus.
  
  >>> from cltk.lemmatize.ang import OldEnglishDictionaryLemmatizer
  >>> lemmatizer = OldEnglishDictionaryLemmatizer()
  >>> lemmatizer.lemmatize_token('fōrestepeþ')
  'foresteppan'
  >>> lemmatizer.lemmatize_token('Caesar', return_frequencies=True, best_guess=True)
  ('Caesar', 0)
docstr_tok: ["Lemmatize","a","single","token",".","If","best_guess","is","true",",","then","take","the","most","frequent","lemma","when","a","form","has","multiple","possible","lemmatizations",".","If","the","form","is","not","found",",","just","return","it",".","If","best_guess","is","false",",","then","always","return","the","full","set","of","possible","lemmas",",","or","the","empty","list","if","none","found",".","If","return_frequencies","is","true",",","then","also","return","the","relative","frequency","of","the","lemma","in","a","corpus",".",">",">",">","from","cltk.lemmatize.ang","import","OldEnglishDictionaryLemmatizer",">",">",">","lemmatizer","=","OldEnglishDictionaryLemmatizer","(",")",">",">",">","lemmatizer.lemmatize_token","(","'f\u014drestepe\u00fe","'",")","'foresteppan'",">",">",">","lemmatizer.lemmatize_token","(","'Caesar","'",",","return_frequencies=True",",","best_guess=True",")","(","'Caesar","'",",","0",")"]
code: def lemmatize_token(
      self,
      token: str,
      best_guess: bool = True,
      return_frequencies: bool = False,
  ) -> Union[str, List[Union[str, Tuple[str, float]]]]:
      """Lemmatize a single token.  If best_guess is true, then take the most
      frequent lemma when a form has multiple possible lemmatizations.
      If the form is not found, just return it.
      If best_guess is false, then
      always return the full set of possible lemmas, or the empty list if none found.
      If return_frequencies is true ,then also return the relative frequency of the lemma in a corpus.
  
      >>> from cltk.lemmatize.ang import OldEnglishDictionaryLemmatizer
      >>> lemmatizer = OldEnglishDictionaryLemmatizer()
      >>> lemmatizer.lemmatize_token('fōrestepeþ')
      'foresteppan'
      >>> lemmatizer.lemmatize_token('Caesar', return_frequencies=True, best_guess=True)
      ('Caesar', 0)
      """
  
      lemmas = self.inverted_index.get(token.lower(), None)
      if not lemmas:
          mod_token = self._apply_regex(token.lower())
          lemmas = self.inverted_index.get(mod_token, None)
  
      if best_guess:
          if not lemmas:
              lemma = token
          elif len(lemmas) > 1:
              counts = [
                  self.unigram_counts.get(word, 0) for word in lemmas
              ]
              lemma = lemmas[argmax(counts)]
          else:
              lemma = lemmas[0]
  
          if return_frequencies:
              lemma = (lemma, self._relative_frequency(lemma))
      else:
          lemma = [] if not lemmas else lemmas
          if return_frequencies:
              lemma = [
                  (word, self._relative_frequency(word))
                  for word in lemma
              ]
  
      return lemma
  
file_path: cltk/src/cltk/lemmatize/naive_lemmatizer.py
imports: import math
  import os
  import re
  from abc import ABC, abstractmethod
  from typing import List, Tuple, Union
  from numpy import argmax
  from cltk.utils import CLTK_DATA_DIR
label_desc: Use image node_id 7 for calling the DictionaryRegexLemmatizer obj's underlying member method code with example usage: obj.lemmatize_token(token, best_guess, return_frequencies) and returns: lemma