def getdocumenttext(document):
 paratextlist = []
 paralist = []
 for element in document.iter():
  if (element.tag == (('{' + nsprefixes['w']) + '}p')):
   paralist.append(element)
 for para in paralist:
  paratext = u''
  for element in para.iter():
   if (element.tag == (('{' + nsprefixes['w']) + '}t')):
    if element.text:
     paratext = (paratext + element.text)
   elif (element.tag == (('{' + nsprefixes['w']) + '}tab')):
    paratext = (paratext + ' DCTB ')
  if (not (len(paratext) == 0)):
   paratextlist.append(paratext)
 return paratextlist

def getdocumenttext ( document ) : paratextlist = [ ] paralist = [ ] for element in document . iter ( ) : if ( element . tag == ( ( '{' + nsprefixes [ 'w' ] ) + '}p' ) ) : paralist . append ( element ) for para in paralist : paratext = u'' for element in para . iter ( ) : if ( element . tag == ( ( '{' + nsprefixes [ 'w' ] ) + '}t' ) ) : if element . text : paratext = ( paratext + element . text ) elif ( element . tag == ( ( '{' + nsprefixes [ 'w' ] ) + '}tab' ) ) : paratext = ( paratext + ' DCTB ' ) if ( not ( len ( paratext ) == 0 ) ) : paratextlist . append ( paratext ) return paratextlist
return the raw text of a document .