forked from sarthakd999/Hacktoberfest2021-2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved the organisation of files, added all python code in python f…
…older.
- Loading branch information
1 parent
364049d
commit 1c562fd
Showing
32 changed files
with
404 additions
and
404 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
# To read PDF file using Python pip install pypdf2 To Read text (Text to speech) pip install pyaudio pip install pyttsx3 | ||
|
||
import pyttsx3 | ||
import PyPDF2 | ||
|
||
book = open("C:/Users/bhask\Desktop/tweet_summarization/DE1.pdf","rb") | ||
pdfReader = PyPDF2.PdfFileReader(book) | ||
pages = pdfReader.numPages | ||
print("total number of pages is:" ,pages) | ||
|
||
speaker = pyttsx3.init() | ||
""" RATE""" | ||
rate = speaker.getProperty('rate') # getting details of current speaking rate | ||
print ("current voice rate is: ",rate) #printing current voice rate | ||
speaker.setProperty('rate',170) # setting up new voice rate | ||
speaker.runAndWait() | ||
|
||
"""VOLUME""" | ||
volume = speaker.getProperty('volume') #getting to know current volume level (min=0 and max=1) | ||
print ("volume level is at : ",volume) #printing current volume level | ||
speaker.setProperty('volume',1.0) # setting up volume level between 0 and 1 | ||
|
||
"""VOICE""" | ||
voices = speaker.getProperty('voices') #getting details of current voice | ||
#speaker.setProperty('voice', voices[0].id) #changing index, changes voices. o for male | ||
speaker.setProperty('voice', voices[1].id) #changing index, changes voices. 1 for female | ||
speaker.say("HII BHASKAR!, NICE to see you here............") | ||
print("the reading of book is started!............") | ||
speaker.say("the reading of book is started!!!!!!!!") | ||
for num in range(1,pages): | ||
page = pdfReader.getPage(num) | ||
text = page.extractText() | ||
speaker.say(text) | ||
# To read PDF file using Python pip install pypdf2 To Read text (Text to speech) pip install pyaudio pip install pyttsx3 | ||
|
||
import pyttsx3 | ||
import PyPDF2 | ||
|
||
book = open("C:/Users/bhask\Desktop/tweet_summarization/DE1.pdf","rb") | ||
pdfReader = PyPDF2.PdfFileReader(book) | ||
pages = pdfReader.numPages | ||
print("total number of pages is:" ,pages) | ||
|
||
speaker = pyttsx3.init() | ||
""" RATE""" | ||
rate = speaker.getProperty('rate') # getting details of current speaking rate | ||
print ("current voice rate is: ",rate) #printing current voice rate | ||
speaker.setProperty('rate',170) # setting up new voice rate | ||
speaker.runAndWait() | ||
|
||
"""VOLUME""" | ||
volume = speaker.getProperty('volume') #getting to know current volume level (min=0 and max=1) | ||
print ("volume level is at : ",volume) #printing current volume level | ||
speaker.setProperty('volume',1.0) # setting up volume level between 0 and 1 | ||
|
||
"""VOICE""" | ||
voices = speaker.getProperty('voices') #getting details of current voice | ||
#speaker.setProperty('voice', voices[0].id) #changing index, changes voices. o for male | ||
speaker.setProperty('voice', voices[1].id) #changing index, changes voices. 1 for female | ||
speaker.say("HII BHASKAR!, NICE to see you here............") | ||
print("the reading of book is started!............") | ||
speaker.say("the reading of book is started!!!!!!!!") | ||
for num in range(1,pages): | ||
page = pdfReader.getPage(num) | ||
text = page.extractText() | ||
speaker.say(text) | ||
speaker.runAndWait() |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,49 @@ | ||
global N | ||
N = 4 | ||
|
||
def printSolution(board): | ||
for i in range(N): | ||
for j in range(N): | ||
print (board[i][j], end = " ") | ||
print() | ||
|
||
def isSafe(board, row, col): | ||
for i in range(col): | ||
if board[row][i] == 1: | ||
return False | ||
for i, j in zip(range(row, -1, -1), | ||
range(col, -1, -1)): | ||
if board[i][j] == 1: | ||
return False | ||
for i, j in zip(range(row, N, 1), | ||
range(col, -1, -1)): | ||
if board[i][j] == 1: | ||
return False | ||
|
||
return True | ||
|
||
def solveutil(board, col): | ||
if col >= N: | ||
return True | ||
for i in range(N): | ||
|
||
if isSafe(board, i, col): | ||
board[i][col] = 1 | ||
if solveutil(board, col + 1) == True: | ||
return True | ||
board[i][col] = 0 | ||
return False | ||
|
||
def solveNQ(): | ||
board = [ [0, 0, 0, 0], | ||
[0, 0, 0, 0], | ||
[0, 0, 0, 0], | ||
[0, 0, 0, 0] ] | ||
|
||
if solveutil(board, 0) == False: | ||
print ("Solution does not exist") | ||
return False | ||
|
||
printSolution(board) | ||
return True | ||
global N | ||
N = 4 | ||
|
||
def printSolution(board): | ||
for i in range(N): | ||
for j in range(N): | ||
print (board[i][j], end = " ") | ||
print() | ||
|
||
def isSafe(board, row, col): | ||
for i in range(col): | ||
if board[row][i] == 1: | ||
return False | ||
for i, j in zip(range(row, -1, -1), | ||
range(col, -1, -1)): | ||
if board[i][j] == 1: | ||
return False | ||
for i, j in zip(range(row, N, 1), | ||
range(col, -1, -1)): | ||
if board[i][j] == 1: | ||
return False | ||
|
||
return True | ||
|
||
def solveutil(board, col): | ||
if col >= N: | ||
return True | ||
for i in range(N): | ||
|
||
if isSafe(board, i, col): | ||
board[i][col] = 1 | ||
if solveutil(board, col + 1) == True: | ||
return True | ||
board[i][col] = 0 | ||
return False | ||
|
||
def solveNQ(): | ||
board = [ [0, 0, 0, 0], | ||
[0, 0, 0, 0], | ||
[0, 0, 0, 0], | ||
[0, 0, 0, 0] ] | ||
|
||
if solveutil(board, 0) == False: | ||
print ("Solution does not exist") | ||
return False | ||
|
||
printSolution(board) | ||
return True | ||
solveNQ() |
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.