parameters: (self, input_row)
docstring: elif num_parts < 7:
              print "{} seems to have to few parts".format(parts[0].encode('utf-8'))
          elif num_parts > 7:
              print "{} seems to have to many parts".format(parts[0].encode('utf-8'))
          elif not all_full:
              print "{} seems to have a component missing".format(parts[0].encode('utf-8'))
docstring_summary: elif num_parts < 7:
              print "{} seems to have to few parts".format(parts[0].encode('utf-8'))
          elif num_parts > 7:
              print "{} seems to have to many parts".format(parts[0].encode('utf-8'))
          elif not all_full:
              print "{} seems to have a component missing".format(parts[0].encode('utf-8'))
docstring_tokens: elif num_parts < 7 : print {} seems to have to few parts . format ( parts [ 0 ] . encode ( utf - 8 )) elif num_parts > 7 : print {} seems to have to many parts . format ( parts [ 0 ] . encode ( utf - 8 )) elif not all_full : print {} seems to have a component missing . format ( parts [ 0 ] . encode ( utf - 8 ))
function: def _make_dictionary_entry(self, input_row):
          _current_entry = {}
          he_regex = re.compile(r"[\u0591-\u05ff]+", re.UNICODE)
          parts = str(input_row.strip('\n$').strip(), 'utf-8').split('@')
          num_parts = len(parts)
          all_full = all(len(x) > 0 for x in parts[:-1])
          #print parts[0]
          num = int(re.search(r'\d+', parts[0].strip()).group())
          if num in self.control:
              self.control.remove(num)
          if num_parts == 7:
              _current_entry['parent_lexicon'] = 'Rashi Foreign Lexicon'
              _current_entry['catane_number'] = parts[0].strip()
              _current_entry['orig_ref'] = Ref(parts[1]).normal()
              _current_entry['orig_word'] = parts[2].strip()
              _current_entry['headword'] = parts[3].strip()
              if he_regex.search(parts[4]):
                  if he_regex.search(parts[5]): #if the latin transliteation is not here... it's probably in the right place, but contains a bit of hebrew
                      pass
                      #print "{} seems to have eng in wrong place: {}".format(parts[0].encode('utf-8'), parts[5].encode('utf-8'))
                  else:
                      swap = parts[4]
                      parts[4] = parts[5]
                      parts[5] = swap
              _current_entry['transliteration'] = parts[4].strip()
              _current_entry['content'] = {
                  'definition' : parts[5].strip(),
                  'notes' : parts[6].strip()
              }
              rde = RashiDictionaryEntry(_current_entry)
              rde.save()
              return rde
          """elif num_parts < 7:
              print "{} seems to have to few parts".format(parts[0].encode('utf-8'))
          elif num_parts > 7:
              print "{} seems to have to many parts".format(parts[0].encode('utf-8'))
          elif not all_full:
              print "{} seems to have a component missing".format(parts[0].encode('utf-8'))"""
function_tokens: def _make_dictionary_entry ( self , input_row ) : _current_entry = { } he_regex = re . compile ( r"[\u0591-\u05ff]+" , re . UNICODE ) parts = str ( input_row . strip ( '\n$' ) . strip ( ) , 'utf-8' ) . split ( '@' ) num_parts = len ( parts ) all_full = all ( len ( x ) > 0 for x in parts [ : - 1 ] ) #print parts[0] num = int ( re . search ( r'\d+' , parts [ 0 ] . strip ( ) ) . group ( ) ) if num in self . control : self . control . remove ( num ) if num_parts == 7 : _current_entry [ 'parent_lexicon' ] = 'Rashi Foreign Lexicon' _current_entry [ 'catane_number' ] = parts [ 0 ] . strip ( ) _current_entry [ 'orig_ref' ] = Ref ( parts [ 1 ] ) . normal ( ) _current_entry [ 'orig_word' ] = parts [ 2 ] . strip ( ) _current_entry [ 'headword' ] = parts [ 3 ] . strip ( ) if he_regex . search ( parts [ 4 ] ) : if he_regex . search ( parts [ 5 ] ) : #if the latin transliteation is not here... it's probably in the right place, but contains a bit of hebrew pass #print "{} seems to have eng in wrong place: {}".format(parts[0].encode('utf-8'), parts[5].encode('utf-8')) else : swap = parts [ 4 ] parts [ 4 ] = parts [ 5 ] parts [ 5 ] = swap _current_entry [ 'transliteration' ] = parts [ 4 ] . strip ( ) _current_entry [ 'content' ] = { 'definition' : parts [ 5 ] . strip ( ) , 'notes' : parts [ 6 ] . strip ( ) } rde = RashiDictionaryEntry ( _current_entry ) rde . save ( ) return rde