Wikipedia icon indicating copy to clipboard operation
Wikipedia copied to clipboard

the input is chage??

Open SebastiaanDenHertog opened this issue 3 years ago • 1 comments

SebastiaanDenHertog avatar Sep 07 '21 08:09 SebastiaanDenHertog

@anonymous0230 I think this has to do with the suggestions parameter to the Wikipedia web service.

Looking at the wikipedia python code, I think this is the web-service call that gets sent for a summary() call: https://en.wikipedia.org/w/api.php?action=query&list=search&srprop&srlimit=1&limit=1&srsearch=tony%20stark&srinfo=suggestion&format=json which returns the JSON

{
    "warnings": {
        "main": {
            "*": "Unrecognized parameter: limit."
        }
    },
    "batchcomplete": "",
    "continue": {
        "sroffset": 1,
        "continue": "-||"
    },
    "query": {
        "searchinfo": {
            "suggestion": "tony start",
            "suggestionsnippet": "tony start"
        },
        "search": [
            {
                "ns": 0,
                "title": "Iron Man",
                "pageid": 67055
            }
        ]
    }
}

You can see it is the Wikipedia web service that provides the bad suggestion which the python code uses.

Removing the suggestions parameter to the web service call does not remove the suggestion from the resulting JSON output:

{
    "warnings": {
        "main": {
            "*": "Unrecognized parameter: limit."
        }
    },
    "batchcomplete": "",
    "continue": {
        "sroffset": 1,
        "continue": "-||"
    },
    "query": {
        "searchinfo": {
            "totalhits": 5169,
            "suggestion": "tony start",
            "suggestionsnippet": "tony start"
        },
        "search": [
            {
                "ns": 0,
                "title": "Iron Man",
                "pageid": 67055
            }
        ]
    }
}

Hope this helps, -Steven

stevenmz avatar Oct 06 '21 21:10 stevenmz