Esempio n. 1
0
 def normalized_house(self):
     house = get_normalized_text(self.house_number, delimiter='')
     if self.house_letter:
         letter = get_normalized_text(self.house_letter).upper()
         house += letter
     if self.house_corpus:
         corpus = 'к' + get_normalized_text(self.house_corpus)
         house += corpus
     if self.house_building:
         build = 'с' + get_normalized_text(self.house_building)
         house += build
     return house
Esempio n. 2
0
 def test_person_name_with_position_normalization(self):
     results = self.combinator.extract(
         'исполнителя главной роли сергея шувалова')
     for grammar, tokens in results:
         if grammar == natasha.Person.WithPosition:
             normalized = get_normalized_text(tokens)
             self.assertEqual(
                 normalized, 'исполнитель главной роли сергей шувалов')
Esempio n. 3
0
 def normalized_descriptor(self):
     if self.descriptor:
         return get_normalized_text(self.descriptor, ).lower()
     else:
         return None
Esempio n. 4
0
 def normalized_name(self):
     if self.name:
         return get_normalized_text(self.name).lower()
     else:
         return None
Esempio n. 5
0
 def normalized_street(self):
     return get_normalized_text(self.street_name)