<commit_before># WikiWho
An algorithm for extracting posts on Wikipedia page deletion discussions.

## Installation Requirements
WikiWho has been tested on Arch Linux running Python 3.4.3 and Ubuntu 12.04 running Python 3.2.3.

WikiWho utilizes the MediaWiki Utilities library to process the revisioned content extracted from Wikipedia.
These functions can be downloaded from the official MediaWiki Utilities repository (under the MIT license) at the
following link:
* https://github.com/halfak/Mediawiki-Utilities

## Running WikiWho

### `WikiWho.py`
This file is the core of this project. Per default, it is used to extract deletion discussions from Wikipedia page dumps, attribute their authorship and write them to disk together with the amounts of seconds between the post creation and the author being blocked. `-1` expresses that the user has not been blocked afterwards. If the `condition` parameter `isRegisteredUserTalk` is passed, it parses user talk pages and writes a block file according to [warning templates](https://en.wikipedia.org/wiki/Wikipedia:Template_messages/User_talk_namespace) it found on the user's talk page. Only a subset of templates are actually considered. See the `writeUserWarning(text, revision, pageName)` method for more information.

#### Parameters
* `-i [source_file_name or directory]` (complete history dump of articles, either as XML, bzip2, gzip, LZMA or 7zip. Alternatively, if a directory is specified, all files residing in it, matching one of the supported file types, will be processed.)
* `-b [<block log>]` (optional when the condition is `isRegisteredUserTalk`. The block log constructed from the Wikipedia data dumps' logging dump through [0nse/WikiParser](https://github.com/0nse/wikiparser).)
* `-c [<condition>]` (optional. It can be `isDeletionDiscussion` for AfD or `isRegisteredUserTalk` for user talk. The default is `isDeletionDiscussion`.

#### Example
* `python WikiwhoRelationships.py -i randomArticle.xml -b blockLog.csv -r 5`
Returns the edit interactions produced at every revision up to revision number 5 (has to be an actual revision id) of `randomArticle.xml`.

### `BlockTimeCalculation.py`<commit_msg>- README still talked about -r which was dropped.<commit_after># WikiWho
An algorithm for extracting posts on Wikipedia page deletion discussions.

## Installation Requirements
WikiWho has been tested on Arch Linux running Python 3.4.3 and Ubuntu 12.04 running Python 3.2.3.

WikiWho utilizes the MediaWiki Utilities library to process the revisioned content extracted from Wikipedia.
These functions can be downloaded from the official MediaWiki Utilities repository (under the MIT license) at the
following link:
* https://github.com/halfak/Mediawiki-Utilities

## Running WikiWho

### `WikiWho.py`
This file is the core of this project. Per default, it is used to extract deletion discussions from Wikipedia page dumps, attribute their authorship and write them to disk together with the amounts of seconds between the post creation and the author being blocked. `-1` expresses that the user has not been blocked afterwards. If the `condition` parameter `isRegisteredUserTalk` is passed, it parses user talk pages and writes a block file according to [warning templates](https://en.wikipedia.org/wiki/Wikipedia:Template_messages/User_talk_namespace) it found on the user's talk page. Only a subset of templates are actually considered. See the `writeUserWarning(text, revision, pageName)` method for more information.

#### Parameters
* `-i [source_file_name or directory]` (complete history dump of articles, either as XML, bzip2, gzip, LZMA or 7zip. Alternatively, if a directory is specified, all files residing in it, matching one of the supported file types, will be processed.)
* `-b [<block log>]` (optional when the condition is `isRegisteredUserTalk`. The block log constructed from the Wikipedia data dumps' logging dump through [0nse/WikiParser](https://github.com/0nse/wikiparser).)
* `-c [<condition>]` (optional. It can be `isDeletionDiscussion` for AfD or `isRegisteredUserTalk` for user talk. The default is `isDeletionDiscussion`.

#### Example
* `python WikiwhoRelationships.py -i randomArticle.xml -b blockLog.csv`
Returns the text introduced in each revision of any given deletion discussion of `randomArticle.xml`.

### `BlockTimeCalculation.py`
{'fraction_non_alphanumeric': 0.07366482504604052, 'fraction_numerical': 0.007366482504604052, 'mean_word_length': 5.233859397417503, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3031414', 'n_tokens_mistral': 1175, 'n_tokens_neox': 1090, 'n_words': 551}