def extract_words(sent):
	regx = re.compile(FWORD)
	
	iter = regx.finditer(sent[SENTENCE])
	wlist=[]   # WORD_LIST
	wslist=[]   # WORD_START_LIST
	welist=[]   # WORD_END_LIST
	
	for word in iter:
		### handle special case of word at end of sentence
		echar = word.group()[-1]
		if echar == '?' or echar =='!' or echar == '.':
			wlist.append(word.group()[:-1])
			wslist.append(sent[SENT_START] + word.start())
			welist.append(sent[SENT_START] + word.end()-1)

			wlist.append(echar)
			wslist.append(sent[SENT_START] + word.end())
			welist.append(sent[SENT_START] + word.end())

		else:
			wlist.append(word.group())
			wslist.append(sent[SENT_START] + word.start())
			welist.append(sent[SENT_START] + word.end())
	
	return [wlist, wslist, welist]

### determine whether file can be opened for reading
dataset/ETHPy150Open joliva/nlp-nltk-demo/code/nlputils.py/extract_words/original