Skip to content
This repository was archived by the owner on Feb 17, 2021. It is now read-only.
This repository was archived by the owner on Feb 17, 2021. It is now read-only.

Refactor generate_phrase() to allow for non-SVO languages #8

@izzy

Description

@izzy

Some languages don't work with the current SVO word ordering used by the generate_phrase function. The function should take another optional argument from wordlist that makes it use a different word ordering.

def generate_phrase(open_status=True):
phrase = choice(WORDLIST[0]) + " "
phrase += choice(WORDLIST[1]) + " "
if open_status:
phrase += choice(WORDLIST[2]) + ". "
else:
phrase += choice(WORDLIST[3]) + ". "
if choice([True, False]):
if open_status:
phrase += choice(WORDLIST[4]).title() + "!"
else:
phrase += choice(WORDLIST[5]).title() + "!"
return phrase

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions