qiuwenbot.filter package
Filter texts.
Submodules
qiuwenbot.filter.clean_refs module
qiuwenbot.filter.common module
qiuwenbot.filter.expired_templates module
- class qiuwenbot.filter.expired_templates.RemoveExpiredCurrentFilter[source]
Bases:
RemoveExpiredTemplateFilterFilter to remove {{current}}.
- Attributes:
logLog of the filter.
Methods
filter(text)Filter text.
- class qiuwenbot.filter.expired_templates.RemoveExpiredDeadFilter[source]
Bases:
RemoveExpiredTemplateFilterFilter to remove {{近期逝世}}.
- Attributes:
logLog of the filter.
Methods
filter(text)Filter text.
- class qiuwenbot.filter.expired_templates.RemoveExpiredDeadFilter2[source]
Bases:
RemoveExpiredTemplateFilterFilter to remove {{最近逝世}}.
- Attributes:
logLog of the filter.
Methods
filter(text)Filter text.
- class qiuwenbot.filter.expired_templates.RemoveExpiredDeadFilter3[source]
Bases:
RemoveExpiredTemplateFilterFilter to remove {{recent death}}.
- Attributes:
logLog of the filter.
Methods
filter(text)Filter text.
- class qiuwenbot.filter.expired_templates.RemoveExpiredTemplateFilter(template: str)[source]
Bases:
FilterFilter to remove a certain tag.
- Parameters:
- tagstr
Tag name to remove.
- Attributes:
logLog of the filter.
Methods
filter(text)Filter text.
qiuwenbot.filter.filter module
- class qiuwenbot.filter.filter.Filter[source]
Bases:
objectFilter texts.
- Attributes:
logLog of the filter.
Methods
filter(text)Filter text.
- class qiuwenbot.filter.filter.FilterChain(filters: List[Filter])[source]
Bases:
FilterFilter chain.
- Parameters:
- filterslist of Filter
Filters to apply.
- Attributes:
logLog of the filter.
Methods
filter(text)Filter text.
- class qiuwenbot.filter.filter.TextReplaceFilter(pattern: str, repl: str)[source]
Bases:
FilterFilter to replace texts.
- Parameters:
- patternstr
Pattern to replace.
- replstr
Replacement.
- Attributes:
logLog of the filter.
Methods
filter(text)Filter text.
- qiuwenbot.filter.filter.register_filter(cls: Filter) Filter[source]
Return a decorator to register filter.
The filter should not have any parameters in its constructor.
- Parameters:
- clsFilter
Filter to register.
- Returns:
- Filter
Registered filter.
Examples
>>> @register_filter() ... class Filter1(Filter): ... pass
qiuwenbot.filter.gov module
qiuwenbot.filter.history module
- class qiuwenbot.filter.history.FakeManchukuoFilter[source]
Bases:
TextReplaceFilterFilter for Fake Manchukuo authorities.
- Attributes:
logLog of the filter.
Methods
filter(text)Filter text.
qiuwenbot.filter.hk module
qiuwenbot.filter.roc_flag module
- class qiuwenbot.filter.roc_flag.ReplaceROCyear[source]
Bases:
FilterFilter to replace ROC flag from a string.
- Parameters:
- patternstr
Pattern to replace.
- replstr
Replacement.
- Attributes:
logLog of the filter.
Methods
filter(text)Filter text.
qiuwenbot.filter.roc_year module
- class qiuwenbot.filter.roc_year.ReplaceROCyear[source]
Bases:
FilterFilter to replace ROC year from a string.
- Parameters:
- patternstr
Pattern to replace.
- replstr
Replacement.
- Attributes:
logLog of the filter.
Methods
filter(text)Filter text.
qiuwenbot.filter.tw module
- class qiuwenbot.filter.tw.TWJPFilter[source]
Bases:
TextReplaceFilterFilter to fix the Japanese authorities.
- Attributes:
logLog of the filter.
Methods
filter(text)Filter text.
- class qiuwenbot.filter.tw.TWLeaderFilter[source]
Bases:
TextReplaceFilterFilter to fix the leader name in the Taiwan area.
- Attributes:
logLog of the filter.
Methods
filter(text)Filter text.
- class qiuwenbot.filter.tw.TWNameFilter1[source]
Bases:
TextReplaceFilterFilter to fix the name of the Taiwan area.
- Attributes:
logLog of the filter.
Methods
filter(text)Filter text.
- class qiuwenbot.filter.tw.TWNameFilter2[source]
Bases:
TextReplaceFilterFilter to fix the name of the Taiwan area.
- Attributes:
logLog of the filter.
Methods
filter(text)Filter text.
- class qiuwenbot.filter.tw.TWQingFilter[source]
Bases:
TextReplaceFilterFilter to fix the Qing authorities.
- Attributes:
logLog of the filter.
Methods
filter(text)Filter text.
- class qiuwenbot.filter.tw.TWUnivFilter1[source]
Bases:
TextReplaceFilterFilter to fix the name of unversities in the Taiwan area.
- Attributes:
logLog of the filter.
Methods
filter(text)Filter text.
- class qiuwenbot.filter.tw.TWUnivFilter2[source]
Bases:
TextReplaceFilterFilter to fix the name of unversities in the Taiwan area.
- Attributes:
logLog of the filter.
Methods
filter(text)Filter text.
- class qiuwenbot.filter.tw.TWWithOthersFilter1[source]
Bases:
TextReplaceFilterFilter to fix the Taiwan name when it is with other countries.
- Attributes:
logLog of the filter.
Methods
filter(text)Filter text.
- class qiuwenbot.filter.tw.TWWithOthersFilter2[source]
Bases:
TextReplaceFilterFilter to fix the Taiwan name when it is with other countries.
- Attributes:
logLog of the filter.
Methods
filter(text)Filter text.
- class qiuwenbot.filter.tw.TWWithOthersInTitleFilter[source]
Bases:
FilterFilter to fix the Taiwan name in title when it is with other countries.
- Attributes:
logLog of the filter.
Methods
filter(text)Filter text.