NonBlankFilter#
- class scikitplot.corpus.NonBlankFilter[source]#
Keep every document whose text holds a non-whitespace character.
For documents whose every line is content: a short block of code (
y = 2, a closing},end Foo) is not noise, andDefaultFilter, built for prose, would drop it.CodeAwareFilterapplies this rule to code andDefaultFilterto the rest.Examples
>>> f = NonBlankFilter() >>> f.include(CorpusDocument.create("f.py", 0, "}")) True >>> f.include(CorpusDocument.create("f.py", 1, "42")) True
- include(doc)[source]#
Return
Truewhen doc’s text is not blank.- Parameters:
doc (CorpusDocument)
- Return type: