Esempio n. 1
0
def test_read_from_file_should_deliver_text():
    """
    Test, if reading a file returns a string that is not empty.
    """
    e = Event()
    e.read_file("test/test_articles/01_wikipedia_syrian_civil_war.txt")
    assert_not_equal(e.text, "")
Esempio n. 2
0
def test_correct_amount_of_events_should_be_extracted():
    """
    Test, if all events of the test-file marked_sentences.txt are extracted
    """
    e = Event()
    e.read_file("test/test_articles/marked_sentences.txt")
    assert_equal(len(e.start_extraction()), 19)
Esempio n. 3
0
def test_remove_references():
    e = Event()
    e.read_file("test/test_articles/01_wikipedia_syrian_civil_war.txt")
    text = remove_references(e.text)
    if re.search(str('\[\d{1,3}]'), text):
        print("CHECK")
    else:
        print("NO")
Esempio n. 4
0
def test_remove_references():
    e = Event()
    e.read_file("test/test_articles/01_wikipedia_syrian_civil_war.txt")
    text = remove_references(e.text)
    if re.search(str('\[\d{1,3}]'), text):
        print("CHECK")
    else:
        print("NO")
Esempio n. 5
0
def test_references_should_be_removed():
    """
    Check, if references are removed from text.
    Maybe to be refined later on, because, it is the same regex command that removes the references from text -
    therefore it is most likely that this test is fine. hmm...
    """
    e = Event()
    e.read_file("test/test_articles/01_wikipedia_syrian_civil_war.txt")
    # re searches for references in bracktes, like "[12]" and should not find any.
    assert_false(re.search(str('\[\d{1,3}]'), remove_references(e.text)))
Esempio n. 6
0
def test_read_from_file():
    e = Event()
    e.read_file("test/test_articles/random_test.txt")
    print(e.text)
Esempio n. 7
0
def test_start_extraction():
    e = Event()
    e.read_file("test/test_articles/random_test.txt")
    e.text = remove_references(e.text)
    e.start_extraction()
Esempio n. 8
0
def test_read_from_file():
    e = Event()
    e.read_file("test/test_articles/random_test.txt")
    print(e.text)
Esempio n. 9
0
def test_start_extraction():
    e = Event()
    e.read_file("test/test_articles/random_test.txt")
    e.text = remove_references(e.text)
    e.start_extraction()