-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_extraction.py
More file actions
39 lines (29 loc) · 889 Bytes
/
run_extraction.py
File metadata and controls
39 lines (29 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""
This is a test-class that runs different commands.
"""
import re
from eventminer.event.event import Event
from eventminer.event.event_preprocessing import remove_references
def test_read_from_file():
e = Event()
e.read_file("test/test_articles/random_test.txt")
print(e.text)
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")
def test_start_extraction():
e = Event()
e.read_file("test/test_articles/random_test.txt")
e.text = remove_references(e.text)
e.start_extraction()
def flask_start_extraction(wiki_text):
e = Event()
e.text = wiki_text
e.text = remove_references(e.text)
return e.start_extraction()
test_start_extraction()