-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.py
75 lines (67 loc) · 1.36 KB
/
bootstrap.py
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
from GameReport import GameReportParser
from strat.parse import GameReportSemanticActions
from bs4 import BeautifulSoup
CITIES = [
'Atlanta',
'Boston',
'Charlotte',
'Chicago',
'Cincinnati',
'Cleveland',
'Columbus',
'Detroit',
'Miami',
'Montreal',
'Nashville',
'New Orleans',
'New York',
'Philadelphia',
'St. Louis',
'Saint Louis',
'Steel City'
]
NICKNAMES = [
'Crackers',
'Blues',
'Monarchs',
'Northsiders',
'Steamers',
'Spiders',
'Explorers',
'Clutch',
'Toros',
'Souterrains',
'Cats',
'Mudbugs',
'Knights',
'Admirals',
'Clydesdales',
'Stogies',
]
HOF_CITIES = [
'Mt. Washington',
'Mudville',
'Sirk City',
'Hackensack',
'Motor City',
'Cook County',
'Vegas',
'New Milan'
]
HOF_NICKNAMES = [
'Wonders',
'Grey Eagles',
'Spikes',
'Monuments',
'Bulls',
'Robber Barons',
'Sultans',
'Rajahs'
]
semantics = GameReportSemanticActions(cities=CITIES, nicknames=NICKNAMES)
parser = GameReportParser(parseinfo=False, semantics=semantics)
hof_semantics = GameReportSemanticActions(cities=HOF_CITIES, nicknames=HOF_NICKNAMES)
hof_parser = GameReportParser(parseinfo=False, semantics=hof_semantics)
with open('sample/test.txt', 'r') as f:
html = f.read()
soup = BeautifulSoup(html, 'html.parser')