-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Praneeth Bedapudi <[email protected]>
- Loading branch information
1 parent
a95cf9a
commit db4ac96
Showing
6 changed files
with
9,987 additions
and
25 deletions.
There are no files selected for viewing
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
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,5 +1,23 @@ | ||
example = [ | ||
"This is a test sentence which is a bit longer than the others and also very long than normal and some more words here and some more words here and some more there", | ||
"This is another test sentence", | ||
"This is a third test sentence" | ||
] | ||
# generate random sentence with words of size 1-10 characters and total 5-100 words | ||
|
||
import random | ||
import string | ||
|
||
words = open("words.txt", "r").read().split() | ||
|
||
def generate_random_sentence(): | ||
# Generate random number of words between 5-100 | ||
num_words = random.randint(3, 100) | ||
|
||
sentence = [] | ||
for _ in range(num_words): | ||
word = random.choice(words) | ||
sentence.append(word) | ||
|
||
return ' '.join(sentence) | ||
|
||
|
||
def example_function(): | ||
return [generate_random_sentence() for _ in range(random.randint(1, 10))] | ||
|
||
example = example_function() |
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
Oops, something went wrong.