def freeze(self,
             type_name,
             unknown_marker = '<UNK>'):
    """Freeze the SymbolTable for a specific type.

    Args:
      type_name: string name of a type.
      unknown_marker: string  Unknown words or words added after a freeze are
        mapped to the unknown marker. If None, do not use an unknown value.
    """
    previous_size = self._symtab[type_name].get_max_id()
    self._symtab[type_name].freeze(unknown_marker)
    # Check if the size of this symbol table has increased
    if self._symtab[type_name].get_max_id() != previous_size:
      for rel_name in self.get_relation_names():
        if (type_name == self.get_domain(rel_name) or
            type_name == self.get_range(rel_name)):
          # Resize relation matrices involving this type to match its new size
          new_size = (self.get_max_id(self.get_domain(rel_name)),
                      self.get_max_id(self.get_range(rel_name)))
          if (not scipy.sparse.issparse(self._np_initval[rel_name]) and
              not self._np_initval[rel_name].flags['OWNDATA']):
            # Copy the matrix if it doesn't own its own data
            self._np_initval[rel_name] = self._np_initval[rel_name].copy()
          self._np_initval[rel_name].resize(new_size)
          # Remove cached tensor if it exists
          if rel_name in self._cached_tensor:
            del self._cached_tensor[rel_name]
Freeze the SymbolTable for a specific type.

    Args:
      type_name: string name of a type.
      unknown_marker: string  Unknown words or words added after a freeze are
        mapped to the unknown marker. If None, do not use an unknown value.
    
language/nql/nql/__init__.py