Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow disabling the usage of open compounds in sentences #2109

Merged
merged 2 commits into from
Oct 10, 2020

Conversation

tjozwik
Copy link
Contributor

@tjozwik tjozwik commented Aug 14, 2020

Connected with: Issue #2102

Alternative solution fixing the same issue: #2108

Description

  • Added param open_compounds_allowed that allows to disable using open compounds ('words' containing additional spaces inside) in Faker::Hipster.sentence and Faker::Books::Lovecraft.sentence. By default the usage of open compounds would be allowed,
  • Fixed wrong random_words_to_add param type in comment regarding Faker::Hipster.sentence method.

Additional info

  • Currently there are no open compounds included in faker.lovecraft.words list but Faker::Books::Lovecraft.words have a possibility of handling them, so it can be used after word list is updated,
  • There is a similar method in Faker::Lorem but both Faker::Lorem.words doesn't have a possibility to treat open compounds differently than normal words, and there is no open compounds on faker.lorem.words list.

@tjozwik tjozwik changed the title Allow disabling using open compounds in sentences Allow disabling the usage of open compounds in sentences Aug 14, 2020
Copy link
Contributor

@sudeeptarlekar sudeeptarlekar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tjozwik can we add test cases around new param that we are passing in sentence method? Apart from that PR looks good to me

@tjozwik
Copy link
Contributor Author

tjozwik commented Sep 3, 2020

@sudeeptarlekar tests cases added.

@sudeeptarlekar
Copy link
Contributor

@tjozwik can you please rebase branch with latest code, this will fix flaky failures.

Copy link
Contributor

@sudeeptarlekar sudeeptarlekar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I will leave further process to @psibi, @Zeragamba.

@Zeragamba Zeragamba merged commit 396e01a into faker-ruby:master Oct 10, 2020
@Zeragamba
Copy link
Contributor

Thanks!

@tjozwik tjozwik deleted the 2102-handle-open-compounds branch October 11, 2020 11:42
droznyk pushed a commit to droznyk/faker that referenced this pull request Oct 23, 2020
…2109)

* Allow disabling using open compounds in sentences

* Create tests for sentences with open compounds
droznyk added a commit to droznyk/faker that referenced this pull request Oct 23, 2020
droznyk added a commit to droznyk/faker that referenced this pull request Oct 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants