sleepyjson icon indicating copy to clipboard operation
sleepyjson copied to clipboard

Icant read my json file for \n

Open zahramahani opened this issue 3 years ago • 0 comments

here are the first lines of my JSON files

"Data": [
        {
            "Answer": {
                "Aliases": [
                    "Presidency of Harry S. Truman",
                    "Hary truman",
                    "Harry Shipp Truman",
                    "Harry Truman's",
                    "Harry S. Truman",
                    "Harry S.Truman",
                    "Harry S Truman",
                    "H. S. Truman",
                    "President Harry Truman",
                    "Truman administration",
                    "Presidency of Harry Truman",
                    "Mr. Citizen",
                    "HST (president)",
                    "H.S. Truman",
                    "Mary Jane Truman",
                    "Harry Shippe Truman",
                    "S truman",
                    "Harry Truman",
                    "President Truman",
                    "33rd President of the United States",
                    "Truman Administration",
                    "Harry Solomon Truman",
                    "Harold Truman",
                    "Harry truman",
                    "H. Truman"
                ],
                "MatchedWikiEntityName": "Harry S. Truman",
                "NormalizedAliases": [
                    "presidency of harry s truman",
                    "33rd president of united states",
                    "truman administration",
                    "s truman",
                    "mr citizen",
                    "harry truman s",
                    "harry truman",
                    "hary truman",
                    "harry shipp truman",
                    "h truman",
                    "harry shippe truman",
                    "h s truman",
                    "president truman",
                    "president harry truman",
                    "hst president",
                    "presidency of harry truman",
                    "mary jane truman",
                    "harry solomon truman",
                    "harold truman",
                    "harry s truman"
                ],
                "NormalizedMatchedWikiEntityName": "harry s truman",
                "NormalizedValue": "harry truman",
                "Type": "WikipediaEntity",
                "Value": "Harry Truman"
            },
            "EntityPages": [
                {
                    "DocSource": "TagMe",
                    "Filename": "Peanuts.txt",
                    "LinkProbability": "0.26224",
                    "Rho": "0.28908",
                    "Title": "Peanuts"
                }
            ],
            "Question": "Who was President when the first Peanuts cartoon was published?",
            "QuestionId": "tc_0",
            "QuestionSource": "http://www.triviacountry.com/",
            "SearchResults": [
                {
                    "Description": "Welcome to GoComics.com, the world's largest comic strip site for online ... If ever there is an iconic comic strip, it is Peanuts. ... The very first Peanuts cartoon!",
                    "DisplayUrl": "www.gocomics.com/peanuts/1950/10/02",
                    "Rank": 0,
                    "Title": "Peanuts Comic Strip, October 02, 1950 on GoComics.com",
                    "Url": "http://www.gocomics.com/peanuts/1950/10/02/"
                },
                {

but I can't read it with sleepy JSON which returns this error: (ValueError: Unexpected input: ': [\n ' ) when I run [reader.next()]

from sleepyjson import Reader

with open("triviaqa-unfiltered/new-unfiltered-web-train.json") as f:
  reader = Reader(f)

  print(reader.value())  # ['an', 'array']
  reader.next()
  print(reader.value())  # {'an': 'object'}

can I ask you to help me please @jdferreira

zahramahani avatar Aug 11 '21 20:08 zahramahani