JL Forums

How can I spin sentences in paragraphs without getting duplicates

0 Members and 1 Guest are viewing this topic.

I've seen this posted before but the answer was not what the OP intended even if he didn't reply back.

I have 3 paragraphs as follows:

P1Sentence1, P1Sentence2
P2Sentence1, P3Sentence1, P2Sentence3
P3Sentence1, P3Sentence2, P3Sentence3, P3Sentence4

and would like to generate 3 random paragraphs like this:

P3Sentence1, P1Sentence1
P3Sentence2, P1Sentence2, P2Sentence3
P2Sentence1, P3Sentence3, P3Sentence4, P2Sentence2

or even better setting a minimum and maximum sentences number/paragraph like for example min 1 and max 5 and get this truly random output:

P3Sentence1
P3Sentence2, P1Sentence2, P2Sentence3
P2Sentence1, P3Sentence3, P3Sentence4, P1Sentence1, P2Sentence2

I know this is pretty hard to achieve and I'm pretty sure you cannot do that with the current version of TBS so I'm not asking how to do it but just syaing it would be a nice feature to add - but I would like AT LEAST to be able to randomise the sentences in P3 like this:

P3Sentence2, P3Sentence4, P3Sentence3, P3Sentence1

Now as you suggested in an earlier post I need all sentences as a list and for this it would be another nice feature to add to the content spinner - to be able to separate sentences and place them as a list.

P3Sentence1
P3Sentence2
P3Sentence3
P3Sentence4

Now I can select them all and hit "Spin Together" and this should give me {P3Sentence1|P3Sentence2|P3Sentence3|P3Sentence4}
I can then manually count the sentences and then paste this 4 times like this:

{P3Sentence1|P3Sentence2|P3Sentence3|P3Sentence4} {P3Sentence1|P3Sentence2|P3Sentence3|P3Sentence4} {P3Sentence1|P3Sentence2|P3Sentence3|P3Sentence4} {P3Sentence1|P3Sentence2|P3Sentence3|P3Sentence4}

Now some spun versions could be: P3Sentence1 P3Sentence2 P3Sentence1 P3Sentence1 or P3Sentence2 P3Sentence2 P3Sentence4 P3Sentence1 or P3Sentence3 P3Sentence2 P3Sentence3 P3Sentence4  but as you can tell, there are duplicate sentences an that's not the intended output.

How can I solve this puzzle?

Offline Meg

  • *****
  • 7326
  • Freedup to do what you really want
    • View Profile
Re: How can I spin sentences in paragraphs without getting duplicates
« Reply #1 on: March 15, 2016, 06:08:14 AM »
I actually got my daughter (who is a software programmer) to code something for this in java or javascript. This is a variation of the "how do I put a list in a different order". So if we use fruits instead of paragraph / sentence terms, you are really asking (I think) "how can I put a list of fruits in a different order, without the same fruit appearing twice in the list"?

Let's take a list of fruits such as apple pear orange banana plum mango strawberry. Your original sentence suggests that these could go in any order and it would be possible to leave several of them out and still make sense. So that you might have a paragraph that says "I enjoy pear and strawberry yogurt." or another one that says make your smoothie with banana, mango, pear and strawberry"?

In order to make sure you do not get the same fruit (sentence) repeated, you need to create your lists, as you said, and make these alternates of each other, so that only ONE list is used in your article.

List of fruits (sentences)
apple pear orange banana plum mango strawberry

Now copy this list and put it in a different order. The easiest way I have found is using a spreadsheet, such as excel and copy part of your list and rearrange other parts. With 7 fruits (sentences) I understand (I do not KNOW) that there are !7 possible combinations, that is 1 X 2 X 3 X 4 X 5 X 6 X 7. According to my spreadsheet, that makes over 5,000 possible combinations.
Here are a few of them:
apple pear orange banana plum strawberry mango (note, only the last two interchanged)
apple pear orange banana strawberry mango plum (note last 3 changed)
orange apple pear strawberry mango plum banana (first ones changed here)
pear orange apple strawberry mango plum banana

You can also make different variations with some of the fruits missing, or add another so you have
pear orange banana
strawberry apple mango
plum
pear pineapple kiwi

Now you can spin those list variations, so only 1 list is used in any one article, that is {list 1|list 2|list3} etc. TBS will also offer you the option of a blank so NONE of these lists is used.

Using TBS, you get for the lists above (including a blank):
{apple pear orange banana plum strawberry mango

|apple pear orange banana strawberry mango plum

|orange apple pear strawberry mango plum banana

|pear orange apple strawberry mango plum banana

|pear orange banana

|strawberry apple mango

|plum

|pear pineapple kiwi

|}

Only ONE of these lists will be used in your spun article. You can also add other formatting variations such as bolding, bullet points, numbered lists etc. There is a whole set of articles on this at http://www.howtospinbest.com/usertips.html These are tips contributed by TBS users.

Hope this helps