#NEWLINE# def _build_tier_block( self , element ) : #NEWLINE# #INDENT# " Function to build a tier block for processing. Also does cleaning\n            of the data.\n\n        Parameters\n        ----------\n        :param element: xml.etree.ElementTree.Element\n            An 'example' element that contains the IGT data.\n\n        Return\n        ------\n        :return: boolean\n            True if the element given contains a valid tier block.\n        " #NEWLINE# lines = element . findall ( 'line' ) #NEWLINE# for ( line_number , line ) in enumerate ( lines ) : #NEWLINE# #INDENT# if ( line_number == 0 ) : #NEWLINE# #INDENT# text = line . text #NEWLINE# if ( text . find ( '/' ) != ( - 1 ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# text = self . _sanitize_line ( text , False ) #NEWLINE# self . _tier_block [ 'phrase' ] = text #NEWLINE# self . _tier_block [ 'word' ] = text #NEWLINE# self . _tier_block [ 'morpheme' ] = text #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( line_number == 1 ) : #NEWLINE# #INDENT# text = self . _sanitize_line ( line . text , False ) #NEWLINE# self . _tier_block [ 'gloss' ] = text #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( line_number == 2 ) : #NEWLINE# #INDENT# text = self . _clean_translation_line ( line . text ) #NEWLINE# self . _tier_block [ 'translation' ] = line #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return True