C# Класс WikiFunctions.Parse.Parsers

Provides functions for editing wiki text, such as formatting and re-categorisation.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
StubMaxWordCount int

Открытые методы

Метод Описание
AddBackMoreText ( string articleText ) : string
AddBackText ( string articleText ) : string
AddBackTextImages ( string articleText ) : string
AddCategory ( string newCategory, string articleText, string articleTitle ) : string

Adds the category to the article.

AddCategory ( string newCategory, string articleText, string articleTitle, bool &noChange ) : string

Adds the category to the article.

AddMissingReflist ( string articleText ) : string

First checks for a <references< missing '/' to correct, otherwise: if the article uses cite references but has no recognised template to display the references, add {{Reflist}} in the appropriate place

AmbigCiteTemplateDates ( string articleText ) : int>.Dictionary

Returns whether the input article text contains ambiguous cite template dates in XX-XX-YYYY or XX-XX-YY format

AmbiguousCiteTemplateDates ( string articleText ) : bool

Returns whether the input article text contains ambiguous cite template dates in XX-XX-YYYY or XX-XX-YY format

BadCiteParameters ( string articleText ) : int>.Dictionary

Searches for unknown/invalid parameters within citation templates

BoldTitle ( string articleText, string articleTitle, bool &noChange ) : string

'''Emboldens''' the first occurrence of the article title, if not already bold 1) Cleans up bolded self wikilinks 2) Cleans up self wikilinks 3) '''Emboldens''' the first occurrence of the article title

BulletExternalLinks ( string articleText ) : string

Adds bullet points to external links after "external links" header

BulletExternalLinks ( string articleText, bool &noChange ) : string

Adds bullet points to external links after "external links" header

CanonicalizeTitle ( string title ) : string

returns URL-decoded link target Handles titles from [[Category:Articles with underscores in the title]]

CanonicalizeTitleAggressively ( string title ) : string

Turns a title into its canonical form, could be slow

CanonicalizeTitleRaw ( string title ) : string

Performs URL-decoding of a page title, trimming all whitespace

CanonicalizeTitleRaw ( string title, bool trim ) : string

performs URL-decoding of a page title

CategoryMatch ( string articleText, string categoryName ) : bool

Returns whether the input string matches the name of a category in use in the input article text string, based on a case insensitive match

ChangeToDefaultSort ( string articleText, string articleTitle, bool &noChange ) : string

Changes an article to use defaultsort when all categories use the same sort field / cleans diacritics from defaultsort/categories

ChangeToDefaultSort ( string articleText, string articleTitle, bool &noChange, bool restrictDefaultsortChanges ) : string

Changes an article to use defaultsort when all categories use the same sort field / cleans diacritics from defaultsort/categories Skips pages using <noinclude>, <includeonly> etc.

CheckNoBots ( string articleText, string user ) : bool

checks if a user is allowed to edit this article using {{bots}} and {{nobots}} tags

CitationPublisherToWork ( string citation ) : string

Where the publisher field is used incorrectly instead of the work field in a {{cite web}} or {{cite news}} citation convert the parameter to be 'work' Scenarios covered: * publisher == URL domain, no work= used

CiteTemplateDates ( string articleText ) : string

Corrects common formatting errors in dates in external reference citation templates (doesn't link/delink dates) note some incorrect date formats such as 3-2-2009 are ambiguous as could be 3-FEB-2009 or MAR-2-2009, these fixes don't address such errors

CiteTemplateDates ( string articleText, bool &noChange ) : string

Corrects common formatting errors in dates in external reference citation templates (doesn't link/delink dates)

Conversions ( string articleText ) : string

Converts/subst'd some deprecated templates

Conversions ( string articleText, bool &noChange ) : string

Converts/subst'd some deprecated templates

Dablinks ( string articleText ) : string

Performs some cleanup operations on dablinks Merges some for & about dablinks Merges multiple distinguish into one

DeadLinks ( string articleText ) : int>.Dictionary

Searches for {{dead link}}s

DeduplicateMaintenanceTags ( List tags ) : List

Deduplicates multiple maintenance tags. Uses earliest of date parameters, merges all other parameters. Does nothing if parameter values other than date parameter are conflicting

DeriveReferenceName ( string articleText, string reference ) : string

Derives a name for a reference by searching for author names and dates, or website base URL etc.

DeterminePredominantDateLocale ( string articleText ) : DateLocale

Determines the predominant date format in the article text (American/International), if available

DeterminePredominantDateLocale ( string articleText, bool considerISO ) : DateLocale

Determines the predominant date format in the article text (American/International/ISO), if available

DeterminePredominantDateLocale ( string articleText, bool considerISO, bool explicitonly ) : DateLocale

Determines the predominant date format in the article text (American/International/ISO), if available

DoublePipeLinks ( string articleText ) : int>.Dictionary

Searches for wikilinks with double pipes

DuplicateNamedReferences ( string articleText ) : string

Where an unnamed reference is a duplicate of another named reference, set the unnamed one to use the named ref Condenses repeated named reference, provided ref not declared within a template call Checks for instances of named references with same ref name having different values, does not modify article text in this case

DuplicateUnnamedReferences ( string articleText ) : string

Derives and sets a reference name per [[WP:REFNAME]] for duplicate <ref>s Then condenses repeated uses of the named reference

ExternalURLToInternalLink ( string articleText ) : string

Converts external links to Wikimedia projects into internal links

ExtractCOinS ( string text ) : string>.Dictionary

Returns a dictionary of COinS parameter and value from the input text Only first set of COinS data is processed

FixBrParagraphs ( string articleText ) : string

Remove <br />'s where not needed

FixCategories ( string articleText ) : string

Fix common spacing/capitalisation errors in categories; remove diacritics and trailing whitespace from sortkeys (not leading whitespace)

FixCitationTemplates ( string articleText ) : string

Applies various formatting fixes to citation templates

FixDateOrdinalsAndOf ( string articleText, string articleTitle ) : string

Removes ordinals, leading zeros from dates and 'of' between a month and a year, per [[WP:MOSDATE]]; on en wiki only

FixDatesA ( string articleText ) : string

Fix date and decade formatting errors: commas in American/international dates, full date ranges, month ranges

FixDatesB ( string articleText, bool CircaLink, bool Floruit ) : string

Fix date and decade formatting errors: date/year ranges to present, full year ranges, performs floruit term wikilinking

FixEmptyLinksAndTemplates ( string articleText ) : string

Removes Empty Links and Template Links Will Cater for [[]], [[Image:]], [[:Category:]], [[Category:]] and {{}}

FixHeadings ( string articleText, string articleTitle ) : string

Fix ==See also== and similar section common errors. Removes unecessary introductory headings and cleans excess whitespace (but not the optional single space at the start & end of headings).

FixHeadings ( string articleText, string articleTitle, bool &noChange ) : string

Fix ==See also== and similar section common errors.

FixImages ( string articleText ) : string

Fix common spacing/capitalisation errors in images

FixLinkWhitespace ( string articleText, string articleTitle ) : string

Fix leading, trailing and middle spaces in Wikilinks

FixLinks ( string articleText, string articleTitle, bool &noChange ) : string

Fixes link syntax, including removal of self links. Underscores not removed from link where page in [[Category:Articles with underscores in the title]]

FixLivingThingsRelatedDates ( string articleText ) : string

Replace b. and d. for born/died, or date– for born per [[WP:BORN]]

FixMainArticle ( string articleText ) : string

Fixes instances of ''Main Article: xxx'' to use {{main|xxx}}, ''see also:'' to use {{see also|xxx}}

FixNonBreakingSpaces ( string articleText ) : string

Apply non-breaking spaces for abbreviated SI units, imperial units, pp for pages. Remove incorrect space before % symbol

FixPeopleCategories ( string articleText, string articleTitle ) : string

Adds [[Category:XXXX births]], [[Category:XXXX deaths]] to articles about people where available, for en-wiki only

FixPeopleCategories ( string articleText, string articleTitle, bool parseTalkPage ) : string

Adds [[Category:XXXX births]], [[Category:XXXX deaths]] to articles about people where available, for en-wiki only When page is not mainspace, adds [[:Category rather than [[Category Removes Date of birth missing/Date of birth missing (living people) category if full DOB in {{birth date and age}}

FixPeopleCategories ( string articleText, string articleTitle, bool parseTalkPage, bool &noChange ) : string

Adds [[Category:XXXX births]], [[Category:XXXX deaths]] to articles about people where available, for en-wiki only

FixReferenceListTags ( string articleText ) : string

Replaces various old reference tag formats, with the new {{Reflist}}, or <references/> for sv-wiki

FixReferenceTags ( string articleText ) : string

Various fixes to the formatting of <ref> reference tags including case conversion and trimming excess whitespace

FixSyntax ( string articleText ) : string

Fixes and improves syntax (such as html markup)

FixSyntax ( string articleText, bool &noChange ) : string

Fixes and improves syntax (such as html markup)

FixSyntaxRedirects ( string articleText ) : string

Performs fixes to redirect pages: * removes newline between #REDIRECT and link (CHECKWIKI error 36) * removes equals sign and double dot between #REDIRECT and link (CHECKWIKI error 36) * Template to Magic word conversion; removes unnecessary brackets around redirect * Simple closing bracket fixing to {{R...}} templates

FixSyntaxSubstRefTags ( string articleText ) : string

workaround for https://phabricator.wikimedia.org/T4700 -- {{subst:}} doesn't work within ref tags

FixTemperatures ( string articleText ) : string

Fix bad Temperatures

FixUnicode ( string articleText ) : string

Performs transformations related to Unicode characters that may cause problems for different clients Removes line separator Unicode characters at start of paragraph, otherwise converts line separator, paragraph separator Unicode characters to spaces.

FormatToBDA ( string dateandage ) : string

takes input string of date and age e.g. "11 May 1990 (age 21)" and converts to {{birth date and age|1990|5|11}}

GetAllTemplateDetail ( string articleText ) : List

Extracts a distinct list of all template calls in the input text, supporting any level of template nesting.

GetAllTemplates ( string articleText ) : List

Extracts a list of all templates used in the input text, supporting any level of template nesting. Template name given in first letter upper

GetAllWikiLinks ( string articleText ) : List

Extracts a list of all wikilinks (all including cats, images etc.) used in the input text

GetCategorySort ( string articleText ) : string

Returns the sortkey used by all categories, if * all categories use the same sortkey * no {{DEFAULTSORT}} in article Otherwise returns null

GetCategorySort ( string articleText, string articleTitle, int &matches ) : string

Returns the sortkey used by all categories, if all categories use the same sortkey Where no sortkey is used for all categories, returns the articletitle

GetInfoBoxFieldValue ( string articleText, List fields ) : string

Returns the value of the given fields from the page's infobox, where available Returns a null string if the input article has no infobox, or the input field regex doesn't match on the infobox found

GetInfoBoxFieldValue ( string articleText, string field ) : string

Returns the value of the given field from the page's infobox, where available Returns a null string if the input article has no infobox, or the input field regex doesn't match on the infobox found

GetTemplate ( string articleText, string template ) : string

Finds first occurrence of a given template in article text. Handles nested templates correctly.

GetTemplates ( string articleText ) : List

Finds all templates in article text excluding commented out/nowiki'd templates. Handles nested templates and templates with embedded HTML comments correctly.

GetTemplates ( string articleText, string template ) : List

Finds every occurrence of a given template in article text, excludes commented out/nowiki'd templates Handles nested templates and templates with embedded HTML comments correctly.

HasBareReferences ( string articleText ) : bool

Returns true if the article contains bare external links in the references section (just the URL link on a line with no description/name)

HasDeadLinks ( string articleText ) : bool

Returns whether the input article text contains any {{dead link}} templates, ignoring comments

HasDoublePipeLinks ( string articleText ) : bool

Returns whether the input article text contains any wikilinks with double pipes

HasInfobox ( string articleText ) : bool

Checks if the article has an InfoBox (en wiki)

HasMorefootnotesAndManyReferences ( string articleText ) : bool

Check if the article contains a {{no footnotes}} or {{more footnotes}} template but has 5+ <ref>...</ref> references

HasNamedReferences ( string articleText ) : bool

Checks for named references in short format <ref name=foo />

HasRefAfterReflist ( string articleText ) : bool

Check if the article contains a <ref>...</ref> reference after the {{reflist}} to show them

HasSeeAlsoAfterNotesReferencesOrExternalLinks ( string articleText ) : bool

Checks position of See also section relative to Notes, references, external links sections

HasSicTag ( string articleText ) : bool

Check if the article contains a sic template or bracketed wording, indicating the presence of a deliberate typo

HasStubTemplate ( string articleText ) : bool

Checks if the article has a stub template

HasTargetLessLinks ( string articleText ) : bool

Returns whether the input article text contains any wikilinks with no target

HideMoreText ( string articleText ) : string
HideMoreText ( string articleText, bool hideOnlyTargetOfWikilink ) : string
HideText ( string articleText ) : string
HideTextImages ( string articleText ) : string
InterwikiConversions ( string articleText ) : string

Replaces legacy/deprecated language codes in interwikis with correct ones

InterwikiConversions ( string articleText, bool &noChange ) : string

Replaces legacy/deprecated language codes in interwikis with correct ones

IsArticleAboutAPerson ( string articleText, string articleTitle ) : bool

determines whether the article is about a person by looking for persondata/birth death categories, bio stub etc. for en wiki only

IsArticleAboutAPerson ( string articleText, string articleTitle, bool parseTalkPage ) : bool

determines whether the article is about a person by looking for persondata/birth death categories, bio stub etc. for en wiki only Should only return true if the article is the principle article about the individual (not early life/career/discography etc.)

IsInUse ( string articleText ) : bool

Check if article has an 'in use' or 'in creation' tag

IsMissingReferencesDisplay ( string articleText ) : bool

Check if the article uses cite references but has no recognised template to display the references; only for en-wiki

IsStub ( string articleText ) : bool

Checks if the article is classible as a 'Stub'

LivingPeople ( string articleText, string articleTitle ) : string

Adds [[Category:Living people]] to articles with a [[Category:XXXX births]] and no living people/deaths category, taking sortkey from births category if present When page is not mainspace, adds [[:Category rather than [[Category

LivingPeople ( string articleText, string articleTitle, bool &noChange ) : string

Adds [[Category:Living people]] to articles with a [[Category:XXXX births]] and no living people/deaths category, taking sortkey from births category if present

LoadDatedTemplates ( string text ) : List

Processes the text of [[WP:AWB/Dated templates]] into a list of template names Format: * {{tl|Wikify}}

LoadRenamedTemplateParameters ( string text ) : List

Loads List of templates (first letter lower), old parameter, new parameter from within {{AWB rename template parameter}}

LoadTemplateRedirects ( string text ) : string>.Dictionary

Processes the text of [[WP:AWB/Template redirects]] into a dictionary of regexes and new template names Format: {{tl|template 1}}, {{tl|template 2}} → {{tl|actual template}}

Mdashes ( string articleText, string articleTitle ) : string

Replaces hyphens and em-dashes with en-dashes, per [[WP:DASH]]

MergePortals ( string articleText ) : string

Merges multiple {{portal}} templates into a single one, removing any duplicates. En-wiki only. Restricted to {{portal}} calls with one argument Article must have existing {{portal}} and/or a 'see also' section

MergeTemplatesBySection ( string articleText ) : string

Merges multiple instances of the same template in the same section

MissingDefaultSort ( string articletext, string articletitle ) : bool

Returns whether the article is missing a defaultsort (i.e. criteria match so that defaultsort would be added)

MultipleIssues ( string articleText ) : string

Combines maintenance tags into {{multiple issues}} template, for en-wiki only Operates on a section by section basis through article text

NoIncludeIncludeOnlyProgrammingElement ( string articleText ) : bool

Returns whether the article text has a <noinclude> or <includeonly> or '{{{1}}}' etc. which should not appear on the mainspace

Parsers ( int stubWordCount, bool addHumanKey ) : System

Re-organises the Person Data, stub/disambig templates, categories and interwikis

PersonData ( string articleText, string articleTitle ) : string

* Adds the default {{persondata}} template to en-wiki mainspace pages about a person that don't already have {{persondata}} * Attempts to complete blank {{persondata}} fields based on infobox values

PredominantDates ( string articleText ) : string

Updates dates in citation templates to use the strict predominant date format in the article (en wiki only)

ReCategoriser ( string oldCategory, string newCategory, string articleText, bool &noChange ) : string

Re-categorises the article.

ReCategoriser ( string oldCategory, string newCategory, string articleText, bool &noChange, bool removeSortKey ) : string

Re-categorises the article.

RedirectTagger ( string articleText, string articleTitle ) : string

For en-wiki tags redirect pages with one or more of the templates from [[Wikipedia:Template messages/Redirect pages]] following [[WP:REDCAT]]

RefsAfterPunctuation ( string articleText ) : string

Puts <ref> and {{sfn}} references after punctuation (comma, full stop) per WP:REFPUNC Applies to en/el wiki only

RegularCategories ( List
AllCategories ) : List

Returns the categories that are not stub or proposed deletion categories from the input list

RegularCategories ( string articleText ) : List

Returns the categories that are not stub or proposed deletion categories from the input article text

RegularCategories ( string articleText, bool hideComments ) : List

Returns the categories that are not stub or proposed deletion categories from the input article text

RemoveAllWhiteSpace ( string articleText ) : string

Applies removes all excess whitespace from the article Not called by general fixes

RemoveCategory ( string strOldCat, string articleText ) : string

Removes a category from an article.

RemoveCategory ( string strOldCat, string articleText, bool &noChange ) : string

Removes a category from an article.

RemoveDuplicateWikiLinks ( string articleText ) : string

Remove some of the duplicated wikilinks from the article text

RemoveEmptyComments ( string articleText ) : string

Removes HTML comments with nothing/only whitespace between tags

RemoveImage ( string image, string articleText, bool commentOut, string comment ) : string

Removes an image from the article.

RemoveImage ( string image, string articleText, bool commentOut, string comment, bool &noChange ) : string

Removes an image in the article.

RemoveTemplateNamespace ( string articleText ) : string

Removes Template: (or equivalent translation) from start of template calls, canonicalizes template names

RemoveWhiteSpace ( string articleText ) : string

Applies/removes some excess whitespace from the article

RemoveWhiteSpace ( string articleText, bool fixOptionalWhitespace ) : string

Applies/removes some excess whitespace from the article

RenameTemplateParameters ( string articleText, List RenamedTemplateParameters ) : string

Renames parameters in template calls. Does not rename old to new if new paramter already in use with a value

ReorderReferences ( string articleText ) : string

Reorders references so that they appear in numerical order, allows for use of {{rp}}, doesn't modify grouped references [[WP:REFGROUP]]

ReplaceImage ( string oldImage, string newImage, string articleText ) : string

Replaces an image in the article.

ReplaceImage ( string oldImage, string newImage, string articleText, bool &noChange ) : string

Replaces an image in the article.

SameRefDifferentName ( string articleText ) : string

Corrects named references where the reference text is the same but the reference name is different

SimplifyLinks ( string articleText ) : string

Simplifies some links in article wiki text such as changing [[Dog|Dogs]] to [[Dog]]s Fixes CHECKWIKI error 64

SimplifyReferenceTags ( string articleText ) : string

Replaces reference tags in the form <ref name="blah"></ref> with <ref name="blah" /> Removes some of the MW errors that occur from the prior

SortMetaData ( string articleText, string articleTitle ) : string

Re-organises the Person Data, stub/disambig templates, categories and interwikis except when a mainspace article has some 'includeonly' tags etc.

SortMetaData ( string articleText, string articleTitle, bool fixOptionalWhitespace ) : string

Re-organises the Person Data, stub/disambig templates, categories and interwikis except when a mainspace article has some 'includeonly' tags etc.

StickyLinks ( string articleText ) : string

Joins nearby words with links e.g. "[[Russian literature|Russian]] literature" to "[[Russian literature]]"

SubstUserTemplates ( string talkPageText, string talkPageTitle, Regex userTalkTemplatesRegex ) : string

Substitutes some user talk templates

TagUpdater ( string articleText ) : string

Sets the date (month & year) for undated cleanup tags that take a date, from https://en.wikipedia.org/wiki/Wikipedia:AWB/Dated_templates Avoids changing tags in unformatted text areas (wiki comments etc.) Note: https://phabricator.wikimedia.org/T4700 means {{subst:}} within ref tags doesn't work, AWB doesn't do anything about it

Tagger ( string articleText, string articleTitle, bool restrictOrphanTagging, bool &noChange, string &summary ) : string

If necessary, adds/removes various cleanup tags such as wikify, stub, ibid

Tagger ( string articleText, string articleTitle, bool restrictOrphanTagging, string &summary ) : string

If necessary, adds/removes wikify or stub tag

TaggerPermitted ( string articleText, string articleTitle ) : bool

Checks whether Tagger is permitted on article. Allowed on mainspace for non-redirect pages without {{wi}} template Also allowed for ar-wiki namespace 104

TargetLessLinks ( string articleText ) : int>.Dictionary

Searches for wikilinks with no target e.g. [[|foo]]

TemplateExists ( List templatesFound, Regex r ) : bool

Returns whether the given regex matches any of the (first name upper) templates in the given list

TemplateRedirects ( string articleText, string>.Dictionary DictionaryOfTemplateRedirects ) : string

Renames templates to bypass template redirects from [[WP:AWB/Template redirects]] The first letter casing of the existing redirect is kept in the new template name, except for acronym templates where first letter uppercase is enforced Calls TemplateToMagicWord if changes made

UnbalancedBrackets ( string articleText, int &bracketLength ) : int

Checks the article text for unbalanced brackets, either square or curly

UnclosedTags ( string articleText ) : int>.Dictionary

Searches for any unclosed <math>, <source>, <ref>, <code>, <nowiki>, <small>, <pre> <center> <sup> <sub> or <gallery> tags and comments

Unicodify ( string articleText ) : string

Converts HTML entities to unicode, with some deliberate exceptions Does not change 5-character HTML hex entities

Unicodify ( string articleText, bool &noChange ) : string

Converts HTML entities to unicode, with some deliberate exceptions

UserSignature ( string articleText ) : int>.Dictionary

Searches for link to user and/or user talk namespace

Приватные методы

Метод Описание
AddedBoldIsValid ( string articleText, string escapedTitle ) : bool

Checks that the bold just added to the article is the first bold in the article, and that it's within the first 5% of the HideMore article OR immediately after the infobox

BoldItalicME ( Match m ) : string

Replaces with three apostrophes (''') if <B> or <b> tag, else just two ('')

BoldedSelfLinks ( string articleTitle, string articleText ) : string

Delinks all bolded self links in the article

CatEnd ( string sort ) : string
CiteTemplateME ( Match m ) : string

convert invalid date formats like DD-MM-YYYY, MM-DD-YYYY, YYYY-D-M, YYYY-DD-MM, YYYY_MM_DD etc. to iso format of YYYY-MM-DD

CiteTemplateMEParameterToProcess ( List parameters ) : bool
CleanDerivedReferenceName ( string derivedName ) : string

Removes various unwanted punctuation and comment characters from a derived reference name

CompletePersonDataDate ( string personData, string articletext ) : string

Sets persondata date of birth/death fields based on unformatted info in zeroth section of article, provided dates match existing birth/death categories

DefaultsortME ( Match m ) : string

Trims whitespace around DEFAULTSORT value, ensures 'whitespace only' DEFAULTSORT left unchanged, removes trailing square brackets

DefaultsortTitlesWithDiacritics ( string articleText, string articleTitle, int categories, bool articleAboutAPerson ) : string

If title has diacritics, no defaultsort added yet, adds a defaultsort with cleaned up title as sort key If article is about a person, generates human name sortkey

DictionaryOfMatches ( string articleText, Regex r ) : int>.Dictionary

Returns a dictionary of the match index and length of all matches of the input regex in the input text

ExplicitCategorySortkeys ( string articleText, string defaultsortKey ) : string

Removes any explicit keys that are case insensitively the same as the default sort OR entirely match the start of the defaultsort (To help tidy up on pages that already have defaultsort)

ExtractReferenceNameComponents ( string reference, Regex referenceNameMask, int components ) : string

Extracts strings from an input string using the input regex to derive a name for a reference

ExtractTemplate ( string articleText, Match m ) : string

Extracts template using the given match.

FixCitationTemplatesME ( Match m ) : string

Performs fixes to a given citation template call

FixDateOrdinalsAndOfLocal ( string textPortion, bool monthsInTitle ) : string
FixDatesAInternal ( string textPortion ) : string
FixDatesBInternal ( string textPortion, bool CircaLink ) : string
FixHeadingsME ( Match m ) : string

Performs various fixes to headings

FixImagesME ( Match m ) : string
FixLinksInfoBoxSingleAlbum ( string articleText, string articleTitle ) : string

Converts self links for the 'this single/album' field of 'infobox single/album' to bold

FixLinksWikilinkBoldItalicsME ( Match m ) : string

Converts [[foo|'''foo''']] → '''[[foo|foo]]''' for bold, italics or bold and italics only simplify where link & target values are the same without bold/italics (first letter case insensitive)

FixLinksWikilinkCanonicalizeME ( Match m ) : string

Canonicalize link targets, removes underscores except if page from [[Category:Articles with underscores in the title]]

FixPageRanges ( string templateCall, string>.Dictionary Params ) : string

Converts hyphens in page ranges in citation template fields to endashes

FixPageRangesValue ( string pageRange ) : string
FixReferenceTagsME ( Match m ) : string
FixSelfInterwikis ( string articleText ) : string

Reformats self interwikis to be standard links. Only applies to self interwikis before other interwikis (i.e. those in body of article)

FixSmallTags ( string articleText ) : string

remove <small> in small, ref, sup, sub tags and images, but not within {{legend}} template CHECKWIKI errors 55, 63, 66, 77

FixSmallTagsME ( Match m ) : string
FixSmallTagsME2 ( Match m ) : string
FixSyntaxDefaultSort ( string articleText ) : string

Applies fixes to any DEFAULTSORT templates in the input text

FixSyntaxISBN ( string articleText, List ssbISBN ) : string
FixSyntaxSubstRefTagsME ( Match m ) : string
FixUnbalancedBrackets ( string articleText ) : string

Applies some fixes for unbalanced brackets, applied if there are unbalanced brackets

FixUnbalancedBracketsSection ( string articleText ) : string

Applies some fixes for unbalanced brackets, applied if there are unbalanced brackets Run at section level: allows unbalanced brackets in other sections not to affect correction of current section

FullYearRangeME ( Match m ) : string
GetAllTemplatesNew ( string articleText ) : List

Extracts a list of all templates used in the input text, supporting any level of template nesting. Template name given in first letter upper. Most performant version using HashSet.

GetCats ( string articleText ) : string

Returns a concatenated string of all categories in the article

GetNamedRefs ( string articleText ) : List

Extracts a list of all named refs, including condensed used in the input text

GetTemplates ( string articleText, Regex search ) : List

Finds all templates in article text excluding commented out/nowiki'd templates. Handles nested templates and templates with embedded HTML comments correctly.

GetUnnamedRefs ( string articleText ) : List

Extracts a list of all unnamed refs used in the input text

HumanDefaultSortCleanupRequired ( Match ds ) : bool

Returns whether human name defaultsort cleanup required: contains apostrophe or unspaced comma

LooseCategoryME ( Match m ) : string
MILaterSection ( string section, Regex Templates ) : string

Works on non-zeroth section of article Converts multiple issues with one issue -> single issue tag Puts other section maintenance tags inside existing MI, or adds MI if two or more section maintenance tags

MIZerothSection ( string zerothsection, Regex Templates ) : string

Merges multiple MI templates in zeroth section, if possible Converts multiple issues with one issue -> single issue tag Puts other maintenance tags inside existing MI, or adds MI if two or more tags

MergeMultipleMI ( string articleText ) : string

Merge multiple {{multiple issues}} templates in zeroth section into one

MergeTemplates ( string sectionText, string templateName ) : string

Merges all instances of the given template in the given section of the article, only when templates at top of section

MultipleIssuesDeDupe ( Match m ) : string

Deduplicates tags in multipleissues template calls (not section templates)

MultipleIssuesSingleTagME ( Match m ) : string

Converts new-style multiple issues template with one issue to standalone tag

MultipleIssuesZeroTag ( Match m ) : string

Removes multiple issues with zero tags, fix excess newlines

OnlyArticleBLPTemplateME ( Match m, string newTemplateName ) : string

Renames template if the only name arguments are BLP=, date= and article=, or there are no arguments

Parsers ( ) : System

PrepareTaggerEditSummary ( ) : string
ReferenceNameValid ( string articleText, string derivedReferenceName ) : bool

Checks the validity of a new reference name: Name at least 3 characters and not already used in article, not just 'http'

ReflistMatchEvaluator ( Match m ) : string
RefsBeforePunctuation ( string articleText ) : string
RefsTemplateIndex ( string articleText ) : int

Returns the index of the {{reflist}} or {{refs}} or <references> tags, or the articleText length if no tags found

RenameTemplateParametersHashSetME ( Match m, List RenamedTemplateParameters ) : string

Most performant RenameTemplateParameters MatchEvaluator using HashSets

ReorderRefs ( string articleText, Regex outofOrderRegex, int referencestagindex, int>.Dictionary NamedRefsIndexes ) : string

reorders references within the article text based on the input regular expression providing matches for references that are out of numerical order

SameMonthAmericanDateRangeME ( Match m ) : string
SameNamedRefShortText ( string articleText ) : string

refs with same name, but one is very short, so just change to <ref name=foo/> notation

SectionTemplateConversionsME ( Match m ) : string

Converts templates such as {{foo|section|...}} to {{foo section|...}}

SelfLinks ( string zerothSection, string articleTitle ) : string
SetAllTemplateRedirectsHashSet ( List RedirectsList ) : void

Sets the WikiRegexes .AllTemplateRedirects HashSet

SetPersonDataDate ( string personData, string field, string sourceValue, string articletext ) : string

Completes a persondata call with a date of birth/death.

SpacedFullYearRangeME ( Match m ) : string
SquareBracketsInExternalLinksME ( Match m ) : string

Fixes bracket problems within external links, converting internal [ or ] to [ or ] respectively

StubChecker ( Match m ) : string
TagEmptySection ( string articleText ) : string

Tags empty level-2 sections with {{Empty section}}, en-wiki mainspace only

TagOrphans ( string articleText, string articleTitle, bool restrictOrphanTagging ) : string

Tags pages with insufficient incoming page links with the orphan template (localised for ru-wiki). Removes orphan tag from pages with sufficient incoming page links. Disambig, SIA pages and soft redirects to Wictionary are never tagged as orphan.

TagRefsIbid ( string articleText ) : string

Tags references of 'ibid' with the {{ibid}} cleanup template, en-wiki mainspace only

TagUpdaterME ( Match m ) : string

Match evaluator for tag updater Tags undated tags, corrects incorrect template parameter names, removes template namespace in template name

TemplateCount ( List templatesFound, Regex r ) : int

Returns the count of matches for the given regex against the (first name upper) templates in the given list

TemplateRedirectsHashSet ( string articleText, string>.Dictionary TemplateRedirects ) : string

Most performant version of TemplateRedirects using HashSets

TemplateRedirectsME ( Match m, string newTemplateName ) : string
TotalRefsNotGrouped ( string arcticleText ) : int

Returns the number of <ref> references in the input text, excluding grouped refs

UnbalancedBrackets ( string articleText, string openingBrackets, string closingBrackets, Regex bracketsRegex ) : int

Checks the article text for unbalanced brackets of the input type

YearOfBirthDeathMissingCategory ( string articleText, string cats ) : string

Removes year of birth/death missing categories when xxx births/deaths category also present Removes Date of birth missing/Date of birth missing (living people) category if full DOB in {{birth date and age}}

YearRangeShortenedCenturyME ( Match m ) : string

Описание методов

AddBackMoreText() публичный Метод

public AddBackMoreText ( string articleText ) : string
articleText string
Результат string

AddBackText() публичный Метод

public AddBackText ( string articleText ) : string
articleText string
Результат string

AddBackTextImages() публичный Метод

public AddBackTextImages ( string articleText ) : string
articleText string
Результат string

AddCategory() публичный Метод

Adds the category to the article.
public AddCategory ( string newCategory, string articleText, string articleTitle ) : string
newCategory string The new category.
articleText string The wiki text of the article.
articleTitle string Title of the article
Результат string

AddCategory() публичный Метод

Adds the category to the article.
public AddCategory ( string newCategory, string articleText, string articleTitle, bool &noChange ) : string
newCategory string The new category.
articleText string The wiki text of the article.
articleTitle string Title of the article
noChange bool
Результат string

AddMissingReflist() публичный статический Метод

First checks for a <references< missing '/' to correct, otherwise: if the article uses cite references but has no recognised template to display the references, add {{Reflist}} in the appropriate place
public static AddMissingReflist ( string articleText ) : string
articleText string The wiki text of the article
Результат string

AmbigCiteTemplateDates() публичный статический Метод

Returns whether the input article text contains ambiguous cite template dates in XX-XX-YYYY or XX-XX-YY format
public static AmbigCiteTemplateDates ( string articleText ) : int>.Dictionary
articleText string The article text to search
Результат int>.Dictionary

AmbiguousCiteTemplateDates() публичный статический Метод

Returns whether the input article text contains ambiguous cite template dates in XX-XX-YYYY or XX-XX-YY format
public static AmbiguousCiteTemplateDates ( string articleText ) : bool
articleText string the article text to search
Результат bool

BadCiteParameters() публичный статический Метод

Searches for unknown/invalid parameters within citation templates
public static BadCiteParameters ( string articleText ) : int>.Dictionary
articleText string the wiki text to search
Результат int>.Dictionary

BoldTitle() публичный Метод

'''Emboldens''' the first occurrence of the article title, if not already bold 1) Cleans up bolded self wikilinks 2) Cleans up self wikilinks 3) '''Emboldens''' the first occurrence of the article title
public BoldTitle ( string articleText, string articleTitle, bool &noChange ) : string
articleText string The wiki text of the article.
articleTitle string The title of the article.
noChange bool Value that indicated whether no change was made.
Результат string

BulletExternalLinks() публичный статический Метод

Adds bullet points to external links after "external links" header
public static BulletExternalLinks ( string articleText ) : string
articleText string The wiki text of the article.
Результат string

BulletExternalLinks() публичный статический Метод

Adds bullet points to external links after "external links" header
public static BulletExternalLinks ( string articleText, bool &noChange ) : string
articleText string The wiki text of the article.
noChange bool Value that indicated whether no change was made.
Результат string

CanonicalizeTitle() публичный статический Метод

returns URL-decoded link target Handles titles from [[Category:Articles with underscores in the title]]
public static CanonicalizeTitle ( string title ) : string
title string
Результат string

CanonicalizeTitleAggressively() публичный статический Метод

Turns a title into its canonical form, could be slow
public static CanonicalizeTitleAggressively ( string title ) : string
title string
Результат string

CanonicalizeTitleRaw() публичный статический Метод

Performs URL-decoding of a page title, trimming all whitespace
public static CanonicalizeTitleRaw ( string title ) : string
title string
Результат string

CanonicalizeTitleRaw() публичный статический Метод

performs URL-decoding of a page title
public static CanonicalizeTitleRaw ( string title, bool trim ) : string
title string title to normalise
trim bool whether whitespace should be trimmed
Результат string

CategoryMatch() публичный статический Метод

Returns whether the input string matches the name of a category in use in the input article text string, based on a case insensitive match
public static CategoryMatch ( string articleText, string categoryName ) : bool
articleText string the article text
categoryName string name of the category
Результат bool

ChangeToDefaultSort() публичный статический Метод

Changes an article to use defaultsort when all categories use the same sort field / cleans diacritics from defaultsort/categories
public static ChangeToDefaultSort ( string articleText, string articleTitle, bool &noChange ) : string
articleText string The wiki text of the article.
articleTitle string Title of the article
noChange bool If there is no change (True if no Change)
Результат string

ChangeToDefaultSort() публичный статический Метод

Changes an article to use defaultsort when all categories use the same sort field / cleans diacritics from defaultsort/categories Skips pages using <noinclude>, <includeonly> etc.
public static ChangeToDefaultSort ( string articleText, string articleTitle, bool &noChange, bool restrictDefaultsortChanges ) : string
articleText string The wiki text of the article.
articleTitle string Title of the article
noChange bool If there is no change (True if no Change)
restrictDefaultsortChanges bool Prevent insertion of a new {{DEFAULTSORT}} as AWB may not always be right for articles about people
Результат string

CheckNoBots() публичный статический Метод

checks if a user is allowed to edit this article using {{bots}} and {{nobots}} tags
public static CheckNoBots ( string articleText, string user ) : bool
articleText string The wiki text of the article.
user string Name of this user
Результат bool

CitationPublisherToWork() публичный статический Метод

Where the publisher field is used incorrectly instead of the work field in a {{cite web}} or {{cite news}} citation convert the parameter to be 'work' Scenarios covered: * publisher == URL domain, no work= used
public static CitationPublisherToWork ( string citation ) : string
citation string the citation
Результат string

CiteTemplateDates() публичный статический Метод

Corrects common formatting errors in dates in external reference citation templates (doesn't link/delink dates) note some incorrect date formats such as 3-2-2009 are ambiguous as could be 3-FEB-2009 or MAR-2-2009, these fixes don't address such errors
public static CiteTemplateDates ( string articleText ) : string
articleText string The wiki text of the article.
Результат string

CiteTemplateDates() публичный Метод

Corrects common formatting errors in dates in external reference citation templates (doesn't link/delink dates)
public CiteTemplateDates ( string articleText, bool &noChange ) : string
articleText string The wiki text of the article.
noChange bool
Результат string

Conversions() публичный статический Метод

Converts/subst'd some deprecated templates
public static Conversions ( string articleText ) : string
articleText string The wiki text of the article.
Результат string

Conversions() публичный статический Метод

Converts/subst'd some deprecated templates
public static Conversions ( string articleText, bool &noChange ) : string
articleText string The wiki text of the article.
noChange bool Value that indicated whether no change was made.
Результат string

Dablinks() публичный статический Метод

Performs some cleanup operations on dablinks Merges some for & about dablinks Merges multiple distinguish into one
public static Dablinks ( string articleText ) : string
articleText string The article text
Результат string

DeadLinks() публичный статический Метод

Searches for {{dead link}}s
public static DeadLinks ( string articleText ) : int>.Dictionary
articleText string The article text
Результат int>.Dictionary

DeduplicateMaintenanceTags() публичный статический Метод

Deduplicates multiple maintenance tags. Uses earliest of date parameters, merges all other parameters. Does nothing if parameter values other than date parameter are conflicting
public static DeduplicateMaintenanceTags ( List tags ) : List
tags List Maintenance tags list
Результат List

DeriveReferenceName() публичный статический Метод

Derives a name for a reference by searching for author names and dates, or website base URL etc.
public static DeriveReferenceName ( string articleText, string reference ) : string
articleText string text of article, to check the derived name is not already used for some other reference
reference string the value of the reference a name is needed for
Результат string

DeterminePredominantDateLocale() публичный статический Метод

Determines the predominant date format in the article text (American/International), if available
public static DeterminePredominantDateLocale ( string articleText ) : DateLocale
articleText string the article text
Результат DateLocale

DeterminePredominantDateLocale() публичный статический Метод

Determines the predominant date format in the article text (American/International/ISO), if available
public static DeterminePredominantDateLocale ( string articleText, bool considerISO ) : DateLocale
articleText string the article text
considerISO bool whether to consider ISO as a possible predominant date format
Результат DateLocale

DeterminePredominantDateLocale() публичный статический Метод

Determines the predominant date format in the article text (American/International/ISO), if available
public static DeterminePredominantDateLocale ( string articleText, bool considerISO, bool explicitonly ) : DateLocale
articleText string the article text
considerISO bool whether to consider ISO as a possible predominant date format
explicitonly bool whether to restrict logic to look at {{use xxx dates}} template only
Результат DateLocale

DoublePipeLinks() публичный статический Метод

Searches for wikilinks with double pipes
public static DoublePipeLinks ( string articleText ) : int>.Dictionary
articleText string The article text
Результат int>.Dictionary

DuplicateNamedReferences() публичный статический Метод

Where an unnamed reference is a duplicate of another named reference, set the unnamed one to use the named ref Condenses repeated named reference, provided ref not declared within a template call Checks for instances of named references with same ref name having different values, does not modify article text in this case
public static DuplicateNamedReferences ( string articleText ) : string
articleText string The wiki text of the article.
Результат string

DuplicateUnnamedReferences() публичный статический Метод

Derives and sets a reference name per [[WP:REFNAME]] for duplicate <ref>s Then condenses repeated uses of the named reference
public static DuplicateUnnamedReferences ( string articleText ) : string
articleText string the text of the article
Результат string

ExternalURLToInternalLink() публичный статический Метод

Converts external links to Wikimedia projects into internal links
public static ExternalURLToInternalLink ( string articleText ) : string
articleText string The wiki text of the article.
Результат string

ExtractCOinS() публичный статический Метод

Returns a dictionary of COinS parameter and value from the input text Only first set of COinS data is processed
public static ExtractCOinS ( string text ) : string>.Dictionary
text string Raw HTML containing COinS data
Результат string>.Dictionary

FixBrParagraphs() публичный Метод

Remove <br />'s where not needed
public FixBrParagraphs ( string articleText ) : string
articleText string
Результат string

FixCategories() публичный статический Метод

Fix common spacing/capitalisation errors in categories; remove diacritics and trailing whitespace from sortkeys (not leading whitespace)
public static FixCategories ( string articleText ) : string
articleText string The wiki text of the article.
Результат string

FixCitationTemplates() публичный статический Метод

Applies various formatting fixes to citation templates
public static FixCitationTemplates ( string articleText ) : string
articleText string The wiki text of the article.
Результат string

FixDateOrdinalsAndOf() публичный Метод

Removes ordinals, leading zeros from dates and 'of' between a month and a year, per [[WP:MOSDATE]]; on en wiki only
public FixDateOrdinalsAndOf ( string articleText, string articleTitle ) : string
articleText string The wiki text of the article
articleTitle string The article's title
Результат string

FixDatesA() публичный Метод

Fix date and decade formatting errors: commas in American/international dates, full date ranges, month ranges
public FixDatesA ( string articleText ) : string
articleText string
Результат string

FixDatesB() публичный Метод

Fix date and decade formatting errors: date/year ranges to present, full year ranges, performs floruit term wikilinking
public FixDatesB ( string articleText, bool CircaLink, bool Floruit ) : string
articleText string
CircaLink bool
Floruit bool
Результат string

FixEmptyLinksAndTemplates() публичный статический Метод

Removes Empty Links and Template Links Will Cater for [[]], [[Image:]], [[:Category:]], [[Category:]] and {{}}
public static FixEmptyLinksAndTemplates ( string articleText ) : string
articleText string The wiki text of the article.
Результат string

FixHeadings() публичный статический Метод

Fix ==See also== and similar section common errors. Removes unecessary introductory headings and cleans excess whitespace (but not the optional single space at the start & end of headings).
public static FixHeadings ( string articleText, string articleTitle ) : string
articleText string The wiki text of the article.
articleTitle string the title of the article
Результат string

FixHeadings() публичный статический Метод

Fix ==See also== and similar section common errors.
public static FixHeadings ( string articleText, string articleTitle, bool &noChange ) : string
articleText string The wiki text of the article.
articleTitle string the title of the article
noChange bool Value that indicates whether no change was made.
Результат string

FixImages() публичный статический Метод

Fix common spacing/capitalisation errors in images
public static FixImages ( string articleText ) : string
articleText string The wiki text of the article.
Результат string

FixLinkWhitespace() публичный статический Метод

Fix leading, trailing and middle spaces in Wikilinks
public static FixLinkWhitespace ( string articleText, string articleTitle ) : string
articleText string The wiki text of the article
articleTitle string The article title.
Результат string

FixLinks() публичный статический Метод

Fixes link syntax, including removal of self links. Underscores not removed from link where page in [[Category:Articles with underscores in the title]]
public static FixLinks ( string articleText, string articleTitle, bool &noChange ) : string
articleText string The wiki text of the article.
articleTitle string Title of the article
noChange bool Value that indicated whether no change was made.
Результат string

FixLivingThingsRelatedDates() публичный статический Метод

Replace b. and d. for born/died, or date– for born per [[WP:BORN]]
public static FixLivingThingsRelatedDates ( string articleText ) : string
articleText string The wiki text of the article.
Результат string

FixMainArticle() публичный статический Метод

Fixes instances of ''Main Article: xxx'' to use {{main|xxx}}, ''see also:'' to use {{see also|xxx}}
public static FixMainArticle ( string articleText ) : string
articleText string The wiki text of the article.
Результат string

FixNonBreakingSpaces() публичный Метод

Apply non-breaking spaces for abbreviated SI units, imperial units, pp for pages. Remove incorrect space before % symbol
public FixNonBreakingSpaces ( string articleText ) : string
articleText string The wiki text of the article.
Результат string

FixPeopleCategories() публичный статический Метод

Adds [[Category:XXXX births]], [[Category:XXXX deaths]] to articles about people where available, for en-wiki only
public static FixPeopleCategories ( string articleText, string articleTitle ) : string
articleText string The wiki text of the article.
articleTitle string Title of the article
Результат string

FixPeopleCategories() публичный статический Метод

Adds [[Category:XXXX births]], [[Category:XXXX deaths]] to articles about people where available, for en-wiki only When page is not mainspace, adds [[:Category rather than [[Category Removes Date of birth missing/Date of birth missing (living people) category if full DOB in {{birth date and age}}
public static FixPeopleCategories ( string articleText, string articleTitle, bool parseTalkPage ) : string
articleText string The wiki text of the article.
articleTitle string Title of the article
parseTalkPage bool
Результат string

FixPeopleCategories() публичный Метод

Adds [[Category:XXXX births]], [[Category:XXXX deaths]] to articles about people where available, for en-wiki only
public FixPeopleCategories ( string articleText, string articleTitle, bool parseTalkPage, bool &noChange ) : string
articleText string The wiki text of the article.
articleTitle string Title of the article
parseTalkPage bool
noChange bool
Результат string

FixReferenceListTags() публичный статический Метод

Replaces various old reference tag formats, with the new {{Reflist}}, or <references/> for sv-wiki
public static FixReferenceListTags ( string articleText ) : string
articleText string The wiki text of the article
Результат string

FixReferenceTags() публичный статический Метод

Various fixes to the formatting of <ref> reference tags including case conversion and trimming excess whitespace
public static FixReferenceTags ( string articleText ) : string
articleText string The wiki text of the article
Результат string

FixSyntax() публичный статический Метод

Fixes and improves syntax (such as html markup)
public static FixSyntax ( string articleText ) : string
articleText string The wiki text of the article.
Результат string

FixSyntax() публичный статический Метод

Fixes and improves syntax (such as html markup)
public static FixSyntax ( string articleText, bool &noChange ) : string
articleText string The wiki text of the article.
noChange bool Value that indicated whether no change was made.
Результат string

FixSyntaxRedirects() публичный статический Метод

Performs fixes to redirect pages: * removes newline between #REDIRECT and link (CHECKWIKI error 36) * removes equals sign and double dot between #REDIRECT and link (CHECKWIKI error 36) * Template to Magic word conversion; removes unnecessary brackets around redirect * Simple closing bracket fixing to {{R...}} templates
public static FixSyntaxRedirects ( string articleText ) : string
articleText string
Результат string

FixSyntaxSubstRefTags() публичный статический Метод

workaround for https://phabricator.wikimedia.org/T4700 -- {{subst:}} doesn't work within ref tags
public static FixSyntaxSubstRefTags ( string articleText ) : string
articleText string
Результат string

FixTemperatures() публичный статический Метод

Fix bad Temperatures
public static FixTemperatures ( string articleText ) : string
articleText string The wiki text of the article.
Результат string

FixUnicode() публичный Метод

Performs transformations related to Unicode characters that may cause problems for different clients Removes line separator Unicode characters at start of paragraph, otherwise converts line separator, paragraph separator Unicode characters to spaces.
public FixUnicode ( string articleText ) : string
articleText string
Результат string

FormatToBDA() публичный статический Метод

takes input string of date and age e.g. "11 May 1990 (age 21)" and converts to {{birth date and age|1990|5|11}}
public static FormatToBDA ( string dateandage ) : string
dateandage string
Результат string

GetAllTemplateDetail() публичный статический Метод

Extracts a distinct list of all template calls in the input text, supporting any level of template nesting.
public static GetAllTemplateDetail ( string articleText ) : List
articleText string
Результат List

GetAllTemplates() публичный статический Метод

Extracts a list of all templates used in the input text, supporting any level of template nesting. Template name given in first letter upper
public static GetAllTemplates ( string articleText ) : List
articleText string
Результат List

GetAllWikiLinks() публичный статический Метод

Extracts a list of all wikilinks (all including cats, images etc.) used in the input text
public static GetAllWikiLinks ( string articleText ) : List
articleText string
Результат List

GetCategorySort() публичный статический Метод

Returns the sortkey used by all categories, if * all categories use the same sortkey * no {{DEFAULTSORT}} in article Otherwise returns null
public static GetCategorySort ( string articleText ) : string
articleText string The wiki text of the article.
Результат string

GetCategorySort() публичный статический Метод

Returns the sortkey used by all categories, if all categories use the same sortkey Where no sortkey is used for all categories, returns the articletitle
public static GetCategorySort ( string articleText, string articleTitle, int &matches ) : string
articleText string The wiki text of the article.
articleTitle string Title of the article
matches int Number of categories with the same or no sortkey
Результат string

GetInfoBoxFieldValue() публичный статический Метод

Returns the value of the given fields from the page's infobox, where available Returns a null string if the input article has no infobox, or the input field regex doesn't match on the infobox found
public static GetInfoBoxFieldValue ( string articleText, List fields ) : string
articleText string The wiki text of the article.
fields List List of infobox fields to search
Результат string

GetInfoBoxFieldValue() публичный статический Метод

Returns the value of the given field from the page's infobox, where available Returns a null string if the input article has no infobox, or the input field regex doesn't match on the infobox found
public static GetInfoBoxFieldValue ( string articleText, string field ) : string
articleText string The wiki text of the article.
field string infobox field to search
Результат string

GetTemplate() публичный статический Метод

Finds first occurrence of a given template in article text. Handles nested templates correctly.
public static GetTemplate ( string articleText, string template ) : string
articleText string Source text
template string Name of template, can be regex without a group capture
Результат string

GetTemplates() публичный статический Метод

Finds all templates in article text excluding commented out/nowiki'd templates. Handles nested templates and templates with embedded HTML comments correctly.
public static GetTemplates ( string articleText ) : List
articleText string Source text
Результат List

GetTemplates() публичный статический Метод

Finds every occurrence of a given template in article text, excludes commented out/nowiki'd templates Handles nested templates and templates with embedded HTML comments correctly.
public static GetTemplates ( string articleText, string template ) : List
articleText string Source text
template string Name of template
Результат List

HasBareReferences() публичный статический Метод

Returns true if the article contains bare external links in the references section (just the URL link on a line with no description/name)
public static HasBareReferences ( string articleText ) : bool
articleText string The wiki text of the article.
Результат bool

HasDeadLinks() публичный статический Метод

Returns whether the input article text contains any {{dead link}} templates, ignoring comments
public static HasDeadLinks ( string articleText ) : bool
articleText string The wiki text of the article.
Результат bool

HasDoublePipeLinks() публичный статический Метод

Returns whether the input article text contains any wikilinks with double pipes
public static HasDoublePipeLinks ( string articleText ) : bool
articleText string The wiki text of the article.
Результат bool

HasInfobox() публичный статический Метод

Checks if the article has an InfoBox (en wiki)
public static HasInfobox ( string articleText ) : bool
articleText string
Результат bool

HasMorefootnotesAndManyReferences() публичный статический Метод

Check if the article contains a {{no footnotes}} or {{more footnotes}} template but has 5+ <ref>...</ref> references
public static HasMorefootnotesAndManyReferences ( string articleText ) : bool
articleText string
Результат bool

HasNamedReferences() публичный статический Метод

Checks for named references in short format <ref name=foo />
public static HasNamedReferences ( string articleText ) : bool
articleText string The article text
Результат bool

HasRefAfterReflist() публичный статический Метод

Check if the article contains a <ref>...</ref> reference after the {{reflist}} to show them
public static HasRefAfterReflist ( string articleText ) : bool
articleText string
Результат bool

HasSeeAlsoAfterNotesReferencesOrExternalLinks() публичный статический Метод

Checks position of See also section relative to Notes, references, external links sections
public static HasSeeAlsoAfterNotesReferencesOrExternalLinks ( string articleText ) : bool
articleText string The article text
Результат bool

HasSicTag() публичный статический Метод

Check if the article contains a sic template or bracketed wording, indicating the presence of a deliberate typo
public static HasSicTag ( string articleText ) : bool
articleText string
Результат bool

HasStubTemplate() публичный статический Метод

Checks if the article has a stub template
public static HasStubTemplate ( string articleText ) : bool
articleText string
Результат bool

HasTargetLessLinks() публичный статический Метод

Returns whether the input article text contains any wikilinks with no target
public static HasTargetLessLinks ( string articleText ) : bool
articleText string The wiki text of the article.
Результат bool

HideMoreText() публичный Метод

public HideMoreText ( string articleText ) : string
articleText string
Результат string

HideMoreText() публичный Метод

public HideMoreText ( string articleText, bool hideOnlyTargetOfWikilink ) : string
articleText string
hideOnlyTargetOfWikilink bool
Результат string

HideText() публичный Метод

public HideText ( string articleText ) : string
articleText string
Результат string

HideTextImages() публичный Метод

public HideTextImages ( string articleText ) : string
articleText string
Результат string

InterwikiConversions() публичный статический Метод

Replaces legacy/deprecated language codes in interwikis with correct ones
public static InterwikiConversions ( string articleText ) : string
articleText string
Результат string

InterwikiConversions() публичный статический Метод

Replaces legacy/deprecated language codes in interwikis with correct ones
public static InterwikiConversions ( string articleText, bool &noChange ) : string
articleText string
noChange bool
Результат string

IsArticleAboutAPerson() публичный статический Метод

determines whether the article is about a person by looking for persondata/birth death categories, bio stub etc. for en wiki only
public static IsArticleAboutAPerson ( string articleText, string articleTitle ) : bool
articleText string The wiki text of the article.
articleTitle string Title of the article
Результат bool

IsArticleAboutAPerson() публичный статический Метод

determines whether the article is about a person by looking for persondata/birth death categories, bio stub etc. for en wiki only Should only return true if the article is the principle article about the individual (not early life/career/discography etc.)
public static IsArticleAboutAPerson ( string articleText, string articleTitle, bool parseTalkPage ) : bool
articleText string The wiki text of the article.
articleTitle string Title of the article
parseTalkPage bool
Результат bool

IsInUse() публичный статический Метод

Check if article has an 'in use' or 'in creation' tag
public static IsInUse ( string articleText ) : bool
articleText string
Результат bool

IsMissingReferencesDisplay() публичный статический Метод

Check if the article uses cite references but has no recognised template to display the references; only for en-wiki
public static IsMissingReferencesDisplay ( string articleText ) : bool
articleText string
Результат bool

IsStub() публичный статический Метод

Checks if the article is classible as a 'Stub'
public static IsStub ( string articleText ) : bool
articleText string
Результат bool

LivingPeople() публичный статический Метод

Adds [[Category:Living people]] to articles with a [[Category:XXXX births]] and no living people/deaths category, taking sortkey from births category if present When page is not mainspace, adds [[:Category rather than [[Category
public static LivingPeople ( string articleText, string articleTitle ) : string
articleText string The wiki text of the article.
articleTitle string The page title of the article.
Результат string

LivingPeople() публичный статический Метод

Adds [[Category:Living people]] to articles with a [[Category:XXXX births]] and no living people/deaths category, taking sortkey from births category if present
public static LivingPeople ( string articleText, string articleTitle, bool &noChange ) : string
articleText string The wiki text of the article.
articleTitle string The page title of the article.
noChange bool
Результат string

LoadDatedTemplates() публичный статический Метод

Processes the text of [[WP:AWB/Dated templates]] into a list of template names Format: * {{tl|Wikify}}
public static LoadDatedTemplates ( string text ) : List
text string The rule page text
Результат List

LoadRenamedTemplateParameters() публичный статический Метод

Loads List of templates (first letter lower), old parameter, new parameter from within {{AWB rename template parameter}}
public static LoadRenamedTemplateParameters ( string text ) : List
text string Source page of {{AWB rename template parameter}} rules
Результат List

LoadTemplateRedirects() публичный статический Метод

Processes the text of [[WP:AWB/Template redirects]] into a dictionary of regexes and new template names Format: {{tl|template 1}}, {{tl|template 2}} → {{tl|actual template}}
public static LoadTemplateRedirects ( string text ) : string>.Dictionary
text string
Результат string>.Dictionary

Mdashes() публичный Метод

Replaces hyphens and em-dashes with en-dashes, per [[WP:DASH]]
public Mdashes ( string articleText, string articleTitle ) : string
articleText string The wiki text of the article.
articleTitle string The article's title
Результат string

MergePortals() публичный статический Метод

Merges multiple {{portal}} templates into a single one, removing any duplicates. En-wiki only. Restricted to {{portal}} calls with one argument Article must have existing {{portal}} and/or a 'see also' section
public static MergePortals ( string articleText ) : string
articleText string The article text
Результат string

MergeTemplatesBySection() публичный статический Метод

Merges multiple instances of the same template in the same section
public static MergeTemplatesBySection ( string articleText ) : string
articleText string The article text
Результат string

MissingDefaultSort() публичный статический Метод

Returns whether the article is missing a defaultsort (i.e. criteria match so that defaultsort would be added)
public static MissingDefaultSort ( string articletext, string articletitle ) : bool
articletext string
articletitle string
Результат bool

MultipleIssues() публичный Метод

Combines maintenance tags into {{multiple issues}} template, for en-wiki only Operates on a section by section basis through article text
public MultipleIssues ( string articleText ) : string
articleText string
Результат string

NoIncludeIncludeOnlyProgrammingElement() публичный статический Метод

Returns whether the article text has a <noinclude> or <includeonly> or '{{{1}}}' etc. which should not appear on the mainspace
public static NoIncludeIncludeOnlyProgrammingElement ( string articleText ) : bool
articleText string The wiki text of the article.
Результат bool

Parsers() публичный Метод

Re-organises the Person Data, stub/disambig templates, categories and interwikis
public Parsers ( int stubWordCount, bool addHumanKey ) : System
stubWordCount int The number of maximum number of words for a stub.
addHumanKey bool
Результат System

PersonData() публичный статический Метод

* Adds the default {{persondata}} template to en-wiki mainspace pages about a person that don't already have {{persondata}} * Attempts to complete blank {{persondata}} fields based on infobox values
public static PersonData ( string articleText, string articleTitle ) : string
articleText string The wiki text of the article.
articleTitle string Title of the article
Результат string

PredominantDates() публичный статический Метод

Updates dates in citation templates to use the strict predominant date format in the article (en wiki only)
public static PredominantDates ( string articleText ) : string
articleText string The article text
Результат string

ReCategoriser() публичный статический Метод

Re-categorises the article.
public static ReCategoriser ( string oldCategory, string newCategory, string articleText, bool &noChange ) : string
oldCategory string The old category to replace.
newCategory string The new category.
articleText string The wiki text of the article.
noChange bool Value that indicated whether no change was made.
Результат string

ReCategoriser() публичный статический Метод

Re-categorises the article.
public static ReCategoriser ( string oldCategory, string newCategory, string articleText, bool &noChange, bool removeSortKey ) : string
oldCategory string The old category to replace.
newCategory string The new category.
articleText string The wiki text of the article.
noChange bool Value that indicated whether no change was made.
removeSortKey bool If set, any sort key is removed when the category is replaced
Результат string

RedirectTagger() публичный статический Метод

For en-wiki tags redirect pages with one or more of the templates from [[Wikipedia:Template messages/Redirect pages]] following [[WP:REDCAT]]
public static RedirectTagger ( string articleText, string articleTitle ) : string
articleText string the article text
articleTitle string the article title
Результат string

RefsAfterPunctuation() публичный статический Метод

Puts <ref> and {{sfn}} references after punctuation (comma, full stop) per WP:REFPUNC Applies to en/el wiki only
public static RefsAfterPunctuation ( string articleText ) : string
articleText string The article text
Результат string

RegularCategories() публичный статический Метод

Returns the categories that are not stub or proposed deletion categories from the input list
public static RegularCategories ( List
AllCategories ) : List
AllCategories List
List of all categories
Результат List

RegularCategories() публичный статический Метод

Returns the categories that are not stub or proposed deletion categories from the input article text
public static RegularCategories ( string articleText ) : List
articleText string Wiki text
Результат List

RegularCategories() публичный статический Метод

Returns the categories that are not stub or proposed deletion categories from the input article text
public static RegularCategories ( string articleText, bool hideComments ) : List
articleText string Wiki text
hideComments bool
Результат List

RemoveAllWhiteSpace() публичный статический Метод

Applies removes all excess whitespace from the article Not called by general fixes
public static RemoveAllWhiteSpace ( string articleText ) : string
articleText string The wiki text of the article.
Результат string

RemoveCategory() публичный статический Метод

Removes a category from an article.
public static RemoveCategory ( string strOldCat, string articleText ) : string
strOldCat string The old category to remove.
articleText string The wiki text of the article.
Результат string

RemoveCategory() публичный статический Метод

Removes a category from an article.
public static RemoveCategory ( string strOldCat, string articleText, bool &noChange ) : string
strOldCat string The old category to remove.
articleText string The wiki text of the article.
noChange bool Value that indicated whether no change was made.
Результат string

RemoveDuplicateWikiLinks() публичный статический Метод

Remove some of the duplicated wikilinks from the article text
public static RemoveDuplicateWikiLinks ( string articleText ) : string
articleText string The wiki text of the article.
Результат string

RemoveEmptyComments() публичный статический Метод

Removes HTML comments with nothing/only whitespace between tags
public static RemoveEmptyComments ( string articleText ) : string
articleText string The wiki text of the article.
Результат string

RemoveImage() публичный статический Метод

Removes an image from the article.
public static RemoveImage ( string image, string articleText, bool commentOut, string comment ) : string
image string The image to remove.
articleText string The wiki text of the article.
commentOut bool
comment string
Результат string

RemoveImage() публичный статический Метод

Removes an image in the article.
public static RemoveImage ( string image, string articleText, bool commentOut, string comment, bool &noChange ) : string
image string The image to remove.
articleText string The wiki text of the article.
commentOut bool
comment string
noChange bool Value that indicated whether no change was made.
Результат string

RemoveTemplateNamespace() публичный статический Метод

Removes Template: (or equivalent translation) from start of template calls, canonicalizes template names
public static RemoveTemplateNamespace ( string articleText ) : string
articleText string The wiki article text
Результат string

RemoveWhiteSpace() публичный статический Метод

Applies/removes some excess whitespace from the article
public static RemoveWhiteSpace ( string articleText ) : string
articleText string The wiki text of the article.
Результат string

RemoveWhiteSpace() публичный статический Метод

Applies/removes some excess whitespace from the article
public static RemoveWhiteSpace ( string articleText, bool fixOptionalWhitespace ) : string
articleText string The wiki text of the article.
fixOptionalWhitespace bool Whether to remove cosmetic whitespace
Результат string

RenameTemplateParameters() публичный статический Метод

Renames parameters in template calls. Does not rename old to new if new paramter already in use with a value
public static RenameTemplateParameters ( string articleText, List RenamedTemplateParameters ) : string
articleText string The wiki text
RenamedTemplateParameters List List of templates, old parameter, new parameter
Результат string

ReorderReferences() публичный статический Метод

Reorders references so that they appear in numerical order, allows for use of {{rp}}, doesn't modify grouped references [[WP:REFGROUP]]
public static ReorderReferences ( string articleText ) : string
articleText string The wiki text of the article.
Результат string

ReplaceImage() публичный статический Метод

Replaces an image in the article.
public static ReplaceImage ( string oldImage, string newImage, string articleText ) : string
oldImage string The old image to replace.
newImage string The new image.
articleText string The wiki text of the article.
Результат string

ReplaceImage() публичный статический Метод

Replaces an image in the article.
public static ReplaceImage ( string oldImage, string newImage, string articleText, bool &noChange ) : string
oldImage string The old image to replace.
newImage string The new image.
articleText string The wiki text of the article.
noChange bool Value that indicated whether no change was made.
Результат string

SameRefDifferentName() публичный статический Метод

Corrects named references where the reference text is the same but the reference name is different
public static SameRefDifferentName ( string articleText ) : string
articleText string the wiki text of the page
Результат string

SimplifyLinks() публичный статический Метод

Simplifies some links in article wiki text such as changing [[Dog|Dogs]] to [[Dog]]s Fixes CHECKWIKI error 64
public static SimplifyLinks ( string articleText ) : string
articleText string The wiki text of the article.
Результат string

SimplifyReferenceTags() публичный статический Метод

Replaces reference tags in the form <ref name="blah"></ref> with <ref name="blah" /> Removes some of the MW errors that occur from the prior
public static SimplifyReferenceTags ( string articleText ) : string
articleText string The wiki text of the article
Результат string

SortMetaData() публичный Метод

Re-organises the Person Data, stub/disambig templates, categories and interwikis except when a mainspace article has some 'includeonly' tags etc.
public SortMetaData ( string articleText, string articleTitle ) : string
articleText string The wiki text of the article.
articleTitle string The article title.
Результат string

SortMetaData() публичный Метод

Re-organises the Person Data, stub/disambig templates, categories and interwikis except when a mainspace article has some 'includeonly' tags etc.
public SortMetaData ( string articleText, string articleTitle, bool fixOptionalWhitespace ) : string
articleText string The wiki text of the article.
articleTitle string The article title.
fixOptionalWhitespace bool Whether to request optional excess whitespace to be fixed
Результат string

StickyLinks() публичный статический Метод

Joins nearby words with links e.g. "[[Russian literature|Russian]] literature" to "[[Russian literature]]"
public static StickyLinks ( string articleText ) : string
articleText string The wiki text of the article
Результат string

SubstUserTemplates() публичный статический Метод

Substitutes some user talk templates
public static SubstUserTemplates ( string talkPageText, string talkPageTitle, Regex userTalkTemplatesRegex ) : string
talkPageText string The wiki text of the talk page.
talkPageTitle string The wiki talk page title
userTalkTemplatesRegex Regex Dictoinary of regexes matching template calls to substitute
Результат string

TagUpdater() публичный статический Метод

Sets the date (month & year) for undated cleanup tags that take a date, from https://en.wikipedia.org/wiki/Wikipedia:AWB/Dated_templates Avoids changing tags in unformatted text areas (wiki comments etc.) Note: https://phabricator.wikimedia.org/T4700 means {{subst:}} within ref tags doesn't work, AWB doesn't do anything about it
public static TagUpdater ( string articleText ) : string
articleText string The wiki text of the article.
Результат string

Tagger() публичный Метод

If necessary, adds/removes various cleanup tags such as wikify, stub, ibid
public Tagger ( string articleText, string articleTitle, bool restrictOrphanTagging, bool &noChange, string &summary ) : string
articleText string
articleTitle string
restrictOrphanTagging bool
noChange bool
summary string
Результат string

Tagger() публичный Метод

If necessary, adds/removes wikify or stub tag
public Tagger ( string articleText, string articleTitle, bool restrictOrphanTagging, string &summary ) : string
articleText string The wiki text of the article.
articleTitle string The article title.
restrictOrphanTagging bool
summary string
Результат string

TaggerPermitted() публичный статический Метод

Checks whether Tagger is permitted on article. Allowed on mainspace for non-redirect pages without {{wi}} template Also allowed for ar-wiki namespace 104
public static TaggerPermitted ( string articleText, string articleTitle ) : bool
articleText string Article text
articleTitle string Article title
Результат bool

TargetLessLinks() публичный статический Метод

Searches for wikilinks with no target e.g. [[|foo]]
public static TargetLessLinks ( string articleText ) : int>.Dictionary
articleText string The article text
Результат int>.Dictionary

TemplateExists() публичный статический Метод

Returns whether the given regex matches any of the (first name upper) templates in the given list
public static TemplateExists ( List templatesFound, Regex r ) : bool
templatesFound List
r Regex
Результат bool

TemplateRedirects() публичный статический Метод

Renames templates to bypass template redirects from [[WP:AWB/Template redirects]] The first letter casing of the existing redirect is kept in the new template name, except for acronym templates where first letter uppercase is enforced Calls TemplateToMagicWord if changes made
public static TemplateRedirects ( string articleText, string>.Dictionary DictionaryOfTemplateRedirects ) : string
articleText string the page text
DictionaryOfTemplateRedirects string>.Dictionary Dictionary of redirects and templates
Результат string

UnbalancedBrackets() публичный статический Метод

Checks the article text for unbalanced brackets, either square or curly
public static UnbalancedBrackets ( string articleText, int &bracketLength ) : int
articleText string The wiki text of the article.
bracketLength int integer to hold length of unbalanced bracket found
Результат int

UnclosedTags() публичный статический Метод

Searches for any unclosed <math>, <source>, <ref>, <code>, <nowiki>, <small>, <pre> <center> <sup> <sub> or <gallery> tags and comments
public static UnclosedTags ( string articleText ) : int>.Dictionary
articleText string The article text
Результат int>.Dictionary

Unicodify() публичный Метод

Converts HTML entities to unicode, with some deliberate exceptions Does not change 5-character HTML hex entities
public Unicodify ( string articleText ) : string
articleText string The wiki text of the article.
Результат string

Unicodify() публичный Метод

Converts HTML entities to unicode, with some deliberate exceptions
public Unicodify ( string articleText, bool &noChange ) : string
articleText string The wiki text of the article.
noChange bool Value that indicated whether no change was made.
Результат string

UserSignature() публичный статический Метод

Searches for link to user and/or user talk namespace
public static UserSignature ( string articleText ) : int>.Dictionary
articleText string The article text
Результат int>.Dictionary

Описание свойств

StubMaxWordCount публичное статическое свойство

public static int StubMaxWordCount
Результат int