예제 #1
0
 def testGetMainWords(self):
     dm = DictionnaryMaker()
     text = "aqui e um teste de texto, quero ver a palavra teste no resultado, vou analysar tudo"
     print dm.getMainWords(text)
예제 #2
0
파일: Main.py 프로젝트: rocel/jogodojornal
	db = dbConnector("test")
	
	
	print '\t- Manchetes...'
	table = db.getTable("manchete")
	if table != None:
		oFile.write("Manchete:\n")
		texts = ""
		nbDocs = 0
		for element in table:
			try:
				nbDocs += 1
				texts += "\n"+ table[element]['texto']
			except:
				print "Error in the Manchete:"
		for word in  dm.getMainWords(texts,nbDocs):
			oFile.write("\t" + word.lower() + "\n")
	else:
		print ' --> No record in the table'
	
	
	print '\t- Noticia...'
	table = db.getTable("noticia")
	if table != None:
		oFile.write("Noticia:\n")
		texts = ""
		nbDocs = 0
		for element in table:
			try:
				nbDocs += 1
				texts += "\n"+ table[element]['texto']