class_docstr: Latin Decliner based on Collatinus data and approach to declining words for Latin
  
  .. code-block:: python
  
     # Ensure you have downloaded the corpus latin_models_cltk before running this
     from cltk.stem.lat.declension import CollatinusDecliner
  
     decliner = CollatinusDecliner()
     print(decliner.decline("via"))
  
      [
          ('via', '--s----n-'), ('via', '--s----v-'), ('viam', '--s----a-'), ('viae', '--s----g-'),
          ('viae', '--s----d-'), ('via', '--s----b-'), ('viae', '--p----n-'), ('viae', '--p----v-'),
          ('vias', '--p----a-'), ('viarum', '--p----g-'), ('viis', '--p----d-'), ('viis', '--p----b-')
      ]
class_docstr_tok: ["Latin","Decliner","based","on","Collatinus","data","and","approach","to","declining","words","for","Latin","..","code-block",":",":","python","#","Ensure","you","have","downloaded","the","corpus","latin_models_cltk","before","running","this","from","cltk.stem.lat.declension","import","CollatinusDecliner","decliner","=","CollatinusDecliner","(",")","print","(","decliner.decline","(","``","via","''",")",")","[","(","'via","'",",","'","--","s","--","--","n-","'",")",",","(","'via","'",",","'","--","s","--","--","v-","'",")",",","(","'viam","'",",","'","--","s","--","--","a-","'",")",",","(","'viae","'",",","'","--","s","--","--","g-","'",")",",","(","'viae","'",",","'","--","s","--","--","d-","'",")",",","(","'via","'",",","'","--","s","--","--","b-","'",")",",","(","'viae","'",",","'","--","p","--","--","n-","'",")",",","(","'viae","'",",","'","--","p","--","--","v-","'",")",",","(","'vias","'",",","'","--","p","--","--","a-","'",")",",","(","'viarum","'",",","'","--","p","--","--","g-","'",")",",","(","'viis","'",",","'","--","p","--","--","d-","'",")",",","(","'viis","'",",","'","--","p","--","--","b-","'",")","]"]
docstr: Retrieve the known roots of a lemma
  
  :param lemma: Canonical form of the word (lemma)
  :type lemma: str
  :param model: Model data from the loaded self.__data__. Can be passed by decline()
  :type model: dict
  :return: Dictionary of roots with their root identifier as key
  :rtype: dict
docstr_tok: ["Retrieve","the","known","roots","of","a","lemma",":","param","lemma",":","Canonical","form","of","the","word","(","lemma",")",":","type","lemma",":","str",":","param","model",":","Model","data","from","the","loaded","self.__data__",".","Can","be","passed","by","decline","(",")",":","type","model",":","dict",":","return",":","Dictionary","of","roots","with","their","root","identifier","as","key",":","rtype",":","dict"]
code: def _getRoots(self, lemma, model):
      """Retrieve the known roots of a lemma
  
      :param lemma: Canonical form of the word (lemma)
      :type lemma: str
      :param model: Model data from the loaded self.__data__. Can be passed by decline()
      :type model: dict
      :return: Dictionary of roots with their root identifier as key
      :rtype: dict
      """
  
      if lemma not in self._lemmas:
          raise CLTKException("%s is unknown" % lemma)
  
      ROOT_IDS = {"K": "lemma", "1": "geninf", "2": "perf"}
  
      lemma_entry = self._lemmas[lemma]
      if "quantity" in lemma_entry and lemma_entry["quantity"]:
          lemma_in_lemma_entry = lemma_entry["quantity"]
      else:
          lemma_in_lemma_entry = self._remove_disambiguation(
              lemma_entry["lemma"]
          )
  
      original_roots = {
          root_id: lemma_entry[root_name].split(",")
          for root_id, root_name in ROOT_IDS.items()
          if root_id != "K" and lemma_entry[root_name]
      }
      returned_roots = {}
  
      if not model:
          model = self._models[lemma_entry["model"]]
  
      # For each registered root in the model,
      for model_root_id, model_root_data in model["R"].items():
          # If we have K, it's equivalent to canonical form
          if model_root_data[0] == "K":
              returned_roots[
                  model_root_id
              ] = lemma_in_lemma_entry.split(",")
          # Otherwise we have deletion number and addition char
          else:
              deletion, addition = (
                  int(model_root_data[0]),
                  model_root_data[1] or "",
              )
  
              # If a the root is declared already,
              # we retrieve the information
              if (
                  model_root_id != "1"
                  and model_root_id in returned_roots
              ):
                  lemma_roots = returned_roots[model_root_id]
              else:
                  lemma_roots = lemma_in_lemma_entry.split(",")
              # We construct the roots
              returned_roots[model_root_id] = [
                  lemma_root[:-deletion] + addition
                  for lemma_root in lemma_roots
              ]
  
          if model_root_id in original_roots:
              returned_roots[model_root_id].extend(
                  original_roots[model_root_id]
              )
          returned_roots[model_root_id] = list(
              set(returned_roots[model_root_id])
          )
      original_roots.update(returned_roots)
  
      return original_roots
  
file_path: cltk/src/cltk/morphology/lat.py
imports: import json
  import os
  import re
  from typing import Dict, List, Tuple
  from cltk.core.exceptions import CLTKException
  from cltk.utils import CLTK_DATA_DIR
label_desc: Use image node_id 4 for calling the CollatinusDecliner obj's underlying member method code with example usage: obj._getRoots(lemma, model) and returns: original_roots