forked from mrlan/EnglishPal
17 lines
581 B
Python
17 lines
581 B
Python
from app.Article import load_text_list_from_db, load_word_list, calculate_coverage
|
|
|
|
|
|
def test_coverage_percentage():
|
|
try:
|
|
text_list = load_text_list_from_db("db\wordfreqapp.db")
|
|
word_set = load_word_list("db\The_Oxford.csv")
|
|
coverage_percentage = calculate_coverage(text_list, word_set)
|
|
|
|
assert 0 <= coverage_percentage <= 100, "Coverage percentage is not within the range [0, 100]"
|
|
|
|
print("coverage_percentage:", coverage_percentage)
|
|
except Exception as e:
|
|
print(e)
|
|
|
|
if __name__ == "__main__":
|
|
test_coverage_percentage() |