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:
RemoveExpiredTemplateFilter
Filter to remove {{current}}.
- Attributes:
log
Log of the filter.
Methods
filter
(text)Filter text.
- class qiuwenbot.filter.expired_templates.RemoveExpiredDeadFilter[source]¶
Bases:
RemoveExpiredTemplateFilter
Filter to remove {{近期逝世}}.
- Attributes:
log
Log of the filter.
Methods
filter
(text)Filter text.
- class qiuwenbot.filter.expired_templates.RemoveExpiredDeadFilter2[source]¶
Bases:
RemoveExpiredTemplateFilter
Filter to remove {{最近逝世}}.
- Attributes:
log
Log of the filter.
Methods
filter
(text)Filter text.
- class qiuwenbot.filter.expired_templates.RemoveExpiredDeadFilter3[source]¶
Bases:
RemoveExpiredTemplateFilter
Filter to remove {{recent death}}.
- Attributes:
log
Log of the filter.
Methods
filter
(text)Filter text.
- class qiuwenbot.filter.expired_templates.RemoveExpiredTemplateFilter(template: str)[source]¶
Bases:
Filter
Filter to remove a certain tag.
- Parameters:
- tagstr
Tag name to remove.
- Attributes:
log
Log of the filter.
Methods
filter
(text)Filter text.
qiuwenbot.filter.filter module¶
- class qiuwenbot.filter.filter.Filter[source]¶
Bases:
object
Filter texts.
- Attributes:
log
Log of the filter.
Methods
filter
(text)Filter text.
- class qiuwenbot.filter.filter.FilterChain(filters: List[Filter])[source]¶
Bases:
Filter
Filter chain.
- Parameters:
- filterslist of Filter
Filters to apply.
- Attributes:
log
Log of the filter.
Methods
filter
(text)Filter text.
- class qiuwenbot.filter.filter.TextReplaceFilter(pattern: str, repl: str)[source]¶
Bases:
Filter
Filter to replace texts.
- Parameters:
- patternstr
Pattern to replace.
- replstr
Replacement.
- Attributes:
log
Log 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:
TextReplaceFilter
Filter for Fake Manchukuo authorities.
- Attributes:
log
Log 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:
Filter
Filter to replace ROC flag from a string.
- Parameters:
- patternstr
Pattern to replace.
- replstr
Replacement.
- Attributes:
log
Log of the filter.
Methods
filter
(text)Filter text.
qiuwenbot.filter.roc_year module¶
- class qiuwenbot.filter.roc_year.ReplaceROCyear[source]¶
Bases:
Filter
Filter to replace ROC year from a string.
- Parameters:
- patternstr
Pattern to replace.
- replstr
Replacement.
- Attributes:
log
Log of the filter.
Methods
filter
(text)Filter text.
qiuwenbot.filter.tw module¶
- class qiuwenbot.filter.tw.TWJPFilter[source]¶
Bases:
TextReplaceFilter
Filter to fix the Japanese authorities.
- Attributes:
log
Log of the filter.
Methods
filter
(text)Filter text.
- class qiuwenbot.filter.tw.TWLeaderFilter[source]¶
Bases:
TextReplaceFilter
Filter to fix the leader name in the Taiwan area.
- Attributes:
log
Log of the filter.
Methods
filter
(text)Filter text.
- class qiuwenbot.filter.tw.TWNameFilter1[source]¶
Bases:
TextReplaceFilter
Filter to fix the name of the Taiwan area.
- Attributes:
log
Log of the filter.
Methods
filter
(text)Filter text.
- class qiuwenbot.filter.tw.TWNameFilter2[source]¶
Bases:
TextReplaceFilter
Filter to fix the name of the Taiwan area.
- Attributes:
log
Log of the filter.
Methods
filter
(text)Filter text.
- class qiuwenbot.filter.tw.TWQingFilter[source]¶
Bases:
TextReplaceFilter
Filter to fix the Qing authorities.
- Attributes:
log
Log of the filter.
Methods
filter
(text)Filter text.
- class qiuwenbot.filter.tw.TWUnivFilter1[source]¶
Bases:
TextReplaceFilter
Filter to fix the name of unversities in the Taiwan area.
- Attributes:
log
Log of the filter.
Methods
filter
(text)Filter text.
- class qiuwenbot.filter.tw.TWUnivFilter2[source]¶
Bases:
TextReplaceFilter
Filter to fix the name of unversities in the Taiwan area.
- Attributes:
log
Log of the filter.
Methods
filter
(text)Filter text.
- class qiuwenbot.filter.tw.TWWithOthersFilter1[source]¶
Bases:
TextReplaceFilter
Filter to fix the Taiwan name when it is with other countries.
- Attributes:
log
Log of the filter.
Methods
filter
(text)Filter text.
- class qiuwenbot.filter.tw.TWWithOthersFilter2[source]¶
Bases:
TextReplaceFilter
Filter to fix the Taiwan name when it is with other countries.
- Attributes:
log
Log of the filter.
Methods
filter
(text)Filter text.
- class qiuwenbot.filter.tw.TWWithOthersInTitleFilter[source]¶
Bases:
Filter
Filter to fix the Taiwan name in title when it is with other countries.
- Attributes:
log
Log of the filter.
Methods
filter
(text)Filter text.