original_docstring: Generate the used words if yet uninitialized.
docstring: Generate the used words if yet uninitialized.
docstring_tokens: Generate the used words if yet uninitialized .
code: def ensure_initialized(self) -> None:
          """Generate the used words if yet uninitialized."""
          dictionary = config.val.hints.dictionary
          if not self.words or self.dictionary != dictionary:
              self.words.clear()
              self.dictionary = dictionary
              try:
                  with open(dictionary, encoding="UTF-8") as wordfile:
                      alphabet = set(ascii_lowercase)
                      hints = set()
                      lines = (line.rstrip().lower() for line in wordfile)
                      for word in lines:
                          if set(word) - alphabet:
                              # contains none-alphabetic chars
                              continue
                          if len(word) > 4:
                              # we don't need words longer than 4
                              continue
                          for i in range(len(word)):
                              # remove all prefixes of this word
                              hints.discard(word[:i + 1])
                          hints.add(word)
                      self.words.update(hints)
              except OSError as e:
                  error = "Word hints requires reading the file at {}: {}"
                  raise HintingError(error.format(dictionary, str(e)))
              except UnicodeDecodeError as e:
                  error = "Word hints expects the file at {} to be encoded as UTF-8: {}"
                  raise HintingError(error.format(dictionary, str(e)))
code_tokens: def ensure_initialized ( self ) -> None : dictionary = config . val . hints . dictionary if not self . words or self . dictionary != dictionary : self . words . clear ( ) self . dictionary = dictionary try : with open ( dictionary , encoding = "UTF-8" ) as wordfile : alphabet = set ( ascii_lowercase ) hints = set ( ) lines = ( line . rstrip ( ) . lower ( ) for line in wordfile ) for word in lines : if set ( word ) - alphabet : continue if len ( word ) > 4 : continue for i in range ( len ( word ) ) : hints . discard ( word [ : i + 1 ] ) hints . add ( word ) self . words . update ( hints ) except OSError as e : error = "Word hints requires reading the file at {}: {}" raise HintingError ( error . format ( dictionary , str ( e ) ) ) except UnicodeDecodeError as e : error = "Word hints expects the file at {} to be encoded as UTF-8: {}" raise HintingError ( error . format ( dictionary , str ( e ) ) )
short_docstring: Generate the used words if yet uninitialized.
short_docstring_tokens: Generate the used words if yet uninitialized .
comment: """Generate the used words if yet uninitialized."""$SEP$# contains none-alphabetic chars$SEP$# we don't need words longer than 4$SEP$# remove all prefixes of this word