Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to download a category of words from Wiktionary?

I want to download all countable nouns (Category:English countable nouns) from Wiktionary,
I tried some corpus on Index of /enwiktionary/latest/, but it looks hard to extract the category I want. Can anybody tell me which one I should use and how to extract the word list of a specific category? Or is there any other method to do so, like using API?

like image 413
Tong Gao Avatar asked Oct 10 '13 00:10

Tong Gao


1 Answers

categorymembers API. https://en.wiktionary.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:English_countable_nouns&cmprop=title gives:

{
"warnings": {
    "query": {
        "*": "Formatting of continuation data will be changing soon. To continue using the current formatting, use the 'rawcontinue' parameter. To begin using the new format, pass an empty string for 'continue' in the initial query."
    }
},
"query-continue": {
    "categorymembers": {
        "cmcontinue": "page|302d342d30|474610"
    }
},
"query": {
    "categorymembers": [
        {
            "ns": 0,
            "title": "$100 hamburger"
        },
        {
            "ns": 0,
            "title": "%ile"
        },
        {
            "ns": 0,
            "title": "&lit"
        },
        {
            "ns": 0,
            "title": ".com"
        },
        {
            "ns": 0,
            "title": "/b/tard"
        },
        {
            "ns": 0,
            "title": "0"
        },
        {
            "ns": 0,
            "title": "0-10-0"
        },
        {
            "ns": 0,
            "title": "0-10-2"
        },
        {
            "ns": 0,
            "title": "0-12-0"
        },
        {
            "ns": 0,
            "title": "0-2-2"
        }
    ]
}

}

like image 116
Nemo Avatar answered Sep 22 '22 06:09

Nemo