C# Class WikiFunctions.Parse.TypoGroup

Represents a group of similar typo regexes
Show file Open project: reedy/AutoWikiBrowser Class Usage Examples

Public Properties

Property Type Description
GroupSize int
Statistics List
Typos string>>.List

Public Methods

Method Description
Add ( string typo, string replacement ) : void

Adds one typo regex to the list

FixTypos ( string &articleText, string &summary, string articleTitle, string originalArticleText ) : void

Fixes typos

FixTypos2 ( string articleText, string summary, string articleTitle, string originalArticleText ) : void
IsSuitableTypo ( string typo ) : bool

Returns whether typo is sutable for group: not suitable if Allow regex doesn't match typo, or Disallow regex matches typo

MakeGroups ( ) : void

Makes grouped regexes

TypoGroup ( int groupSize, string match, string dontMatch, string prefix, string postfix ) : System

Creates a group that holds similar typos

Private Methods

Method Description
FixTypo ( string &articleText, string &summary, string>.KeyValuePair typo, string articleTitle ) : void

Applies a given typo fix to the article, provided the typo does not also match the article title Updates edit summary based on the first match (value and replacement) of the typo and the total number of replacements

FixTypos ( string &articleText, string &summary, string articleTitle ) : void

Method Details

Add() public method

Adds one typo regex to the list
public Add ( string typo, string replacement ) : void
typo string
replacement string
return void

FixTypos() public method

Fixes typos
public FixTypos ( string &articleText, string &summary, string articleTitle, string originalArticleText ) : void
articleText string The wiki text to update
summary string The edit summary of the page changes
articleTitle string The title of the wiki page
originalArticleText string The wiki text of the page, without any typo fixes applied
return void

FixTypos2() public method

public FixTypos2 ( string articleText, string summary, string articleTitle, string originalArticleText ) : void
articleText string
summary string
articleTitle string
originalArticleText string
return void

IsSuitableTypo() public method

Returns whether typo is sutable for group: not suitable if Allow regex doesn't match typo, or Disallow regex matches typo
public IsSuitableTypo ( string typo ) : bool
typo string
return bool

MakeGroups() public method

Makes grouped regexes
public MakeGroups ( ) : void
return void

TypoGroup() public method

Creates a group that holds similar typos
public TypoGroup ( int groupSize, string match, string dontMatch, string prefix, string postfix ) : System
groupSize int Typos in a batch
match string Regex each typo should match, its first group will be used for extraction
dontMatch string Regex each typo shouldn't match
prefix string
postfix string
return System

Property Details

GroupSize public property

public int GroupSize
return int

Statistics public property

public List Statistics
return List

Typos public property

public List> Typos
return string>>.List