-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Update docs for Lorem #1354
Merged
Merged
Update docs for Lorem #1354
Conversation
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
Documented observed behavior Link to code: https://github.com/stympy/faker/blob/master/lib/faker/lorem.rb ``` irb(main):023:0> 1000.times.inject([]) {|a| a << Faker::Lorem.sentence(3); a}.keep_if{|s| s.split(" ").count > 3 }.size => 0 irb(main):024:0> 1000.times.inject([]) {|a| a << Faker::Lorem.sentence(3, true); a}.keep_if{|s| s.split(" ").count > 3 }.size => 0 irb(main):025:0> 1000.times.inject([]) {|a| a << Faker::Lorem.sentence(3, false); a}.keep_if{|s| s.split(" ").count > 3 }.size => 0 irb(main):026:0> 1000.times.inject([]) {|a| a << Faker::Lorem.sentence(3, true, 4); a}.keep_if{|s| s.split(" ").count > 3 }.size => 773 irb(main):027:0> 1000.times.inject([]) {|a| a << Faker::Lorem.sentence(3, false, 4); a}.keep_if{|s| s.split(" ").count > 3 }.size => 746 irb(main):028:0> 1000.times.inject([]) {|a| a << Faker::Lorem.sentence; a}.keep_if{|s| s.split(" ").count > 3 }.size => 1000 irb(main):029:0> 1000.times.inject([]) {|a| a << Faker::Lorem.sentence; a}.keep_if{|s| s.split(" ").count > 4 }.size => 0 irb(main):030:0> 1000.times.inject([]) {|a| a << Faker::Lorem.sentence; a}.keep_if{|s| s.split(" ").count < 4 }.size => 0 ```
vbrazo
approved these changes
Sep 3, 2018
# The 'random_words_to_add' argument increases the sentence's word count by a random value within (0..random_words_to_add). | ||
# To specify an exact word count for a sentence, set word_count to the number you want and random_words_to_add equal to 0. | ||
# By default, sentences will have a random number of words within the range (4..10). | ||
Faker::Lorem.sentence #=> "Dolore illum animi et neque accusantium." | ||
Faker::Lorem.sentence(3) #=> "Commodi qui minus deserunt sed vero quia." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😆
Faker::Lorem.sentence #=> "Dolore illum animi et neque accusantium." | ||
Faker::Lorem.sentence(3) #=> "Commodi qui minus deserunt sed vero quia." | ||
Faker::Lorem.sentence(3, true) #=> "Inflammatio denego necessitatibus caelestis autus illum." | ||
# By default, sentences will not have any random words added (and will all be exactly 4 words long) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Thanks for fixing these issues. |
Oh no, thank you and others for maintaining the gem. Happy to help however I can. |
davidmorton0
pushed a commit
to davidmorton0/faker
that referenced
this pull request
Jul 12, 2021
Documented observed behavior Link to code: https://github.com/stympy/faker/blob/master/lib/faker/lorem.rb ``` irb(main):023:0> 1000.times.inject([]) {|a| a << Faker::Lorem.sentence(3); a}.keep_if{|s| s.split(" ").count > 3 }.size => 0 irb(main):024:0> 1000.times.inject([]) {|a| a << Faker::Lorem.sentence(3, true); a}.keep_if{|s| s.split(" ").count > 3 }.size => 0 irb(main):025:0> 1000.times.inject([]) {|a| a << Faker::Lorem.sentence(3, false); a}.keep_if{|s| s.split(" ").count > 3 }.size => 0 irb(main):026:0> 1000.times.inject([]) {|a| a << Faker::Lorem.sentence(3, true, 4); a}.keep_if{|s| s.split(" ").count > 3 }.size => 773 irb(main):027:0> 1000.times.inject([]) {|a| a << Faker::Lorem.sentence(3, false, 4); a}.keep_if{|s| s.split(" ").count > 3 }.size => 746 irb(main):028:0> 1000.times.inject([]) {|a| a << Faker::Lorem.sentence; a}.keep_if{|s| s.split(" ").count > 3 }.size => 1000 irb(main):029:0> 1000.times.inject([]) {|a| a << Faker::Lorem.sentence; a}.keep_if{|s| s.split(" ").count > 4 }.size => 0 irb(main):030:0> 1000.times.inject([]) {|a| a << Faker::Lorem.sentence; a}.keep_if{|s| s.split(" ").count < 4 }.size => 0 ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Documented observed behavior
Link to code: https://github.com/stympy/faker/blob/master/lib/faker/lorem.rb