Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions SentenceLength.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def main():
userFile = input("Enter the file path to the .txt file you wish to analyze.\n")
userDelimeters = input("Enter the characters (punctuation) that you want to be sentence delimiters separated by spaces.\n")
minLength = input("Enter the minimum length of a word (must be a positive integer).\n")


# Asks for a desired min average WPS
desiredLength = int(input("Is there a desired average WPS.\n"))
Expand All @@ -59,7 +60,7 @@ def main():
minLenPro = minLenPro + ""
else:
#
# minLenPro = minLenPro + minLength[i]
minLenPro = minLenPro + minLength[i]

# print(minLenPro)

Expand All @@ -70,12 +71,18 @@ def main():
# elif (int(findAverageSentence(userFile, userDelimeters, minLength)) >= desiredLength):
# print("The AWPS meets your desired amount")
#
minLenPro = minLenPro + minLength[i]
if minLenPro == "":
minLenPro = 3
mlp = int(minLenPro)

print("The average sentence length is", findAverageSentence(userFile, userDelimeters, mlp))
# minLenPro = minLenPro + minLength[i]
#if minLenPro == "":
# minLenPro = 3
# mlp = int(minLenPro)
#

#Dylan
if (findAverageSentence(userFile, userDelimeters, minLength) != desiredLength):
print("The average sentence length is", findAverageSentence(userFile, userDelimeters, minLength))
else:
print("You have the desired words per sentence of ", desiredLength)
#End Dylan


if __name__ == "__main__":
Expand Down