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

Don't take exact strings from source text #2

Open
antsar opened this issue Apr 19, 2016 · 0 comments
Open

Don't take exact strings from source text #2

antsar opened this issue Apr 19, 2016 · 0 comments

Comments

@antsar
Copy link
Contributor

antsar commented Apr 19, 2016

PyumIpum repeats exact phrases from the text. For example, when querying pizza, I got:

The pizza was auctioned for charity in 2007, raising GB£2,150

That's directly taken from the Wikipedia page.

Check each output sentence to make sure it isn't an exact substring match with the wiki text. If it is, PyumIpsum should ditch that sentence and generate a new one.

Here's the full/exact API response:

{ "common_words" : [ [ "pizza",
        84
      ],
      [ "Pizza",
        26
      ],
      [ "dough",
        14
      ],
      [ "Italy",
        13
      ],
      [ "oven",
        12
      ],
      [ "baked",
        11
      ],
      [ "cheese",
        11
      ],
      [ "sauce",
        10
      ],
      [ "pizzas",
        10
      ],
      [ "made",
        10
      ]
    ],
  "sentences" : [ "Since then pizza consumption has exploded in the United States with Italian immigrants in the surroundings of Naples",
      "was sold from open-air stands and out of pizza in honor of the crust",
      "The pizza was auctioned for charity in 2007, raising GB£2,150"
    ],
  "status" : "0"
}
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

No branches or pull requests

1 participant