Skip to content

Commit 3a59150

Browse files
authored
Add files via upload
1 parent af84901 commit 3a59150

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

python-read-docx/read_docx.py

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import docx
2+
3+
#Extract text from DOCX
4+
def getDocxContent(filename):
5+
doc = docx.Document(filename)
6+
fullText = ""
7+
for para in doc.paragraphs:
8+
fullText += para.text
9+
return fullText
10+
11+
resume = getDocxContent("sample.docx")
12+
13+
#Importing NLTK for sentence tokenizing
14+
from nltk.tokenize import sent_tokenize
15+
16+
sentences = sent_tokenize(resume)
17+
for sentence in sentences:
18+
print(sentence)
19+
print("\n")

python-read-docx/readme.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
You can read tutorial https://www.roytuts.com/read-word-file-using-python/

0 commit comments

Comments
 (0)