revscoring.features.revision_oriented

A revision-oriented nesting of basic features.

revscoring.features.revision_oriented.revision = {revision}

Revision features. The base of revision-orientation.

class revscoring.features.revision_oriented.Revision(name, revision_datasources)[source]
comment_matches(regex, name=None)[source]

Generates a revscoring.Feature that returns True when the revision’s comment matches regex.

Parameters:
regex : str | re.compile

The regex to match. Case-insensitive by default.

name : str

A name for the new feature.

page = None

Page features for the revision’s page

parent = None

Revision features for the parent revision.

user = None

User features for the revision’s user

class revscoring.features.revision_oriented.Page(name, page_datasources)[source]
id_in_set(ids, name=None)[source]

Generates a revscoring.Feature that returns True the page’s ID appears within the provided set of IDs.

Parameters:
ids : set ( int )

A set of IDs to match against the page’s ID

name : str

A name for the new feature.

namespace = None

Namespace features for the revision’s page’s namespace.

title_matches(regex, name=None)[source]

Generates a revscoring.Feature that returns True the page’s title (namespace excluded) matches regex.

Parameters:
regex : str | re.compile

The regex to match. Case-insensitive by default.

name : str

A name for the new feature.

class revscoring.features.revision_oriented.Namespace(name, namespace_datasources)[source]
id_in_set(ids, name=None)[source]

Generates a revscoring.Feature that returns True the namespaces’s ID appears within the provided set of IDs.

Parameters:
ids : set ( int )

A set of IDs to match against the namespaces’s ID

name : str

A name for the new feature.

name_matches(regex, name=None)[source]

Generates a revscoring.Feature that returns True the namespace’s name matches regex.

Parameters:
regex : str | re.compile

The regex to match. Case-insensitive by default.

name : str

A name for the new feature.

class revscoring.features.revision_oriented.User(name, user_datasources)[source]
id_in_set(ids, name=None)[source]

Generates a revscoring.Feature that returns True the user’s ID appears within the provided set of IDs.

Parameters:
ids : set ( int )

A set of IDs to match against the user’s ID

name : str

A name for the new feature.

in_group(groups, name=None)[source]

Generates a revscoring.Feature that returns True the user is in a set of groups

Parameters:
groups : set ( str )

A set of group name’s to search within.

name : str

A name for the new feature.

text_matches(regex, name=None)[source]

Generates a revscoring.Feature that returns True the user’s text (IP or username) matches regex.

Parameters:
regex : str | re.compile

The regex to match. Case-insensitive by default.

name : str

A name for the new feature.

Revision Scoring

Navigation

Related Topics