class_docstr: Class for converting an adjective in Russian to the corresponding noun, for example:
  "московский" -> "Москва", "африканский" -> "Африка"
class_docstr_tok: ["Class","for","converting","an","adjective","in","Russian","to","the","corresponding","noun",",","for","example",":","''","\u043c\u043e\u0441\u043a\u043e\u0432\u0441\u043a\u0438\u0439","''","-",">","``","\u041c\u043e\u0441\u043a\u0432\u0430","''",",","``","\u0430\u0444\u0440\u0438\u043a\u0430\u043d\u0441\u043a\u0438\u0439","''","-",">","``","\u0410\u0444\u0440\u0438\u043a\u0430","''"]
code: def make_sparse_matrix(self, words: List[str]):
      indptr = []
      indices = []
      data = []
  
      total_length = 0
  
      for n, word in enumerate(words):
          indptr.append(total_length)
          for cnt, letter in enumerate(word.lower()):
              col = (
                  self.alphabet_length * cnt + self.letter_nums[letter]
              )
              indices.append(col)
              init_value = 1.0 - cnt * 0.05
              if init_value < 0:
                  init_value = 0
              data.append(init_value)
          total_length += len(word)
  
      indptr.append(total_length)
  
      data = np.array(data)
      indptr = np.array(indptr)
      indices = np.array(indices)
  
      matrix = csr_matrix(
          (data, indices, indptr),
          shape=(
              len(words),
              self.max_word_length * self.alphabet_length,
          ),
      )
  
      return matrix
  
file_path: DeepPavlov/deeppavlov/models/kbqa/ru_adj_to_noun.py
imports: import re
  from collections import defaultdict
  from logging import getLogger
  from typing import List
  import numpy
  import spacy
  from scipy.sparse import csr_matrix
  from deeppavlov.core.commands.utils import expand_path
  from deeppavlov.core.common.registry import register
label_desc: Use image node_id 3 for calling the RuAdjToNoun obj's underlying member method code with example usage: obj.make_sparse_matrix(words) and returns: matrix