for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
from topik.vectorizers.vectorizer_output import VectorizerOutput
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
class SomeClass: def some_method(self): """Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.
sample_data = [("doc1", ["frank", "frank", "frank", "dog", "cat"]),
sample_data
(([A-Z_][A-Z0-9_]*)|(__.*__))$
This check looks for invalid names for a range of different identifiers.
You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.
If your project includes a Pylint configuration file, the settings contained in that file take precedence.
To find out more about Pylint, please refer to their site.
("doc2", ["frank", "dog", "llama"]),
]
output = VectorizerOutput(sample_data, lambda x, y: x)
output
def test_global_term_count():
assert(output.global_term_count == 4)
assert
def test_document_term_count():
assert(output.document_term_counts == {"doc1": 3, "doc2": 3})
def test_term_frequency():
# TODO: is there a better place to put this such that it gets tested on all vectorization methods?
TODO
FIXME
assert(type(output.term_frequency[1]) == int)
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.