original_docstring: Initializes the repository from the proto.
  
      Args:
         ipa_symbols: IpaSymbols proto instance.
  
      Returns:
         Boolean representing whether init was successful.
      
docstring: Initializes the repository from the proto.
docstring_tokens: Initializes the repository from the proto .
code: def _Init(self, ipa_symbols):
      """Initializes the repository from the proto.
  
      Args:
         ipa_symbols: IpaSymbols proto instance.
  
      Returns:
         Boolean representing whether init was successful.
      """
      unofficial_symbols = []
      for symbol in ipa_symbols.symbol:
        # Convert the codepoints to Unicode string.
        usym = _GetUnicodeFromIpaSymbolHexCode(symbol.hex_code)
        usym = segment_normalizer.SegmentNormalizer.NormalizeToNFD(usym)
        if symbol.unofficial:
          unofficial_symbols.append((usym, symbol))
          continue
        # Update the repository.
        if usym in self._ipa_symbols:
          logging.error("Duplicate definition of " + usym + "(" +
                        symbol.hex_code + ")!")
          return False
        self._ipa_symbols.add(usym)
        self._descriptions[usym] = symbol.description
      logging.info("Scanned " + str(len(self._ipa_symbols)) + " symbols.")
      if not ipa_symbols.allow_unofficial_characters:
        return True
  
      # Traverse the list of ``unofficial`` IPA symbols and prepare the mapping.
      for symbol_pair in unofficial_symbols:
        unofficial, symbol = symbol_pair
        if not symbol.maps_to_hex_code:
          logging.error("``Unofficial`` symbol '" + unofficial +
                        "' doesn't map to anything")
          return False
        targets = []
        self._unofficial_ipa_symbols[unofficial] = targets
        for hex_code in symbol.maps_to_hex_code:
          usym = _GetUnicodeFromIpaSymbolHexCode(hex_code)
          if usym not in self._ipa_symbols:
            logging.error("Unknown target codepoints: " + hex_code)
            return False
          targets.append(usym)
        self._ipa_symbols.add(unofficial)
        self._descriptions[unofficial] = symbol.description
      return True
code_tokens: def _Init ( self , ipa_symbols ) : unofficial_symbols = [ ] for symbol in ipa_symbols . symbol : usym = _GetUnicodeFromIpaSymbolHexCode ( symbol . hex_code ) usym = segment_normalizer . SegmentNormalizer . NormalizeToNFD ( usym ) if symbol . unofficial : unofficial_symbols . append ( ( usym , symbol ) ) continue if usym in self . _ipa_symbols : logging . error ( "Duplicate definition of " + usym + "(" + symbol . hex_code + ")!" ) return False self . _ipa_symbols . add ( usym ) self . _descriptions [ usym ] = symbol . description logging . info ( "Scanned " + str ( len ( self . _ipa_symbols ) ) + " symbols." ) if not ipa_symbols . allow_unofficial_characters : return True for symbol_pair in unofficial_symbols : unofficial , symbol = symbol_pair if not symbol . maps_to_hex_code : logging . error ( "``Unofficial`` symbol '" + unofficial + "' doesn't map to anything" ) return False targets = [ ] self . _unofficial_ipa_symbols [ unofficial ] = targets for hex_code in symbol . maps_to_hex_code : usym = _GetUnicodeFromIpaSymbolHexCode ( hex_code ) if usym not in self . _ipa_symbols : logging . error ( "Unknown target codepoints: " + hex_code ) return False targets . append ( usym ) self . _ipa_symbols . add ( unofficial ) self . _descriptions [ unofficial ] = symbol . description return True
short_docstring: Initializes the repository from the proto.
short_docstring_tokens: Initializes the repository from the proto .
comment: """Initializes the repository from the proto.
  
      Args:
         ipa_symbols: IpaSymbols proto instance.
  
      Returns:
         Boolean representing whether init was successful.
      """$SEP$# Convert the codepoints to Unicode string.$SEP$# Update the repository.$SEP$# Traverse the list of ``unofficial`` IPA symbols and prepare the mapping.